Skip to content

Configuration ​

PICKET is configured through environment variables. A value that is a secret can instead be provided as a file by suffixing the name with _FILE (Docker secrets); giving both is an error.

Application ​

VariableDefaultMeaning
DISCORD_APPLICATION_IDrequiredApplication identifier.
DISCORD_PUBLIC_KEYrequired64 hexadecimal characters; verifies the signature of incoming interactions.
DISCORD_BOT_TOKEN / _FILErequiredBot token. Never logged.
DATABASE_URL / _FILErequiredPostgreSQL connection string of the application role (no ownership, subject to row security).
DATABASE_POOL_MAX10Maximum connections per replica (1 to 100).
ROLEShttp-ingressComma-separated roles of this process: http-ingress (receives interactions) and shard-runner (Gateway connection).
SHARD_COUNT1Total number of Gateway shards (1 to 256). One shard is enough up to roughly 2,500 servers.
GUILD_RETENTION_DAYS30Days between a server becoming inactive and the erasure of its data (1 to 365).
LOG_LEVELinfofatal, error, warn, info, debug or trace.
NODE_ENVproductiondevelopment, test or production.

Network and shutdown ​

VariableDefaultMeaning
HTTP_PORT8080Port of the interactions endpoint.
HEALTH_PORT8081Port of /healthz and /readyz. Keep it internal.
SHUTDOWN_DRAIN_MS10000Time spent reporting "not ready" before stopping, so the reverse proxy can remove the replica (0 to 120000).

Migrations ​

Used by the migrate task only, with the database owner role:

VariableDefaultMeaning
DATABASE_MIGRATOR_URL / _FILErequiredConnection string of the owner role.
DATABASE_APP_ROLEpicket_appRole that receives the privileges on the tables.

Command line ​

sh
node apps/bot/dist/cli.js migrate               # apply database migrations
node apps/bot/dist/cli.js deploy-commands       # register slash commands (--force to redeploy)
node apps/bot/dist/cli.js purge                 # erase servers past the retention period and interaction records older than 7 days