Skip to content

Configuration

GitNotify reads its configuration from environment variables. It also loads a .env file from its working directory. Empty optional credentials and settings count as unset. Do not set DATABASE_URL or BIND to an empty value.

For Docker Compose, put the values in selfhosted/.env. For a native binary, put .env in the directory from which you start gitnotify or provide the variables through your service manager.

Variable Required Default What it controls
DATABASE_URL No sqlite:///data/gitnotify.db SQLite connection URL. The database and migrations are created on start.
BIND No 0.0.0.0:8000 Listen address. An invalid socket address stops startup.
PUBLIC_URL Yes for a complete install None Public origin such as https://gitnotify.example.com, without a trailing slash. Slack install returns 503 without it. Telegram webhook registration returns 503 without it. GitHub sign-in links also need it.
GITNOTIFY_MASTER_KEY Yes None Encrypts Discord webhook URLs, Slack bot tokens, and Discord, Slack, and Telegram email relay secrets in SQLite. Slack OAuth returns 503 without it. Other secret storage operations fail rather than storing plaintext.
ADMIN_TOKEN Yes for setup and operations None Bearer token for every /admin/* route. Missing or wrong credentials return 401.
RUST_LOG No info Tracing filter, for example gitnotify=debug. An invalid filter falls back to info.
Variable Required Default What it controls
GITHUB_WEBHOOK_SECRET Yes None Verifies POST /github. The route returns 503 when it is unset.
GITHUB_APP_CLIENT_ID Yes None Starts GitHub user authorization for repository connection and account linking. Connect pages return 503 when it is unset.
GITHUB_APP_CLIENT_SECRET Yes None Exchanges the GitHub OAuth code and revokes the short-lived user token after use. An OAuth callback cannot complete without it.
GITHUB_APP_SLUG Yes None Builds the link that lets a user install the GitHub App on another account or repository. It is the slug from the app's public URL, not the numeric app ID.
Variable Required Default What it controls
DISCORD_BOT_TOKEN Yes for Discord None Discord REST calls, DMs, setup, repair, and global command registration.
DISCORD_APPLICATION_ID Yes for Discord None Global command registration, the install link, and the bot's channel permission overwrites.
DISCORD_PUBLIC_KEY Yes for Discord None Verifies Interactions and Event Webhooks. POST /discord/interactions and POST /discord/events return 503 without it.
DISCORD_INTERACTIVE No Off Set exactly 1 to add incident ownership buttons to cards and DMs. Any other value leaves them off.
Variable Required Default What it controls
SLACK_CLIENT_ID Yes for Slack None Starts the Slack install flow. GET /slack/install returns 503 without it.
SLACK_CLIENT_SECRET Yes for Slack None Exchanges the OAuth code. GET /slack/oauth returns 503 without it.
SLACK_SIGNING_SECRET Yes for Slack None Verifies slash commands, interactions, and Events API requests. All three request routes return 503 without it.

PUBLIC_URL is also required by both Slack install routes. GITNOTIFY_MASTER_KEY is required by the OAuth callback because the returned bot token is encrypted before storage.

Variable Required Default What it controls
TELEGRAM_BOT_TOKEN Yes for Telegram None Every Telegram Bot API call.
TELEGRAM_WEBHOOK_SECRET Yes for Telegram None The secret_token registered with Telegram and verified on each update. Use only letters, digits, _, and -, with at most 256 characters.
TELEGRAM_BOT_USERNAME Yes for Telegram None Bot username without @. It filters commands addressed to another bot and builds private-chat buttons.

All three values are needed before the Telegram integration is created. If any is missing, POST /telegram/webhook returns 503 and the Telegram admin routes return 401. PUBLIC_URL is also required when POST /admin/telegram/webhook registers the public endpoint.

Variable Required Default What it controls
SMTP_HOST No None SMTP host. Built-in email turns on only when this and EMAIL_FROM are both set.
SMTP_PORT No 587 SMTP port. An unset or invalid value uses 587.
SMTP_USERNAME No None SMTP login. No authentication is added when it is unset.
SMTP_PASSWORD No Empty SMTP password. It is used only when SMTP_USERNAME is set.
SMTP_USE_TLS No On Uses STARTTLS unless the value is exactly false or 0.
EMAIL_FROM No None Sender mailbox. Built-in email turns on only when this and SMTP_HOST are both set.
EMAIL_RECIPIENTS No None JSON object that maps GitHub logins to email addresses. Login matching is case-insensitive. A missing, invalid, or unmatched entry means there is no built-in recipient for that person.

SMTP configuration does not add an HTTP 503 response. It controls whether email digest commands offer the built-in sender or each space's own relay.

The key format is a version followed by 32 random bytes in standard base64:

v1:<base64 32 bytes>

Generate one with OpenSSL:

Terminal window
openssl rand -base64 32 | sed 's/^/v1:/'

Store the full output as GITNOTIFY_MASTER_KEY. A key rotation may contain comma-separated versions, such as v1:...,v2:.... GitNotify writes with the highest version and can still open rows written by an older version.

Back up this key separately from the host. Losing it makes the sealed webhook URLs, Slack bot tokens, and relay secrets in the database unreadable. They must then be recreated through their normal setup flows.

Use a long random value, for example openssl rand -hex 32, and store it as ADMIN_TOKEN.

EMAIL_RECIPIENTS is one JSON object on one line:

EMAIL_RECIPIENTS={"octocat":"octocat@example.com","hubot":"hubot@example.com"}

For a native binary that reads .env itself, wrap the value in single quotes: EMAIL_RECIPIENTS='{"octocat":"octocat@example.com"}'. Docker Compose reads the unquoted form shown above.

See Email for the difference between built-in SMTP and per-space relays.