docker environment control improvement
This commit is contained in:
77
README.md
77
README.md
@@ -2,61 +2,78 @@
|
||||
|
||||
A modern, full-stack management solution for OpenVPN servers. It combines real-time traffic monitoring, historical analytics, and comprehensive user profile/PKI management into a unified web interface.
|
||||
|
||||
## <EFBFBD>️ Project Architecture
|
||||
## 🏗️ Project Architecture
|
||||
|
||||
The project is modularized into three core components:
|
||||
The project is modularized into four core microservices:
|
||||
|
||||
| Component | Directory | Description |
|
||||
| Component | Directory | Service Name | Description |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| **User Interface** | `APP_UI/` | `ovp-ui` | Vue 3 + Vite SPA served via Nginx. |
|
||||
| **Monitoring API** | `APP_CORE/` | `ovp-api` | Flask API for real-time stats and sessions. |
|
||||
| **Data Gatherer** | `APP_CORE/` | `ovp-gatherer` | Background service for traffic log aggregation & TSDB. |
|
||||
| **Profiler** | `APP_PROFILER/` | `ovp-profiler` | FastAPI module for PKI, Certificates, and VPN control. |
|
||||
|
||||
## 📦 Quick Start (Docker)
|
||||
|
||||
The recommended way to deploy is using Docker Compose:
|
||||
|
||||
1. **Clone the repository**
|
||||
2. **Start all services**:
|
||||
```bash
|
||||
docker-compose up -d --build
|
||||
```
|
||||
3. **Access the Dashboard**: Open `http://localhost` in your browser.
|
||||
|
||||
## ⚙️ Configuration
|
||||
|
||||
The system is highly configurable via environment variables in `docker-compose.yml`. All variables follow the `OVPMON_{SECTION}_{KEY}` format.
|
||||
|
||||
### Key Environment Variables
|
||||
|
||||
| Variable | Description | Default Value |
|
||||
| :--- | :--- | :--- |
|
||||
| **Core Monitoring** | `APP_CORE/` | Flask-based API (v3) for log parsing, real-time stats, and historical TSDB. |
|
||||
| **Profiler** | `APP_PROFILER/` | FastAPI-based module for managing PKI, Certificates, and Server Configs. |
|
||||
| **User Interface** | `APP_UI/` | Vue 3 + Vite Single Page Application (SPA) serving as the unified dashboard. |
|
||||
| `OVPMON_API_SECRET_KEY` | JWT Secret Key | `ovpmon-secret-change-me` |
|
||||
| `OVPMON_API_PORT` | Monitoring API Port | `5001` |
|
||||
| `OVPMON_OPENVPN_MONITOR_DB_PATH` | Path to SQLite DB | `/app/db/openvpn_monitor.db` |
|
||||
| `OVPMON_OPENVPN_MONITOR_LOG_PATH`| Path to OpenVPN status log | `/var/log/openvpn/openvpn-status.log` |
|
||||
| `OVPMON_LOGGING_LEVEL` | Logging level (INFO/DEBUG) | `INFO` |
|
||||
|
||||
## 📚 Documentation
|
||||
|
||||
Detailed documentation has been moved to the `DOCS/` directory.
|
||||
Detailed documentation is available in the `DOCS/` directory:
|
||||
|
||||
- **[Installation & Deployment](DOCS/General/Deployment.md)**: Setup guide for Linux (Alpine/Debian).
|
||||
- **[Service Management](DOCS/General/Service_Management.md)**: Configuring Systemd/OpenRC services.
|
||||
- **[Security & Auth](DOCS/General/Security_Architecture.md)**: 2FA, JWT, and Security details.
|
||||
- **[Deployment Guide](DOCS/General/Deployment.md)**: Manual setup for Linux.
|
||||
- **[Security Architecture](DOCS/General/Security_Architecture.md)**: 2FA, JWT, and Security.
|
||||
- **[API Reference](DOCS/Core_Monitoring/API_Reference.md)**: Core Monitoring endpoints.
|
||||
|
||||
### API References
|
||||
- **[Core Monitoring API](DOCS/Core_Monitoring/API_Reference.md)**: Endpoints for stats, sessions, and history.
|
||||
- **[Profiler Management API](DOCS/Profiler_Management/API_Reference.md)**: Endpoints for profiles, system config, and control.
|
||||
## 🛠️ Development (Manual)
|
||||
|
||||
## 🚀 Quick Start (Dev Mode)
|
||||
If you wish to run services manually for development:
|
||||
|
||||
### 1. Core API (Flask)
|
||||
### 1. Core API & Gatherer
|
||||
```bash
|
||||
cd APP_CORE
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
python3 openvpn_api_v3.py
|
||||
# Runs on :5001 (Monitoring)
|
||||
python3 openvpn_api_v3.py # APP_CORE API (:5001)
|
||||
python3 openvpn_gatherer_v3.py # APP_CORE Gatherer
|
||||
```
|
||||
|
||||
### 2. Profiler API (FastAPI)
|
||||
### 2. Profiler API
|
||||
```bash
|
||||
cd APP_PROFILER
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
python3 main.py
|
||||
# Runs on :8000 (Management)
|
||||
python3 main.py # APP_PROFILER API (:8000)
|
||||
```
|
||||
|
||||
### 3. Frontend (Vue 3)
|
||||
### 3. Frontend
|
||||
```bash
|
||||
cd APP_UI
|
||||
npm install
|
||||
npm run dev
|
||||
# Runs on localhost:5173
|
||||
npm install && npm run dev # UI (:5173)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Important Notes
|
||||
|
||||
1. **Environment**: Production deployment relies on Nginx to proxy requests to the backend services. See the [Deployment Guide](DOCS/General/Deployment.md).
|
||||
2. **Permissions**: The backend requires `sudo` or root privileges to manage OpenVPN processes and write to `/etc/openvpn`.
|
||||
1. **Permissions**: The Profiler container requires `NET_ADMIN` capabilities and access to `/dev/net/tun`.
|
||||
2. **Cleanup**: Certificate management and legacy visualization settings have been moved or removed from the Core module.
|
||||
|
||||
Reference in New Issue
Block a user