Skip to main content

openctf-server

Flask API and sandboxed target-website service for OpenCTF, a self-hosted lab CTF platform. This package is the server half only - the desktop client is published separately on npm as openctf.

Install

pip install openctf-server

Quick start

export SECRET_KEY=$(python -c "import secrets; print(secrets.token_hex(32))")
export JWT_SECRET_KEY=$(python -c "import secrets; print(secrets.token_hex(32))")
export FLAG_PEPPER=$(python -c "import secrets; print(secrets.token_hex(32))")
export TARGET_ACCESS_SECRET=$(python -c "import secrets; print(secrets.token_hex(32))")
export ADMIN_PASSWORD=set-a-real-password

openctf-server           # main API on :5000
openctf-server-target     # sandboxed target-website service on :5001 (separate terminal)
openctf-server-seed       # load the starter set of preset challenges (one-off)

Both processes need the same SECRET_KEY, TARGET_ACCESS_SECRET, and DATABASE_URL (if you set one) to talk to each other correctly - they share one database and one signed-URL secret between the two services.

Configuration

All configuration is via environment variables - there's no config file. See the main repository's server/.env.example for the full list (DATABASE_URL, CORS_ORIGINS, TARGET_SERVER_URL, OLLAMA_URL, OLLAMA_MODEL, and the secrets above).

Docker

If you'd rather not manage two processes and env vars by hand, the main repository ships a docker-compose.yml that runs both services correctly out of the box - see the repository README for that path.

Security

Read SECURITY.md in the main repository before exposing this to more than your own laptop - in particular, the target-website service is intentionally vulnerable (that's the point, it hosts the challenges) and should never be reachable from outside your lab's own network.

Metadata

Release files for openctf-server 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openctf-server 1.0.0
File Size Uploaded
openctf_server-1.0.0.tar.gz 31.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openctf-server 1.0.0
File Interpreter ABI Platform
openctf_server-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 63.8 kB

Release files / openctf_server-1.0.0.tar.gz

Download URL openctf_server-1.0.0.tar.gz
Size 31.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cf5f4f9e41ff0539a3f311151490861d5074e8bd8e6649d2fd0f87460ff64ee7
BLAKE2b-256 checksum
How to use checksums
aa113a042f7d6bad950496ac7e75048ab4a5fb579e61c56c58907dabf8a6b914
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release files / openctf_server-1.0.0-py3-none-any.whl

Download URL openctf_server-1.0.0-py3-none-any.whl
Size 32.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79bb674b4429527e304d8f836c870d65f1d2fb5acc2db9b39e7fbbb1865b48a0
BLAKE2b-256 checksum
How to use checksums
ad0ef742ab81235c115d9c04d6f28b61e6a8c16cd228aeefd1be0db74f818836
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release history Release notifications | RSS feed

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page