Skip to main content

Environment Variables

Set the appliance's environment variables in the right file, with each variable's default value and allowed range.

Where Variables Are Read

With docker run, pass each variable as an -e option. Docker Compose passes variables to the container from two places, and each variable works from only one of them.

  • The root .env or your shell — The environment block in compose.yml fills every setting below from here.
  • apps/bot/.env — Compose loads this file into the container when it exists, but the environment block has priority over it, and no setting needs it.

The startup scripts and the database migration check every setting before the bot, the web service, and the worker start. An invalid value stops the container, and docker logs discord-stonker-bot or docker compose logs app names the rejected value in a plain log line.

A Basic or Optional variable set to an empty value, such as JOB_ATTEMPT_LIMIT="", counts as unset and uses its default.

The control panel always listens on every address on port 22604, and no variable changes either. The supplied run line and Compose file use host networking, so the port is always 22604. To keep it local-only or select another host port, switch to bridge networking and publish the fixed container port, such as --net=bridge -p 127.0.0.1:8080:22604.

Basic

No variable is required. Most installs set only these three.

VariableDescription
PUID, PGIDThe user and group IDs that run PostgreSQL, the bot, the web service, and the worker, and that own the whole data volume, from 1 to 60000, and 1000 by default.
TZThe container's time zone, an installed IANA name, UTC by default. It doesn't change any schedule.

Optional

With Compose, set these in the root .env, next to compose.yml.

VariableDescription
POSTGRES_DB, POSTGRES_USERThe database and role names, stonker by default, starting with a lowercase letter and using only lowercase letters, digits, and underscores.
BOT_CONTROL_POLL_INTERVAL_MSHow often the bot checks for lifecycle and settings changes, from 250 to 60000 milliseconds, and 1000 by default.
WORKER_POLL_INTERVAL_MSHow long the worker waits when no job is queued, from 100 to 60000 milliseconds, and 1000 by default. Scheduled posts, permission toggles, and RSS checks can start up to this long late.
JOB_ATTEMPT_LIMITHow many times the worker runs a durable job before marking it failed, 30 seconds apart, from 1 to 20, and 5 by default. The last failure can send a Job gave up alert.
DATABASE_MAX_CONNECTIONSThe database connections each service may open, from 1 to 30, and 10 by default. The bot, web, and worker each own a pool, so the maximum leaves room under PostgreSQL's connection limit.
IMAGE_NAMEThe image name Compose builds and runs, discord-stonker-bot:local by default.

Set by the Appliance

Nova resolves the state root on every start and writes these variables to /run/nova-docker/environment for every service:

VariableResolved value for a current install
NOVA_STATE_DIRECTORY/config
NOVA_KEYS_DIRECTORY/config/keys
NOVA_INSTALLATION_KEY_FILE/config/keys/installation.key
NOVA_DATABASE_DIRECTORY/config/database
DATA_DIRECTORY/config

An old run line that still mounts only /data gets the same relative paths under /data until its mount is updated. These variables describe resolved appliance state and are not user settings.

The image also fixes MIGRATIONS_DIRECTORY, STARTER_CONFIGURATION for the example settings, and POSTGRES_RUNTIME_DIRECTORY for PostgreSQL's Unix socket at /tmp/postgresql.

Unused Variables

NODE_ENV, LOG_LEVEL, and LOG_TIME are listed in the samples for the repository's Nova tooling, but the bot's services don't read them.

POSTGRES_PASSWORD and POSTGRES_PORT are no longer used. PostgreSQL listens only on a Unix socket inside the container and accepts local connections without a password, so neither value has a purpose. A container that still sets them starts normally and logs one line for each, saying it was ignored, and you can remove them.