A Discord bot for CTFd first blood announcements and top 10 teams.
- Announces first bloods in a specified channel
- Command to list top 10 teams
- Copy
.env.exampleto.envand fill in your config - Install dependencies with
uv pip install . - Run the bot:
python -m onectfdannouncer.bot
- Copy
.env.exampleto.envand configure - Build and run:
docker compose -f docker-compose.dev.yml up --build - Database will be stored in
./data/state.db(accessible from host)
- Copy
.env.exampleto.envand configure - Build and run:
docker compose up --build - Database will be stored in a Docker volume
bot_data
- Copy
.env.exampleto.envand configure - Run with published image:
docker compose -f docker-compose.prod.yml up - Database will be stored in a Docker volume
bot_data
The bot is automatically built and published to GitHub Container Registry:
# Pull the latest image
docker pull ghcr.io/[your-username]/onectfdannouncer:latest
# Run with environment file
docker run --env-file .env ghcr.io/[your-username]/onectfdannouncer:latest
# Or run with environment variables
docker run -e DISCORD_TOKEN=your_token \
-e CTFD_URL=https://your.ctfd.com \
-e CTFD_API_KEY=your_api_key \
-e ANNOUNCE_CHANNEL_ID=your_channel_id \
ghcr.io/[your-username]/onectfdannouncer:latestlatest- Latest stable release from main branchv1.0.0- Specific version tagsmain- Latest commit from main branchdevelop- Latest commit from develop branch
Images are built for multiple architectures:
linux/amd64(x86_64)linux/arm64(ARM64/AArch64)
The bot uses SQLite to track announced first bloods. Data persistence is handled differently depending on your setup:
- Data is stored in a Docker volume named
bot_data - Persists across container restarts and updates
- Managed by Docker
# View volume information
docker volume inspect onectfdannouncer_bot_data
# Backup the database
docker run --rm -v onectfdannouncer_bot_data:/data -v $(pwd):/backup alpine cp /data/state.db /backup/
# Restore the database
docker run --rm -v onectfdannouncer_bot_data:/data -v $(pwd):/backup alpine cp /backup/state.db /data/- Data is stored in
./data/state.dbon the host - Directly accessible and editable from the host system
- Easy to backup and restore
The bot uses structured logging with timestamps and log levels. Set LOG_LEVEL environment variable to control verbosity:
DEBUG- Detailed debug informationINFO- General information (default)WARNING- Warning messages onlyERROR- Error messages only