openctf-server 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openctf_server-1.0.0/PACKAGE_README.md +36 -0
- openctf_server-1.0.0/PKG-INFO +61 -0
- openctf_server-1.0.0/__init__.py +12 -0
- openctf_server-1.0.0/app.py +1366 -0
- openctf_server-1.0.0/cli.py +44 -0
- openctf_server-1.0.0/openctf_server.egg-info/PKG-INFO +61 -0
- openctf_server-1.0.0/openctf_server.egg-info/SOURCES.txt +19 -0
- openctf_server-1.0.0/openctf_server.egg-info/dependency_links.txt +1 -0
- openctf_server-1.0.0/openctf_server.egg-info/entry_points.txt +4 -0
- openctf_server-1.0.0/openctf_server.egg-info/requires.txt +6 -0
- openctf_server-1.0.0/openctf_server.egg-info/top_level.txt +1 -0
- openctf_server-1.0.0/pyproject.toml +50 -0
- openctf_server-1.0.0/seed_challenges.py +485 -0
- openctf_server-1.0.0/setup.cfg +4 -0
- openctf_server-1.0.0/target_app.py +378 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# openctf-server
|
|
2
|
+
|
|
3
|
+
Flask API and sandboxed target-website service for [OpenCTF](https://github.com/XHIiddenProjects/OpenCTF), a self-hosted lab CTF platform. This package is the server half only - the desktop client is published separately on npm as `openctf`.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
```bash
|
|
7
|
+
pip install openctf-server
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Quick start
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
export SECRET_KEY=$(python -c "import secrets; print(secrets.token_hex(32))")
|
|
14
|
+
export JWT_SECRET_KEY=$(python -c "import secrets; print(secrets.token_hex(32))")
|
|
15
|
+
export FLAG_PEPPER=$(python -c "import secrets; print(secrets.token_hex(32))")
|
|
16
|
+
export TARGET_ACCESS_SECRET=$(python -c "import secrets; print(secrets.token_hex(32))")
|
|
17
|
+
export ADMIN_PASSWORD=set-a-real-password
|
|
18
|
+
|
|
19
|
+
openctf-server # main API on :5000
|
|
20
|
+
openctf-server-target # sandboxed target-website service on :5001 (separate terminal)
|
|
21
|
+
openctf-server-seed # load the starter set of preset challenges (one-off)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
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.
|
|
25
|
+
|
|
26
|
+
## Configuration
|
|
27
|
+
|
|
28
|
+
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).
|
|
29
|
+
|
|
30
|
+
## Docker
|
|
31
|
+
|
|
32
|
+
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](https://github.com/XHIiddenProjects/OpenCTF#installation) for that path.
|
|
33
|
+
|
|
34
|
+
## Security
|
|
35
|
+
|
|
36
|
+
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.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: openctf-server
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Flask API and sandboxed target-website service for the OpenCTF lab CTF platform
|
|
5
|
+
Author: OpenCTF
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/XHiddenProjects/OpenCTF
|
|
8
|
+
Project-URL: Repository, https://github.com/XHiddenProjects/OpenCTF
|
|
9
|
+
Project-URL: Security Policy, https://github.com/XHiddenProjects/OpenCTF/blob/main/SECURITY.md
|
|
10
|
+
Keywords: ctf,capture-the-flag,security,lab,flask
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Framework :: Flask
|
|
13
|
+
Classifier: Topic :: Security
|
|
14
|
+
Classifier: Topic :: Education
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
Requires-Dist: Flask>=3.0.3
|
|
20
|
+
Requires-Dist: Flask-SQLAlchemy>=3.1.1
|
|
21
|
+
Requires-Dist: Flask-Cors>=4.0.1
|
|
22
|
+
Requires-Dist: Flask-JWT-Extended>=4.6.0
|
|
23
|
+
Requires-Dist: Werkzeug>=3.0.3
|
|
24
|
+
Requires-Dist: gunicorn>=22.0.0
|
|
25
|
+
|
|
26
|
+
# openctf-server
|
|
27
|
+
|
|
28
|
+
Flask API and sandboxed target-website service for [OpenCTF](https://github.com/XHIiddenProjects/OpenCTF), a self-hosted lab CTF platform. This package is the server half only - the desktop client is published separately on npm as `openctf`.
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
```bash
|
|
32
|
+
pip install openctf-server
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Quick start
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
export SECRET_KEY=$(python -c "import secrets; print(secrets.token_hex(32))")
|
|
39
|
+
export JWT_SECRET_KEY=$(python -c "import secrets; print(secrets.token_hex(32))")
|
|
40
|
+
export FLAG_PEPPER=$(python -c "import secrets; print(secrets.token_hex(32))")
|
|
41
|
+
export TARGET_ACCESS_SECRET=$(python -c "import secrets; print(secrets.token_hex(32))")
|
|
42
|
+
export ADMIN_PASSWORD=set-a-real-password
|
|
43
|
+
|
|
44
|
+
openctf-server # main API on :5000
|
|
45
|
+
openctf-server-target # sandboxed target-website service on :5001 (separate terminal)
|
|
46
|
+
openctf-server-seed # load the starter set of preset challenges (one-off)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
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.
|
|
50
|
+
|
|
51
|
+
## Configuration
|
|
52
|
+
|
|
53
|
+
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).
|
|
54
|
+
|
|
55
|
+
## Docker
|
|
56
|
+
|
|
57
|
+
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](https://github.com/XHIiddenProjects/OpenCTF#installation) for that path.
|
|
58
|
+
|
|
59
|
+
## Security
|
|
60
|
+
|
|
61
|
+
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.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""OpenCTF server - Flask API, sandboxed target-website service, and
|
|
2
|
+
challenge-seeding CLI for the OpenCTF lab platform.
|
|
3
|
+
|
|
4
|
+
This file exists so the flat `server/` directory (app.py, target_app.py,
|
|
5
|
+
seed_challenges.py) can also be published to PyPI as a proper namespaced
|
|
6
|
+
package (`openctf_server`), without moving any of those files - see
|
|
7
|
+
pyproject.toml's `[tool.setuptools] package-dir` mapping. Running things
|
|
8
|
+
directly from this directory (`python app.py`, `python target_app.py`,
|
|
9
|
+
`python seed_challenges.py`) is unaffected either way.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
__version__ = "0.1.0"
|