- A minimal Flask-based puzzle server exposing simple levels and a validation endpoint.
- An interactive CLI agent that lists levels, fetches descriptions, accepts attempts, and asks Ollama for hints.
- A lightweight Flask web UI with puzzle browsing, filtering, progress tracking, and puzzle detail pages.
- Versioned API routes under
/api/v1/...for puzzle discovery, progress, achievements, and future clients.
- Python 3.10+
- Docker installed and running (required for script-based puzzles)
- Ollama installed and running locally
- Model llama3.2 pulled, or another local model selected through
LUX_OLLAMA_MODEL/LUX_OLLAMA_MODELS
It is recommended to use a virtual environment:
python3 -m venv venv
source venv/bin/activate-
Install dependencies:
python3 -m pip install -r requirements.txt
-
Start Ollama service:
ollama serve ollama pull llama3.2 ollama list
-
Start the server:
python3 server.py
-
In another terminal, run the agent:
python3 agent.py
Server is hosted at http://127.0.0.1:5050.
-
Open the web UI in a browser:
http://127.0.0.1:5050/web
Optional API endpoints:
/api/v1/levels/api/v1/level/<id>/api/v1/progress/api/v1/achievements
The interactive CLI agent stores user progress locally in a JSON state file. By default the state file is located at ~/.lux/state.json.
Environment variable LUX_STATE can override the path to the state file. Example:
export LUX_STATE=/tmp/lux-state.json
python3 agent.pyWhen you solve a level using the CLI the agent will persist solved history and unlocked achievements to the state file. You can inspect it with:
cat ~/.lux/state.jsonSample run (quick):
- Start the server:
python3 server.py - Run the agent:
python3 agent.py - Choose a level id and attempt it. When marked correct, the CLI prints a confirmation and any newly unlocked achievements.
- Restart the agent and note that solved levels and achievements are listed in the
Available levelsoutput.
If your CI badge for a branch shows failing, ensure you push the branch and open the PR so GitHub Actions can run; local tests can be run with:
PYTHONPATH=. pytest -q- Some levels validate by string comparison.
- Script-based levels run inside a Docker container with network disabled, dropped capabilities, and limited CPU/memory.
- Docker must be installed, the daemon must be running, and the user running the server must be allowed to run
docker. - For production, use stronger sandboxing, authentication, and persistent progress storage.
- The server exposes
/levels,/level/<id>, and/submit. - The server also exposes
/api/v1/levels,/api/v1/level/<id>,/api/v1/progress,/api/v1/achievements,/web,/dashboard, and/puzzles/<id>. - For script-based levels,
POST /submitaccepts JSON{ "level_id": "5", "files": { "answer.c": "<source>" } }and returns test output. - The agent uses Ollama (
llama3.2) to produce contextual hints; it instructs the model not to reveal flags. - Hint models can be configured with
LUX_OLLAMA_MODELfor a preferred local model andLUX_OLLAMA_MODELSfor a comma-separated fallback list.
- Linux: command-line navigation, process management, networking, package management, shell scripting, permissions, logs, system administration, and Bash levels
- Programming: C pointers, memory management, data structures, algorithms, Python comprehensions, Java entry points, and JavaScript equality
- Cybersecurity: web security, reverse engineering, digital forensics, cryptography, secure coding, and beginner CTF-style levels
- DevOps: Docker, Git, CI/CD, and cloud fundamentals
- Every puzzle includes
category,difficulty, andtagsmetadata for filtering in the agent and future UI work
- Add more levels with staged tasks and progressive hints.
- Implement an interactive web UI.
- Add secure sandbox execution for C compilation and run (via Firecracker, gVisor, or chrooted containers).