A secure, web-based implementation of the classic Conquer strategy game using Docker containers, ttyd (terminal over HTTP), and Apache as a reverse proxy with SSL termination.
This setup allows multiple players to access the same Conquer game instance through their web browsers, with proper authentication, rate limiting, and security features for safe public deployment.
Important: Conquer requires pre-generated world data to run. See the World Generation section below for setup instructions.
For development work on your local machine:
# Setup environment
./setup-environment.sh
# Choose option 1: Local development
# Start local development environment
docker-compose up -d- URL: https://localhost
- Setup: Full Docker environment (Apache + Conquer containers)
- SSL: Self-signed certificate (accept browser warning)
For deployment on a VPS with existing Apache:
# Setup environment
./setup-environment.sh
# Choose option 2: VPS production
# Deploy to VPS (run as root)
sudo ./deploy-to-vps.sh- URL: https://your-configured-domain.com
- Setup: Host Apache + Conquer container
- SSL: Let's Encrypt certificate
Configure authentication during setup or by editing environment files:
Local Development (config/local.env):
TTYD_USERNAME=your_dev_username
TTYD_PASSWORD=your_dev_password
MAX_CLIENTS=10
SESSION_TIMEOUT=3600VPS Production (config/production.env):
TTYD_USERNAME=your_username
TTYD_PASSWORD=your_strong_password
MAX_CLIENTS=5
SESSION_TIMEOUT=1800๐ IMPORTANT: Change default credentials before first use!
- Edit environment file (see above) - Change
TTYD_USERNAMEandTTYD_PASSWORD - Restart containers:
- Local:
docker-compose restart - VPS:
sudo systemctl restart conquer-web
- Local:
- โ Use strong passwords - At least 12 characters with mixed case, numbers, symbols
- โ Unique usernames - Don't use common names like 'admin', 'user', 'conquer'
- โ Change defaults - Never use 'changeme' or default passwords in production
- โ Regular updates - Change credentials periodically
Conquer requires world data to run. Generate it before first use:
# Generate world data
./generate-world.sh
# Backup existing world (optional)
./backup-world.sh
# Restore world from backup (optional)
./restore-world.sh backup-YYYY-MM-DD-HHMMSS.tar.gzconquer-web/
โโโ conquer/ # Conquer game Docker container
โโโ apache/ # Apache Docker container (local only)
โโโ vps/ # VPS-specific configurations
โโโ config/ # Environment configurations
โโโ docker-compose.yml # Local development setup
โโโ docker-compose.local.yml # Local development (explicit)
โโโ docker-compose.vps.yml # VPS production setup
โโโ setup-environment.sh # Interactive setup script
โโโ deploy-to-vps.sh # VPS deployment script
โโโ generate-world.sh # World data generation
โโโ rebuild.sh # Rebuild containers (--force, --quick options)
โโโ logs.sh # View container logs
โโโ stop.sh # Stop running containers
โโโ setup-security.sh # Security hardening (fail2ban, rate limiting)
โโโ check-security.sh # Security status monitoring
โโโ backup-world.sh # Backup world data
โโโ restore-world.sh # Restore world from backup
โโโ reset-to-default-world.sh # Reset to default world
โโโ health-check.sh # Container health verification
# Start services
docker-compose up -d
# View logs
./logs.sh
# Rebuild containers (with cache)
./rebuild.sh
# Rebuild containers (force, no cache)
./rebuild.sh --force
# Quick restart (config changes only)
./rebuild.sh --quick
# Check status
docker-compose ps
# Stop services
./stop.sh# Check service status
sudo systemctl status conquer-web
# View logs
sudo journalctl -u conquer-web -f
# Restart service
sudo systemctl restart conquer-web
# Stop service
sudo systemctl stop conquer-web- Authentication: Username/password protection with brute force protection
- Rate Limiting: fail2ban and configurable concurrent user limits
- Session Management: Automatic session timeouts
- SSL/TLS: HTTPS encryption (Let's Encrypt for VPS)
- Container Isolation: Game runs in isolated Docker container
- Security Headers: HSTS, CSP, and comprehensive security headers
- Attack Protection: Bot blocking, request filtering, DoS protection
- Monitoring: Comprehensive logging and security alerts
After basic deployment, enhance security with:
# Run security hardening script
sudo ./setup-security.sh
# Check security status
./check-security.shSee SECURITY.md for detailed security configuration.
- Install Dependencies: Docker, Docker Compose
- Generate World:
./generate-world.sh - Setup Environment:
./setup-environment.sh(choose option 1) - Start Development:
docker-compose up -d - Access Game: https://localhost
- Prepare VPS: Debian/Ubuntu with Apache installed
- Clone Project:
git clone https://github.com/vejeta/conquer-web.git - Setup Environment:
./setup-environment.sh(choose option 2) - Deploy:
sudo ./deploy-to-vps.sh - Configure DNS: Point domain to VPS IP
- VPS Deployment Guide - Detailed VPS setup instructions
- Security Hardening Guide - Advanced security configuration
- World Management - World data generation and backup
- License Information - GPL v3+ licensing details
# Check container logs
docker logs conquer-local # Local
docker logs conquer-vps # VPS
# Rebuild containers
docker-compose build --no-cache# Check systemd service
sudo systemctl status conquer-web
# Check detailed logs
sudo journalctl -u conquer-web -n 50
# Test Apache configuration
sudo apache2ctl configtest# Check certificate status
sudo certbot certificates
# Renew certificate manually
sudo certbot renew --apacheThis project is licensed under the GPL v3 or later. See LICENSE.md for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Test locally
- Submit a pull request
- Conquer Game: Original strategy game implementation
- ttyd: Terminal over HTTP technology
- Docker: Containerization platform
- Let's Encrypt: Free SSL certificates