A mysterious web server for Scene 65: The Forbidden Sector.
- Auto-reload (uvicorn) for development
- FastAPI server
- Redis-backed sessions with in-memory fallback
- Docker Compose stack for app + Redis
- Interactive client-side challenges and auth
- Static + dynamic content serving (HTML/CSS/JS)
The complete stack includes Redis for session management:
docker compose up --build -dThis starts:
- Redis server for session storage
- FastAPI application server
- Automatic volume mounting for development
- Start Redis server (optional - will fallback to in-memory if not available):
# Using Docker
docker run -d -p 6379:6379 redis:7.2-alpine
# Or install Redis locally and run: redis-server- Install dependencies:
pip install -r requirements.txt- Run the server:
python server.pydocker build -t forbidden-sector .
docker run -p 9082:9082 forbidden-sectorrThe server will start on http://localhost:9082
- Persistent storage: Sessions survive application restarts
- Memory efficient: No memory leaks from session accumulation
- Automatic expiration: 24-hour TTL prevents stale sessions
- Scalable: Multiple application instances can share session data
- Automatic fallback: Used when Redis is unavailable
- Development mode: Suitable for local testing
- Warning logged: Clear indication when fallback is active
GET /- Main index pageGET /info.html- (redirects to/by design)GET /content/help- Challenge HTML (loaded dynamically)POST /create_session- returns{ "session_id": "..." }POST /check_answer- submit answersPOST /authenticate- JSON username/password authGET /style.css,GET /script.js- static assets
Type help (keyboard sequence) on the landing page to load the interactive challenge UI. Direct GET /info.html is redirected to / intentionally.
Want the username and password? It's here somewhere... hmm...
The server includes auto-reload functionality that watches for changes in:
- Python files (server.py)
- HTML files (index.html, info.html)
- CSS files (style.css)
- JavaScript files (script.js)
REDIS_HOST: Redis server hostname (default: "redis")REDIS_PORT: Redis server port (default: "6379")
The Docker setup includes:
- Base: Python 3.12 slim
- FastAPI and uvicorn with auto-reload
- Redis client for session management
- Port 9082 exposed
- Volume mounting for development
- Base: Redis 7.2 Alpine
- Persistent volume for data storage
- Optimized configuration with AOF persistence