Skip to content

Latest commit

 

History

History
289 lines (193 loc) · 6.15 KB

ENVIRONMENT.md

File metadata and controls

289 lines (193 loc) · 6.15 KB

Environment variables

The example app uses declarative environment variables powered by Austenite.

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

Tip

If you set an empty value for an environment variable, the app behaves as if that variable isn't set.

CDN_URL

CDN to use when serving static assets

The CDN_URL variable is a required variable that takes absolute URL values, with these constraints:

  • Protocol must be http: or https:

Example values

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

DEBUG

Enable or disable debugging features

The DEBUG variable is an optional variable that takes true or false.

Default value

export DEBUG=false # default

Example values

export DEBUG=true # true
export DEBUG=false # false

EARTH_ATOM_COUNT

Number of atoms on earth

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

Example values

export EARTH_ATOM_COUNT=123456 # positive
export EARTH_ATOM_COUNT=-123456 # negative
export EARTH_ATOM_COUNT=0x1e240 # hexadecimal
export EARTH_ATOM_COUNT=0o361100 # octal
export EARTH_ATOM_COUNT=0b11110001001000000 # binary

GRPC_TIMEOUT

GRPC request timeout

The GRPC_TIMEOUT variable is an optional variable that takes ISO 8601 duration values, with these constraints:

  • Must be >= PT0.1S and <= PT10S

Example values

export GRPC_TIMEOUT=PT0.3S # 300 milliseconds
export GRPC_TIMEOUT=PT5S # 5 seconds

LOG_LEVEL

The minimum log level to record

The LOG_LEVEL variable is an optional variable that takes debug, info, warn, error, or fatal.

Default value

export LOG_LEVEL=info # default

Example values

export LOG_LEVEL=debug # show information for developers
export LOG_LEVEL=info # standard log messages
export LOG_LEVEL=warn # important, but don't need individual human review
export LOG_LEVEL=error # a healthy application shouldn't produce any errors
export LOG_LEVEL=fatal # the application cannot proceed

PORT

Listen port for the HTTP server

The PORT variable is an optional variable that takes port number values.

Default value

export PORT=8080 # default

Example values

export PORT=12345 # a port number

READ_DSN

Database connection string for read-models

The READ_DSN variable is a required variable that takes string values, with these constraints:

  • Must have a minimum length of 30

Example values

export READ_DSN='host=localhost dbname=readmodels user=projector' # local database

REDIS_PRIMARY_SERVICE_HOST

Kubernetes redis-primary service host

The REDIS_PRIMARY_SERVICE_HOST variable is a required variable that takes hostname values.

Example values

export REDIS_PRIMARY_SERVICE_HOST=service.example.org # a hostname
export REDIS_PRIMARY_SERVICE_HOST=10.0.0.11 # an IP address

REDIS_PRIMARY_SERVICE_PORT

Kubernetes redis-primary service port

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

Example values

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 takes number values.

Example values

export SAMPLE_RATIO=123456 # integer
export SAMPLE_RATIO=123.456 # positive
export SAMPLE_RATIO=-123.456 # negative
export SAMPLE_RATIO=1.23456e+2 # exponential
export SAMPLE_RATIO=0x1e240 # hexadecimal
export SAMPLE_RATIO=0o361100 # octal
export SAMPLE_RATIO=0b11110001001000000 # binary

SESSION_KEY

Session token signing key

The SESSION_KEY variable is a required variable that takes base64 values.

Example values

export SESSION_KEY=Y29ucXVpc3RhZG9y # base64 encoded string

WEIGHT

Weighting for this node

The WEIGHT variable is a required variable that takes integer values, with these constraints:

  • Must be >= 1

Example values

export WEIGHT=1 # lowest
export WEIGHT=100 # high
export WEIGHT=1000 # very high