Cloudflare Lava Lamps-inspired RNG: use your RTSPS camera feed to generate random numbers using:
- lava lamps 🌋
- plasma lamps ⚡
- fountains 🚰
- your ant colony 🐜
- Modern Web Interface: Beautiful, responsive design with real-time validation
- Camera-Based Entropy: Uses RTSP camera snapshots as randomness source
- Customizable Generation:
- String length (1-256 characters)
- Character types (uppercase, lowercase, numbers, special characters)
- Batch generation (1-100 strings)
- Containerized: Full Docker support with docker-compose
- Security: Snapshots are deleted after use, preventing entropy reuse
-
Create docker-compose.yml:
version: '3.8' services: web: image: morveus/random-web:latest ports: - "${APP_PORT:-5000}:5000" volumes: - randomness_data:/randomness-source env_file: - .env depends_on: - capture restart: unless-stopped networks: - random_network capture: image: morveus/random-capture:latest volumes: - randomness_data:/randomness-source env_file: - .env restart: unless-stopped networks: - random_network volumes: randomness_data: driver: local networks: random_network: driver: bridge
-
Configure environment: Create
.envfile with your RTSP camera URL:RTSP_URL=rtsp://admin:password@your-camera-ip:554/stream -
Deploy:
docker-compose up -d
-
Clone and setup:
git clone <repository-url> cd random cp .env.example .env
-
Configure environment: Edit
.envfile with your RTSP camera URL:RTSP_URL=rtsp://admin:password@your-camera-ip:554/stream -
Deploy with Docker:
docker-compose up -d
-
Access the application: Open http://localhost:5000 in your browser
All configuration is done via the .env file:
| Variable | Description | Default |
|---|---|---|
RTSP_URL |
Camera stream URL | Required |
SNAPSHOT_INTERVAL |
Seconds between captures | 5 |
MAX_SNAPSHOTS |
Maximum stored snapshots | 100 |
APP_PORT |
Web application port | 5000 |
SPECIAL_CHARS |
Allowed special characters | `!@#$%^&*()_+-=[]{} |
MAX_STRING_LENGTH |
Maximum string length | 256 |
MAX_STRINGS_PER_REQUEST |
Batch size limit | 100 |
- Web Service: Flask application serving the UI and API
- Capture Service: Background service capturing RTSP snapshots
- Shared Volume:
/randomness-sourcefor snapshot storage - Network: Isolated Docker network for services
- Snapshots are automatically deleted after use
- No snapshot data is exposed via the web interface
- Input validation prevents malicious requests
- Containerized deployment isolates the application
Run locally without Docker:
# Install dependencies
pip install -r requirements.txt
# Create snapshots directory
mkdir randomness-source
# Start capture service (in background)
python capture_snapshots.py &
# Start web application
python app.pyThe application is designed for deployment in secure environments where:
- Camera Access: RTSP stream is accessible from the deployment environment
- Volume Storage: Persistent storage for the
/randomness-sourcevolume - Network Security: Proper firewall rules for the application port
- Monitoring: Health checks via
/healthendpoint
For production, consider:
- Using a reverse proxy (nginx) for SSL termination
- Implementing rate limiting
- Adding monitoring and logging
- Setting up automated backups
- Configuring log rotation
The images are available on Docker Hub:
morveus/random-web:latest- Web applicationmorveus/random-capture:latest- Snapshot capture service
Pull the latest images:
docker pull morveus/random-web:latest
docker pull morveus/random-capture:latestGET /- Main web interfacePOST /generate- Generate random strings (customizable parameters)POST /generate-passphrase- Generate passphrases (customizable parameters)GET /health- System health check
Generates a single 32-character random string using uppercase letters, lowercase letters, and numbers.
Response:
{
"string": "Kj9mP3qR7sT1vW5xY8zA2bC4dE6fG0hI"
}Example:
curl https://yourserver/api/stringGenerates a 3-word passphrase with capitalized words, separated by dashes, and includes one random digit.
Response:
{
"passphrase": "Tree2-Ocean-Valley"
}Example:
curl https://yourserver/api/passphraseAll endpoints return error responses in this format:
{
"error": "Error description"
}- All API endpoints use the same camera-based entropy source
- Each request consumes one camera snapshot
- API endpoints have fixed parameters for simplicity
- Use the web interface for customizable generation
- No snapshots available: Check RTSP URL and camera connectivity
- Application not accessible: Verify port configuration and firewall
- Poor performance: Adjust
SNAPSHOT_INTERVALandMAX_SNAPSHOTS