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.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openctf_server-1.3.2.tar.gz | 220.3 kB | Without provenance | Details for openctf_server-1.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openctf_server-1.3.2-py3-none-any.whl | Python 3 | none | any | Details for openctf_server-1.3.2-py3-none-any.whl |
Total release size: 471.6 kB
Release files / openctf_server-1.3.2.tar.gz
| Download URL | openctf_server-1.3.2.tar.gz |
|---|---|
| Size | 220.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc78044be0afdcfb9011724d4229986b4d910093a63b820d462cc31ad50cdcaa
|
|
BLAKE2b-256 checksum How to use checksums |
7e877cb521b708d52a37c592061ed6d76b4d8226b1d164b871042d2152a75d4c
|
| 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.3.2-py3-none-any.whl
| Download URL | openctf_server-1.3.2-py3-none-any.whl |
|---|---|
| Size | 251.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc2549140ad43310e52884372513b08ed8745e94cfe356bc040b649ba1edf77f
|
|
BLAKE2b-256 checksum How to use checksums |
333859332bbc5d6ea1463b40e14d8ebd5ffbd4eeccfddf378267cb681dfcacc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Security for openctf-server 1.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.