Environment Variables
Set the applianceOne container that holds the bot, panel, worker, and database'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
.envor your shell — Theenvironmentblock incompose.ymlfills every setting below from here. apps/bot/.env— Compose loads this file into the container when it exists, but theenvironmentblock 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 workerBackground service that runs schedules and deliveries 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.
| Variable | Description |
|---|---|
PUID, PGID | The user and group IDs that run PostgreSQL, the bot, the web service, and the workerBackground service that runs schedules and deliveries, and that own the whole data volumeThe Docker volume where all your data lives, from 1 to 60000, and 1000 by default. |
TZ | The container's time zoneThe zone a schedule's times are read in; UTC by default, 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.
| Variable | Description |
|---|---|
POSTGRES_DB, POSTGRES_USER | The database and role names, stonker by default, starting with a lowercase letter and using only lowercase letters, digits, and underscores. |
BOT_CONTROL_POLL_INTERVAL_MS | How often the bot checks for lifecycle and settings changes, from 250 to 60000 milliseconds, and 1000 by default. |
WORKER_POLL_INTERVAL_MS | How long the workerBackground service that runs schedules and deliveries 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_LIMIT | How many times the workerBackground service that runs schedules and deliveries runs a durable jobQueued task kept in the database until it's done 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_CONNECTIONS | The 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_NAME | The 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:
| Variable | Resolved 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 settingsSample values to start a feature you haven't set up, 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.