Skip to content

Commit

Permalink
fixup! WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Mar 16, 2024
1 parent 0740aea commit 1e02f50
Showing 1 changed file with 80 additions and 53 deletions.
133 changes: 80 additions & 53 deletions ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,50 @@ The `run.ts` app uses **declarative environment variables** powered by

[austenite]: https://github.com/ezzatron/austenite

| Name | Optionality | Description |
| :-------------------------------------------------------------- | :------------------ | :----------------------------------------- |
| **[`CDN_URL`](#CDN_URL)** | Required | CDN to use when serving static assets |
| **[`DEBUG`](#DEBUG)** | Defaults to `false` | Enable or disable debugging features |
| **[`EARTH_ATOM_COUNT`](#EARTH_ATOM_COUNT)** | Optional | Number of atoms on earth |
| **[`GRPC_TIMEOUT`](#GRPC_TIMEOUT)** | Optional | GRPC request timeout |
| **[`LOG_LEVEL`](#LOG_LEVEL)** | Defaults to `info` | The minimum log level to record |
| **[`PORT`](#PORT)** | Defaults to `8080` | Listen port for the HTTP server |
| **[`READ_DSN`](#READ_DSN)** | Required | Database connection string for read-models |
| **[`REDIS_PRIMARY_SERVICE_HOST`](#REDIS_PRIMARY_SERVICE_HOST)** | Required | Kubernetes `redis-primary` service host |
| **[`REDIS_PRIMARY_SERVICE_PORT`](#REDIS_PRIMARY_SERVICE_PORT)** | Required | Kubernetes `redis-primary` service port |
| **[`SAMPLE_RATIO`](#SAMPLE_RATIO)** | Optional | Ratio of requests to sample |
| **[`SESSION_KEY`](#SESSION_KEY)** | Required | Session token signing key |
| **[`WEIGHT`](#WEIGHT)** | Required | Weighting for this node |
| Name | Usage | Description |
| :---------------------------------------------------------- | :------- | :----------------------------------------- |
| [`CDN_URL`](#CDN_URL) | Required | CDN to use when serving static assets |
| [`DEBUG`](#DEBUG) | Optional | Enable or disable debugging features |
| [`EARTH_ATOM_COUNT`](#EARTH_ATOM_COUNT) | Optional | Number of atoms on earth |
| [`GRPC_TIMEOUT`](#GRPC_TIMEOUT) | Optional | GRPC request timeout |
| [`LOG_LEVEL`](#LOG_LEVEL) | Optional | The minimum log level to record |
| [`PORT`](#PORT) | Optional | Listen port for the HTTP server |
| [`READ_DSN`](#READ_DSN) | Required | Database connection string for read-models |
| [`REDIS_PRIMARY_SERVICE_HOST`](#REDIS_PRIMARY_SERVICE_HOST) | Required | Kubernetes `redis-primary` service host |
| [`REDIS_PRIMARY_SERVICE_PORT`](#REDIS_PRIMARY_SERVICE_PORT) | Required | Kubernetes `redis-primary` service port |
| [`SAMPLE_RATIO`](#SAMPLE_RATIO) | Optional | Ratio of requests to sample |
| [`SESSION_KEY`](#SESSION_KEY) | Required | Session token signing key |
| [`WEIGHT`](#WEIGHT) | Required | Weighting for this node |

## `CDN_URL`

_CDN to use when serving static assets_

The `CDN_URL` variable is a **required** variable that accepts **URL** values.
The `CDN_URL` variable is a **required** variable
that takes **URL** values.

### `CDN_URL` example values
### Example values

```sh
```sh
export CDN_URL=https://host.example.org/path/to/resource # URL (absolute)
```

## `DEBUG`

_Enable or disable debugging features_

This variable **MAY** be set to one of the values below.
If left undefined, the default value is used (see below).
The `DEBUG` variable is an **optional** variable
that takes `true` or `false`.

### Default value

```sh
export DEBUG=false # default
```

### `DEBUG` example values
### Example values

```sh
```sh
export DEBUG=true # true
```

Expand All @@ -53,11 +60,12 @@ export DEBUG=false # false

_Number of atoms on earth_

The `EARTH_ATOM_COUNT` variable is an **optional** variable that accepts **big integer** values.
The `EARTH_ATOM_COUNT` variable is an **optional** variable
that takes **big integer** values.

### `EARTH_ATOM_COUNT` example values
### Example values

```sh
```sh
export EARTH_ATOM_COUNT=123456 # positive
```

Expand All @@ -81,11 +89,12 @@ export EARTH_ATOM_COUNT=0b11110001001000000 # binary

_GRPC request timeout_

The `GRPC_TIMEOUT` variable is an **optional** variable that accepts **ISO 8601 duration** values.
The `GRPC_TIMEOUT` variable is an **optional** variable
that takes **ISO 8601 duration** values.

### `GRPC_TIMEOUT` example values
### Example values

```sh
```sh
export GRPC_TIMEOUT=PT1M30S # ISO 8601 duration
```

Expand All @@ -97,12 +106,18 @@ export GRPC_TIMEOUT=P1M15DT12H # ISO 8601 duration

_The minimum log level to record_

This variable **MAY** be set to one of the values below.
If left undefined, the default value is used (see below).
The `LOG_LEVEL` variable is an **optional** variable
that takes `debug`, `info`, `warn`, `error`, or `fatal`.

### Default value

```sh
export LOG_LEVEL=info # default
```

### `LOG_LEVEL` example values
### Example values

```sh
```sh
export LOG_LEVEL=debug # show information for developers
```

Expand All @@ -126,24 +141,31 @@ export LOG_LEVEL=fatal # the application cannot proceed

_Listen port for the HTTP server_

The `PORT` variable is an **optional** variable that accepts **port number** values.
If `PORT` is _not_ set, a default value is used.
The `PORT` variable is an **optional** variable
that takes **port number** values.

### Default value

```sh
export PORT=8080 # default
```

### `PORT` example values
### Example values

```sh
```sh
export PORT=12345 # a port number
```

## `READ_DSN`

_Database connection string for read-models_

The `READ_DSN` variable is a **required** variable that accepts **string** values.
The `READ_DSN` variable is a **required** variable
that takes **string** values.

### `READ_DSN` example values
### Example values

```sh
```sh
export READ_DSN=conquistador # any value
```

Expand All @@ -155,11 +177,12 @@ export READ_DSN='alabaster parakeet' # some values may need escaping

_Kubernetes `redis-primary` service host_

The `REDIS_PRIMARY_SERVICE_HOST` variable is a **required** variable that accepts **hostname** values.
The `REDIS_PRIMARY_SERVICE_HOST` variable is a **required** variable
that takes **hostname** values.

### `REDIS_PRIMARY_SERVICE_HOST` example values
### Example values

```sh
```sh
export REDIS_PRIMARY_SERVICE_HOST=service.example.org # a hostname
```

Expand All @@ -171,23 +194,25 @@ export REDIS_PRIMARY_SERVICE_HOST=10.0.0.11 # an IP address

_Kubernetes `redis-primary` service port_

The `REDIS_PRIMARY_SERVICE_PORT` variable is a **required** variable that accepts **port number** values.
The `REDIS_PRIMARY_SERVICE_PORT` variable is a **required** variable
that takes **port number** values.

### `REDIS_PRIMARY_SERVICE_PORT` example values
### Example values

```sh
```sh
export REDIS_PRIMARY_SERVICE_PORT=12345 # a port number
```

## `SAMPLE_RATIO`

_Ratio of requests to sample_

The `SAMPLE_RATIO` variable is an **optional** variable that accepts **number** values.
The `SAMPLE_RATIO` variable is an **optional** variable
that takes **number** values.

### `SAMPLE_RATIO` example values
### Example values

```sh
```sh
export SAMPLE_RATIO=123456 # integer
```

Expand Down Expand Up @@ -219,23 +244,25 @@ export SAMPLE_RATIO=0b11110001001000000 # binary

_Session token signing key_

The `SESSION_KEY` variable is a **required** variable that accepts **base64** values.
The `SESSION_KEY` variable is a **required** variable
that takes **base64** values.

### `SESSION_KEY` example values
### Example values

```sh
```sh
export SESSION_KEY=Y29ucXVpc3RhZG9y # base64 encoded string
```

## `WEIGHT`

_Weighting for this node_

The `WEIGHT` variable is a **required** variable that accepts **integer** values.
The `WEIGHT` variable is a **required** variable
that takes **integer** values.

### `WEIGHT` example values
### Example values

```sh
```sh
export WEIGHT=123456 # positive
```

Expand Down

0 comments on commit 1e02f50

Please sign in to comment.