CTFd First Blood Announcer
A dystopian-themed first blood announcer for CTFd with automatic sound playback and fullscreen announcements. First Strike Alert features a cyberpunk "Synthetic Sentience Corporation" theme with real-time monitoring and dramatic audio-visual notifications.
- π Automatic Audio Announcements: Plays dramatic transmission sounds when first bloods are detected
- πΊ Fullscreen Notifications: Eye-catching announcements with team and challenge information
- π¨ Dystopian Cyberpunk Theme: Custom UI with glitch effects, neon colors, and AI regime aesthetics
- π Real-time Leaderboard: Live tracking of all first blood achievements
- π Team Statistics: Analysis showing which teams dominate different challenge categories
- β‘ Live Updates: Polls CTFd API every 5 seconds for instant notifications
- π Robust Error Handling: Graceful fallbacks and retry mechanisms
- π± Responsive Design: Works on displays of all sizes
The main resistance tracker showing all first blood achievements
Dramatic fullscreen announcement when a first blood is detected
Detailed breakdown of first blood achievements by team
Server console showing real-time monitoring
Detailed logging of first blood detections
- Node.js (v14 or higher)
- Access to a CTFd instance
- CTFd API token with appropriate permissions
-
Clone the repository
git clone https://github.com/0x4m4/first-strike-alert.git cd first-strike-alert -
Install dependencies
npm install
-
Configure environment variables
cp .env.example .env # Edit .env with your CTFd details -
Start the server
npm start
-
Access the announcer Open
http://localhost:3000in your browser
Create a .env file in the root directory:
# CTFd Configuration
CTFD_URL=https://your-ctfd-instance.com
CTFD_TOKEN=your-api-token-here
# Server Configuration
PORT=3000
# Debug Configuration (optional)
DEBUG_MODE=false- Log in to your CTFd admin account
- Navigate to Settings β Access Tokens
- Click Create Token
- Give it a descriptive name (e.g., "First Blood Announcer")
- Ensure it has permissions to read:
- Teams/Users
- Challenges
- Submissions
- Copy the generated token to your
.envfile
The announcer includes two sound files:
static/sounds/transmission.mp3- Main announcement sound (15 seconds)static/sounds/blood.mp3- Alternative sound option
To use your own sounds:
- Replace the audio files in
static/sounds/ - Ensure files are in MP3 format
- Update the duration in
static/js/script.jsif needed:const ANNOUNCEMENT_DURATION = 15000; // Duration in milliseconds
Edit CSS variables in static/css/styles.css:
:root {
--primary-color: #ff1a1a; /* Main red color */
--secondary-color: #1a1a1a; /* Dark background */
--accent-color: #ff0033; /* Bright accent */
--bg-color: #0a0a0a; /* Page background */
--text-color: #e0e0e0; /* Text color */
}The theme uses:
- Orbitron - Headers and titles
- Share Tech Mono - Body text and data
- LuckyRookie - Special cyberpunk elements
Replace static/img/circuit-pattern.svg with your own background pattern.
For optimal presentation:
- Dedicated Display: Use a separate monitor/TV for the announcer
- Full Screen: Press F11 for fullscreen mode
- Audio Setup: Ensure speakers are connected and volume is appropriate
- Browser: Use Chrome, Firefox, or Edge for best compatibility
- Auto-refresh: The page auto-refreshes every 15 seconds as a fallback
The server provides several endpoints:
GET /- Main announcer interfaceGET /api/firstbloods- JSON API for first blood dataGET /api/scoreboard- Team scoreboard dataGET /static/*- Static assets (CSS, JS, images, sounds)
- No sound playing: Click anywhere on the page to enable audio autoplay
- Sound cuts off: Check browser autoplay policies
- Wrong volume: Adjust system volume or browser tab volume
- No data loading: Verify CTFd URL and API token
- 403/401 errors: Check API token permissions
- Timeout errors: Ensure CTFd instance is accessible
- Layout broken: Try refreshing the page or clearing browser cache
- Animations stuttering: Close other browser tabs to free up resources
Server Debug Logging: Set DEBUG_MODE=true in your .env file to enable detailed server-side logging.
Browser Debug Logging: Open browser console (F12) to see detailed information about:
- API requests and responses
- First blood detection logic
- Audio playback status
- Error messages
- Express.js server with Socket.IO support
- CTFd API integration with robust error handling
- Caching system for teams and challenges
- Real-time first blood detection algorithm
- Responsive web interface
- Real-time updates via polling
- Audio management with Web Audio API
- Announcement queue system
- Cyberpunk/dystopian theme
- CSS animations and effects
- Responsive design
- Custom fonts and graphics
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
# Install dependencies
npm install
# Run in development mode with auto-restart
npm run dev
# The server will restart automatically when you make changesThis project is licensed under the MIT License - see the LICENSE file for details.
- Created by: 0x4m4
- Theme: Synthetic Sentience Corporation (SSC) AI Regime
- Fonts: Orbitron, Share Tech Mono, LuckyRookie
- Sound Effects: Custom transmission audio
- Graphics: Custom cyberpunk circuit patterns and AI logos
- CTFd - The CTF platform this announcer integrates with
- CTFd Themes - Official CTFd theme collection