Repository navigation
Configuration
Philippe edited this page Nov 13, 2026
·
1 revision
The bot is configured with environment variables. With Python they go into the .env file (copy .env.example), with
Docker into -e options or the environment section of the compose file. Invalid values stop the bot at startup with a
message that names the variable.
| Variable | Description |
|---|---|
SERVER_URL |
URL of your Crafty Controller, e.g. https://192.168.1.10:8443
|
DISCORD_TOKEN |
Token of your Discord bot |
CRAFTY_TOKEN |
API token of the Crafty user |
CRAFTY_USERNAME / CRAFTY_PASSWORD
|
Crafty login, used instead of CRAFTY_TOKEN when no token is set. Doesn't work with two-factor authentication |
Either CRAFTY_TOKEN or CRAFTY_USERNAME and CRAFTY_PASSWORD must be set.
| Variable | Default | Description |
|---|---|---|
GUILD_ID |
– | ID of your Discord server. With it, slash commands are registered for that server and appear immediately; without it they are registered globally |
CRAFTY_VERIFY_SSL |
false |
true to verify the TLS certificate of Crafty. Crafty uses a self-signed certificate by default |
| Variable | Default | Description |
|---|---|---|
ENABLE_AUTO_STOP_SERVER |
false |
Default of the auto_stop feature flag, see Auto Stop
|
AUTO_STOP_SLEEP_TIME |
1800 |
Seconds between two auto stop checks |
| Variable | Default | Description |
|---|---|---|
WEB_ENABLED |
false |
true to serve the Web Dashboard
|
WEB_HOST |
127.0.0.1 (0.0.0.0 in Docker) |
Interface the dashboard listens on |
WEB_PORT |
8080 |
Port of the dashboard |
WEB_PASSWORD |
– | Password for the dashboard (HTTP basic auth, any user name). Required to change feature flags and the log level |
WEB_ALLOWED_HOSTS |
– | Comma-separated host names the dashboard may be opened with when no password is set, e.g. nas.local. IP addresses and localhost always work |
FLAGS_FILE |
data/feature_flags.json |
File the feature flags are saved to |
| Variable | Default | Description |
|---|---|---|
LOG_LEVEL |
INFO |
DEBUG, INFO, WARNING or ERROR. Applies to the bot itself; libraries such as discord.py never log below INFO
|
LOG_FILE |
– | Also write the log to this file, e.g. logs/bot.log. It is rotated at 5 MB and three old files are kept |
Relative paths in FLAGS_FILE and LOG_FILE are resolved against the project directory, not the directory the bot is
started from.
Setup
Usage
Help