Skip to content

Operations

GitNotify keeps its durable state in one SQLite database. The default container path is /data/gitnotify.db.

SQLite runs in WAL mode. Do not copy the database file while GitNotify is running. Use SQLite's online backup command or stop GitNotify first.

For a native install with sqlite3 available, make a consistent online backup:

Terminal window
sqlite3 /path/to/gitnotify.db ".backup '/path/to/gitnotify-backup.db'"
sqlite3 /path/to/gitnotify-backup.db "PRAGMA integrity_check"

The integrity check should print ok.

For Docker Compose, a stopped copy is straightforward:

Terminal window
mkdir -p backups
docker compose -f selfhosted/docker-compose.yml stop gitnotify
docker compose -f selfhosted/docker-compose.yml cp gitnotify:/data ./backups/data
docker compose -f selfhosted/docker-compose.yml start gitnotify

Copy the whole /data folder so any gitnotify.db-wal and gitnotify.db-shm files come with the database.

Keep a protected copy of GITNOTIFY_MASTER_KEY with the backup set. The key opens the sealed Discord webhook URLs, Slack bot tokens, and email relay secrets stored in SQLite. The database alone is not enough to recover them.

Also keep the provider credentials from your environment file in a secret manager. Do not put an unprotected .env file in a general backup archive.

The current Compose file builds the local gitnotify:local image from selfhosted/Dockerfile. Update the repository, rebuild with current base images, and recreate the service:

Terminal window
git pull --ff-only
docker compose -f selfhosted/docker-compose.yml build --pull gitnotify
docker compose -f selfhosted/docker-compose.yml up -d gitnotify
curl -fsS http://127.0.0.1:8000/health

If a later release changes the Compose service to a published image, replace the build command with:

Terminal window
docker compose -f selfhosted/docker-compose.yml pull gitnotify

GitNotify opens SQLite and runs every pending embedded migration before it starts listening. If database setup or a migration fails, the process exits instead of serving requests.

Back up the database and master key before an upgrade. Read the logs and check the public health URL after the container restarts.

The default log filter is info. Set RUST_LOG for more detail:

RUST_LOG=gitnotify=debug

Follow container logs with:

Terminal window
docker compose -f selfhosted/docker-compose.yml logs -f gitnotify

GitNotify logs identifiers and outcomes. It does not log webhook payload text or provider secrets.

Every admin route requires Authorization: Bearer <ADMIN_TOKEN>. Missing or wrong credentials return 401. Request bodies are JSON where shown. Admin routes are also reachable through the public URL, so keep ADMIN_TOKEN long and secret, and prefer the local port.

Method and route Body Use
POST /admin/discord/commands None Replace the global Discord command set
POST /admin/discord/health Optional {"guildId":"..."} Check one or all recorded Discord servers for removal
POST /admin/discord/digests/run {"guildId":"..."} Queue enabled digests for one Discord server now
POST /admin/discord/repair {"guildId":"..."} Queue repair for one Discord server
POST /admin/discord/webhooks {"url":"..."} Validate and store a Discord webhook URL
POST /admin/discord/routes guildId, channelId, kind, repoId, fullName, plus optional route settings Add a Discord route by hand after its webhook is stored
POST /admin/discord/people guildId, discordUserId, githubLogin, plus optional githubUserId Add a linked person by hand
DELETE /admin/discord/messages {"guildId":"...","channelId":"...","messageId":"..."} Delete one Discord card and its record
GET /admin/discord/guilds/{id} None Read a server's routes and linked people
GET /admin/discord/guilds/{id}/layouts None Read the recorded layout and current Discord access
POST /admin/slack/digests/run {"teamId":"..."} Queue enabled digests for one Slack workspace now
POST /admin/telegram/webhook None Register the Telegram webhook and nine commands
GET /admin/telegram/webhook None Read Telegram's webhook status
POST /admin/telegram/digests/run {"chatId":-1001234567890} Queue enabled digests for one Telegram group now

Unknown admin paths return 404. Admin request bodies are limited to 64 KiB.