TotalBase
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_PASSWORDthe connection. The role in POSTGRES_USER is the upper limit of what TotalBase can do: see PostgreSQL

Optional

VariableDefault
POSTGRES_PORT5432
POSTGRES_SSLoffoff, require (encrypted, certificate not verified) or verify-full
POSTGRES_SSL_CAa PEM file for verify-full; else the system's authorities
TOTALBASE_MASTER_KEYgeneratedencrypts 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/totalbasewhat TotalBase keeps on disk: uploaded files and a generated master key. Mount a volume here
TOTALBASE_ADMIN_EMAIL, TOTALBASE_ADMIN_PASSWORDthe 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_CODEgeneratedthe 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_URLhttp://localhost:<port>the instance's address, used for links until the Public URL setting is set (the first setup sets it)
TOTALBASE_HOST0.0.0.0the address the server listens on
TOTALBASE_PORT3050the port
TOTALBASE_STATEMENT_TIMEOUT_MS30000the timeout of every SQL statement on the pool
TOTALBASE_ADMIN_UI_ENABLEDtruefalse serves the APIs only, without the admin and the App
TOTALBASE_ADMIN_UI_DIRwhere the built admin is, if not in its usual place
LOG_LEVELinfo
NODE_ENVproduction 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.

Next steps