Skip to content

Commit

Permalink
Fix environment variable names.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed Mar 3, 2023
1 parent 6a63349 commit f2ac4ea
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 34 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ The format is based on [Keep a Changelog], and this project adheres to
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
[semantic versioning]: https://semver.org/spec/v2.0.0.html

## [0.1.3] - 2023-03-03

- Return environment variable naming to match v0.1.1, as the change in v0.1.2
was not intended.

## [0.1.2] - 2023-03-03

- Use Go v1.20 at runtime (via `golang:latest` docker image)
Expand All @@ -28,6 +33,7 @@ The format is based on [Keep a Changelog], and this project adheres to
[0.1.0]: https://github.com/dogmatiq/browser/releases/v0.1.0
[0.1.1]: https://github.com/dogmatiq/browser/releases/v0.1.1
[0.1.2]: https://github.com/dogmatiq/browser/releases/v0.1.2
[0.1.3]: https://github.com/dogmatiq/browser/releases/v0.1.3

<!-- version template
## [0.0.1] - YYYY-MM-DD
Expand Down
62 changes: 31 additions & 31 deletions ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ equivalent.
## Index

- [`DSN`](#DSN) — the PostgreSQL connection string
- [`GITHUB_APP_CLIENT_ID`](#GITHUB_APP_CLIENT_ID) — the client ID of the GitHub application used to read repository content
- [`GITHUB_APP_CLIENT_SECRET`](#GITHUB_APP_CLIENT_SECRET) — the client secret for the GitHub application used to read repository content
- [`GITHUB_APP_ID`](#GITHUB_APP_ID) — the ID of the GitHub application used to read repository content
- [`GITHUB_APP_PRIVATE_KEY`](#GITHUB_APP_PRIVATE_KEY) — the private key for the GitHub application used to read repository content
- [`GITHUB_CLIENT_ID`](#GITHUB_CLIENT_ID) — the client ID of the GitHub application used to read repository content
- [`GITHUB_CLIENT_SECRET`](#GITHUB_CLIENT_SECRET) — the client secret for the GitHub application used to read repository content
- [`GITHUB_HOOK_SECRET`](#GITHUB_HOOK_SECRET) — the secret used to verify GitHub web-hook requests are genuine
- [`GITHUB_PRIVATE_KEY`](#GITHUB_PRIVATE_KEY) — the private key for the GitHub application used to read repository content
- [`GITHUB_URL`](#GITHUB_URL) — the base URL of the GitHub API

## Specification
Expand All @@ -35,64 +35,64 @@ exit with a non-zero exit code.
export DSN=foo # (non-normative)
```

### `GITHUB_APP_CLIENT_ID`
### `GITHUB_APP_ID`

> the client ID of the GitHub application used to read repository content
> the ID of the GitHub application used to read repository content
This variable **MUST** be set to a non-empty string.
This variable **MUST** be set to `1` or greater.
If left undefined the application will print usage information to `STDERR` then
exit with a non-zero exit code.

```bash
export GITHUB_APP_CLIENT_ID=foo # (non-normative)
export GITHUB_APP_ID=4611686018427387904 # (non-normative)
```

### `GITHUB_APP_CLIENT_SECRET`
### `GITHUB_CLIENT_ID`

> the client secret for the GitHub application used to read repository content
> the client ID of the GitHub application used to read repository content
This variable **MUST** be set to a non-empty string.
If left undefined the application will print usage information to `STDERR` then
exit with a non-zero exit code.

```bash
export GITHUB_APP_CLIENT_SECRET=foo # (non-normative)
export GITHUB_CLIENT_ID=foo # (non-normative)
```

### `GITHUB_APP_ID`
### `GITHUB_CLIENT_SECRET`

> the ID of the GitHub application used to read repository content
> the client secret for the GitHub application used to read repository content
This variable **MUST** be set to `1` or greater.
This variable **MUST** be set to a non-empty string.
If left undefined the application will print usage information to `STDERR` then
exit with a non-zero exit code.

```bash
export GITHUB_APP_ID=4611686018427387904 # (non-normative)
export GITHUB_CLIENT_SECRET=foo # (non-normative)
```

### `GITHUB_APP_PRIVATE_KEY`
### `GITHUB_HOOK_SECRET`

> the private key for the GitHub application used to read repository content
> the secret used to verify GitHub web-hook requests are genuine
This variable **MUST** be set to a non-empty string.
If left undefined the application will print usage information to `STDERR` then
exit with a non-zero exit code.

```bash
export GITHUB_APP_PRIVATE_KEY=foo # (non-normative)
export GITHUB_HOOK_SECRET=foo # (non-normative)
```

### `GITHUB_HOOK_SECRET`
### `GITHUB_PRIVATE_KEY`

> the secret used to verify GitHub web-hook requests are genuine
> the private key for the GitHub application used to read repository content
This variable **MUST** be set to a non-empty string.
If left undefined the application will print usage information to `STDERR` then
exit with a non-zero exit code.

```bash
export GITHUB_HOOK_SECRET=foo # (non-normative)
export GITHUB_PRIVATE_KEY=foo # (non-normative)
```

### `GITHUB_URL`
Expand Down Expand Up @@ -126,16 +126,16 @@ spec:
env:
- name: DSN # the PostgreSQL connection string
value: foo
- name: GITHUB_APP_CLIENT_ID # the client ID of the GitHub application used to read repository content
value: foo
- name: GITHUB_APP_CLIENT_SECRET # the client secret for the GitHub application used to read repository content
value: foo
- name: GITHUB_APP_ID # the ID of the GitHub application used to read repository content
value: "4611686018427387904"
- name: GITHUB_APP_PRIVATE_KEY # the private key for the GitHub application used to read repository content
- name: GITHUB_CLIENT_ID # the client ID of the GitHub application used to read repository content
value: foo
- name: GITHUB_CLIENT_SECRET # the client secret for the GitHub application used to read repository content
value: foo
- name: GITHUB_HOOK_SECRET # the secret used to verify GitHub web-hook requests are genuine
value: foo
- name: GITHUB_PRIVATE_KEY # the private key for the GitHub application used to read repository content
value: foo
- name: GITHUB_URL # the base URL of the GitHub API
value: https://example.org/path
```
Expand All @@ -150,11 +150,11 @@ metadata:
name: example-config-map
data:
DSN: foo # the PostgreSQL connection string
GITHUB_APP_CLIENT_ID: foo # the client ID of the GitHub application used to read repository content
GITHUB_APP_CLIENT_SECRET: foo # the client secret for the GitHub application used to read repository content
GITHUB_APP_ID: "4611686018427387904" # the ID of the GitHub application used to read repository content
GITHUB_APP_PRIVATE_KEY: foo # the private key for the GitHub application used to read repository content
GITHUB_CLIENT_ID: foo # the client ID of the GitHub application used to read repository content
GITHUB_CLIENT_SECRET: foo # the client secret for the GitHub application used to read repository content
GITHUB_HOOK_SECRET: foo # the secret used to verify GitHub web-hook requests are genuine
GITHUB_PRIVATE_KEY: foo # the private key for the GitHub application used to read repository content
GITHUB_URL: https://example.org/path # the base URL of the GitHub API
---
apiVersion: apps/v1
Expand Down Expand Up @@ -184,11 +184,11 @@ service:
example-service:
environment:
DSN: foo # the PostgreSQL connection string
GITHUB_APP_CLIENT_ID: foo # the client ID of the GitHub application used to read repository content
GITHUB_APP_CLIENT_SECRET: foo # the client secret for the GitHub application used to read repository content
GITHUB_APP_ID: "4611686018427387904" # the ID of the GitHub application used to read repository content
GITHUB_APP_PRIVATE_KEY: foo # the private key for the GitHub application used to read repository content
GITHUB_CLIENT_ID: foo # the client ID of the GitHub application used to read repository content
GITHUB_CLIENT_SECRET: foo # the client secret for the GitHub application used to read repository content
GITHUB_HOOK_SECRET: foo # the secret used to verify GitHub web-hook requests are genuine
GITHUB_PRIVATE_KEY: foo # the private key for the GitHub application used to read repository content
GITHUB_URL: https://example.org/path # the base URL of the GitHub API
```

Expand Down
6 changes: 3 additions & 3 deletions cmd/browser/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ var githubAppID = ferrite.
Required()

var githubAppClientID = ferrite.
String("GITHUB_APP_CLIENT_ID", "the client ID of the GitHub application used to read repository content").
String("GITHUB_CLIENT_ID", "the client ID of the GitHub application used to read repository content").
Required()

var githubAppClientSecret = ferrite.
String("GITHUB_APP_CLIENT_SECRET", "the client secret for the GitHub application used to read repository content").
String("GITHUB_CLIENT_SECRET", "the client secret for the GitHub application used to read repository content").
Required()

var githubAppPrivateKey = ferrite.
String("GITHUB_APP_PRIVATE_KEY", "the private key for the GitHub application used to read repository content").
String("GITHUB_PRIVATE_KEY", "the private key for the GitHub application used to read repository content").
Required()

var githubAppHookSecret = ferrite.
Expand Down

0 comments on commit f2ac4ea

Please sign in to comment.