Reference
Environment Variables
What the server reads from its environment.
TotalBase reads only a few things from its environment: the database connection, the master key, the first administrator, and the process's own address. Everything else is a setting, changed in the admin.
Required
| Variable | |
|---|---|
POSTGRES_HOST, POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD | the connection. The role in POSTGRES_USER is the upper limit of what TotalBase can do: see PostgreSQL |
Optional
| Variable | Default | |
|---|---|---|
POSTGRES_PORT | 5432 | |
POSTGRES_SSL | off | off, require (encrypted, certificate not verified) or verify-full |
POSTGRES_SSL_CA | a PEM file for verify-full; else the system's authorities | |
TOTALBASE_MASTER_KEY | generated | encrypts stored secrets; at least 32 characters. Unset: the first start generates one into TOTALBASE_DATA_DIR/master.key. Never stored in the database; back it up separately |
TOTALBASE_DATA_DIR | /var/lib/totalbase | what TotalBase keeps on disk: uploaded files and a generated master key. Mount a volume here |
TOTALBASE_ADMIN_EMAIL, TOTALBASE_ADMIN_PASSWORD | the first administrator, created on the first start while no user is an administrator; changing them later changes nothing. Unset: the first setup in the browser | |
TOTALBASE_SETUP_CODE | generated | the first setup's code, for a program that sets it (at least 16 characters). Unset: one kept in TOTALBASE_DATA_DIR/setup-code and shown in the log |
TOTALBASE_PUBLIC_URL | http://localhost:<port> | the instance's address, used for links until the Public URL setting is set (the first setup sets it) |
TOTALBASE_HOST | 0.0.0.0 | the address the server listens on |
TOTALBASE_PORT | 3050 | the port |
TOTALBASE_STATEMENT_TIMEOUT_MS | 30000 | the timeout of every SQL statement on the pool |
TOTALBASE_ADMIN_UI_ENABLED | true | false serves the APIs only, without the admin and the App |
TOTALBASE_ADMIN_UI_DIR | where the built admin is, if not in its usual place | |
LOG_LEVEL | info | |
NODE_ENV | production in production |
What isn't here
Pool size, rate limits, CORS, SMTP, sessions, file storage: they're settings, stored in the database and changed in the admin without a restart (a few, like the pool, apply after one). Passwords and keys those settings need go in Secrets.