Documentation - Three levels: DOCS/General (overview, configuration), DOCS/Deployment (choose a method, first steps), details per method in Containers/ and System_Services/; new root README and DOCS/README map. - Remove superseded pages (Deployment.md, Deployment_Docker/Native.md, Index.md); split the two scenario guides by section. - Isolate the Timeweb/Hysteria2 records in DEPLOYMENTS/timeweb-hysteria2/ (not linked from DOCS, listed in .graphifyignore). - Add DOCS/code_review/ with a time-stamped analysis of the code base. Gatherer (BUG-02, BUG-03) - Session key (CN, address, connected_since_ts), baseline from the active_sessions snapshot, grace period for sessions missing from the status. - Status file integrity (TITLE/TIME/END) and freshness; a torn read skips the tick. - Cache applied after commit; main loop survives exceptions, backs off, and stops cleanly on SIGTERM/SIGINT; new client rows start with the first frame's totals; five tests. JWT signing key (SEC-01) - No built-in default: Core and Profiler refuse to start with a missing, placeholder or short (< 32) key; shipped config.ini has an empty value. - Same rule in install.sh, update.sh (issues a new key when missing or weak), docker lib/entrypoint; five tests, conftest.py for the test key. Each change has a plan and a summary under DOCS/Changes/. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
50 lines
1.5 KiB
Markdown
50 lines
1.5 KiB
Markdown
# OpenVPN Profiler API
|
|
|
|
A modern, Python-based REST API for managing OpenVPN servers, Public Key Infrastructure (PKI), and user profiles. This component is located in `APP_PROFILER/`.
|
|
|
|
## Features
|
|
|
|
* **REST API**: Built with FastAPI for robust performance and automatic documentation.
|
|
* **Database Storage**: Configurations and user profiles are stored in SQLite (extensible to other DBs via SQLAlchemy).
|
|
* **PKI Management**: Integrated management of EasyRSA for CA, Server, and Client certificate generation.
|
|
* **Dynamic Configuration**: Templated generation of `server.conf` and client `.ovpn` files using Jinja2.
|
|
|
|
## Quick Start
|
|
|
|
### Prerequisites
|
|
|
|
* Python 3.10 or higher
|
|
* OpenVPN (installed and available in PATH)
|
|
* Easy-RSA 3 (must be present in the `easy-rsa` directory in the project root)
|
|
|
|
### Usage
|
|
|
|
Once the server is running (see [Deployment Guide](../Deployment/README.md)), the full interactive API documentation is available at:
|
|
* **Swagger UI**: `http://<your-server>:8000/docs`
|
|
* **ReDoc**: `http://<your-server>:8000/redoc`
|
|
|
|
### Common Operations
|
|
|
|
**Create a new User Profile:**
|
|
```bash
|
|
curl -X POST "http://localhost:8000/profiles" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"username": "jdoe"}'
|
|
```
|
|
|
|
**Download User Config:**
|
|
```bash
|
|
# Get the ID from the profile creation response or list
|
|
curl -O -J http://localhost:8000/profiles/1/download
|
|
```
|
|
|
|
**Revoke User:**
|
|
```bash
|
|
curl -X DELETE http://localhost:8000/profiles/1
|
|
```
|
|
|
|
**Get System Configuration:**
|
|
```bash
|
|
curl http://localhost:8000/config
|
|
```
|