Administration

Environment Variables

Every setting AirTrail reads from the environment.

AirTrail reads its configuration from environment variables. With Docker Compose they live in the .env file next to docker-compose.yml; after editing it, apply the change with docker compose up -d. For a manual installation, pass the file with node --env-file=.env build.

Comment out a variable you do not use instead of leaving it empty. An empty value (KEY=) is treated as not set.

Core

VariableRequiredDefaultDescription
ORIGINYesThe exact URL users open AirTrail at, such as https://airtrail.example.com. Must match the browser's address bar, or sign-in fails.
DB_URLYesPostgreSQL connection URL, for example postgres://airtrail:password@db:5432/airtrail.
UPLOAD_LOCATIONNoDirectory for uploaded files such as airline icons. Uploads are disabled when unset. The Docker setup uses /app/uploads, backed by the uploads volume.
BODY_SIZE_LIMITNo20MLargest request body accepted. Flight forms with detailed tracks can be large.
PUIDNo1000User ID the Docker container runs as. The uploads directory is given to this user on every start.
PGIDNo1000Group ID the Docker container runs as.

Docker database

These configure the db container in the Compose file. They are not read by AirTrail itself, so keep the password in DB_URL in sync with DB_PASSWORD.

VariableDefaultDescription
DB_PASSWORDpasswordPostgres password. Use letters and digits only. Changing it after the first start also requires changing it inside the database.
DB_USERNAMEairtrailPostgres user.
DB_DATABASE_NAMEairtrailPostgres database name.

Network and proxies

VariableDefaultDescription
ADDRESS_HEADERHeader holding the client address behind a reverse proxy, usually X-Forwarded-For. Rate limits use it. Leave unset when clients connect directly.
XFF_DEPTH1How many proxies sit in front of AirTrail, counted from the right of X-Forwarded-For.
PORT3000Port to listen on (manual installations).
HOST0.0.0.0Address to listen on (manual installations).

For outbound traffic through a corporate proxy (NODE_USE_ENV_PROXY, HTTPS_PROXY, NO_PROXY, NODE_EXTRA_CA_CERTS), see Outbound proxy.

Settings you can also change in the app

The variables below mirror settings on the Settings pages. When a variable is set, AirTrail applies it on startup and locks the matching field in the app so it can only be changed in the environment. Removing the variable unlocks the field again, keeping the last value.

OAuth sign-in

See OAuth for what each setting does.

VariableDefault
OAUTH_ENABLEDfalse
OAUTH_ISSUER_URL
OAUTH_CLIENT_ID
OAUTH_CLIENT_SECRET
OAUTH_TOKEN_ENDPOINT_AUTH_METHODclient_secret_post
OAUTH_SCOPEopenid profile
OAUTH_PROMPT
OAUTH_AUTO_REGISTERtrue
OAUTH_AUTO_LOGINfalse
OAUTH_HIDE_PASSWORD_FORMfalse
OAUTH_BUTTON_TEXTLog in with SSO
OAUTH_ALLOW_INSECURE_HTTPfalse

OAUTH_ALLOW_INSECURE_HTTP=true allows an identity provider served over plain HTTP. Use it only on a trusted local network.

Integrations

VariableDescription
INTEGRATIONS_AERO_DATA_BOX_KEYAPI key for AeroDataBox flight lookups.
INTEGRATIONS_OPEN_AIP_KEYAPI key for the OpenAIP map overlay.

Basemaps

See Basemaps for how these combine.

VariableDefault
MAP_PROVIDERopenfreemap
MAP_CARTO_API_KEY
MAP_PROTOMAPS_SOURCE_KINDhosted
MAP_PROTOMAPS_API_KEY
MAP_PROTOMAPS_SOURCE_URL
MAP_PROTOMAPS_MAX_ZOOM15
MAP_PROTOMAPS_ASSETS_BASE_URLhttps://protomaps.github.io/basemaps-assets
MAP_PROTOMAPS_LANGUAGEen
MAP_LIGHT_STYLE_URL
MAP_DARK_STYLE_URL

Demo instances

For running a public demo, like the one linked from the documentation. Leave these unset on a normal installation.

VariableDescription
DEMO_MODESet to true to turn the instance into a demo. On an empty database it creates demo accounts and several years of flights. Visitors enter with one click at /demo and can switch between accounts. The SQL console, integrations and sign-in settings are unavailable, and passwords and usernames can't be changed.
DEMO_SESSION_ENDS_ATWhen the demo will be deleted, as a Unix time in milliseconds or an ISO date. The demo banner counts down to it.

Last updated on

On this page