Documentation gerade gezogen

Dieser Commit ist enthalten in:
2025-06-22 20:17:05 +02:00
Ursprung 4b093fa3a9
Commit 8cb483a034
3 geänderte Dateien mit 131 neuen und 117 gelöschten Zeilen

Datei anzeigen

@@ -12,10 +12,12 @@ X-API-Key: AF-2025-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
``` ```
**API Key Management:** **API Key Management:**
- API keys can be managed through the Admin Panel under Administration → API Keys - API keys can be managed through the Admin Panel under "Lizenzserver Administration""System-API-Key generieren"
- Keys follow the format: `AF-YYYY-[32 random characters]` - Keys follow the format: `AF-YYYY-[32 random characters]`
- Only one system API key is active at a time - Only one system API key is active at a time
- Regenerating the key will immediately invalidate the old key - Regenerating the key will immediately invalidate the old key
- The initial API key is automatically generated on first startup
- To retrieve the initial API key from database: `SELECT api_key FROM system_api_key WHERE id = 1;`
**Error Response (401 Unauthorized):** **Error Response (401 Unauthorized):**
```json ```json
@@ -28,6 +30,8 @@ X-API-Key: AF-2025-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
## License Server API ## License Server API
**Base URL:** `https://api-software-undso.z5m7q9dk3ah2v1plx6ju.com`
### Public Endpoints ### Public Endpoints
#### GET / #### GET /
@@ -136,7 +140,7 @@ Get license information.
**Headers:** **Headers:**
``` ```
X-API-Key: your-api-key X-API-Key: AF-2025-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
``` ```
**Response:** **Response:**
@@ -168,6 +172,8 @@ X-API-Key: your-api-key
### Session Management API Endpoints ### Session Management API Endpoints
**Note:** Session endpoints require that the client application is configured in the `client_configs` table. The default client "Account Forger" is pre-configured.
#### POST /api/license/session/start #### POST /api/license/session/start
Start a new session for a license. Start a new session for a license.
@@ -235,7 +241,7 @@ Check for available updates.
**Headers:** **Headers:**
``` ```
X-API-Key: your-api-key X-API-Key: AF-2025-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
``` ```
**Request:** **Request:**
@@ -246,20 +252,38 @@ X-API-Key: your-api-key
} }
``` ```
**Response:** Update availability status with version info **Response:**
```json
{
"update_available": true,
"latest_version": "1.1.0",
"download_url": "https://example.com/download/v1.1.0",
"release_notes": "Bug fixes and performance improvements"
}
```
#### GET /api/version/latest #### GET /api/version/latest
Get latest version information. Get latest version information.
**Headers:** **Headers:**
``` ```
X-API-Key: your-api-key X-API-Key: AF-2025-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
``` ```
**Response:** Latest version information **Response:**
```json
{
"version": "1.1.0",
"release_date": "2025-06-20",
"download_url": "https://example.com/download/v1.1.0",
"release_notes": "Bug fixes and performance improvements"
}
```
## Admin Panel API ## Admin Panel API
**Base URL:** `https://admin-panel-undso.z5m7q9dk3ah2v1plx6ju.com`
### Customer API Endpoints ### Customer API Endpoints
#### GET /api/customers #### GET /api/customers
@@ -791,7 +815,7 @@ All errors return JSON with `error`, `code`, and `status` fields.
Example request with required headers: Example request with required headers:
```bash ```bash
curl -X POST http://localhost/api/license/activate \ curl -X POST https://api-software-undso.z5m7q9dk3ah2v1plx6ju.com/api/license/activate \
-H "X-API-Key: AF-2025-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \ -H "X-API-Key: AF-2025-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
@@ -810,7 +834,13 @@ curl -X POST http://localhost/api/license/activate \
- Username: `w@rh@mm3r` / Password: `Warhammer123!` - Username: `w@rh@mm3r` / Password: `Warhammer123!`
- API Key: Generated in Admin Panel under "Lizenzserver Administration" - API Key: Generated in Admin Panel under "Lizenzserver Administration"
### Getting the Initial API Key
If you need to retrieve the API key directly from the database:
```bash
docker exec -it v2_postgres psql -U postgres -d v2_db -c "SELECT api_key FROM system_api_key WHERE id = 1;"
```
### Test Endpoints ### Test Endpoints
- Admin Panel: `http://localhost:80` - Admin Panel: `https://admin-panel-undso.z5m7q9dk3ah2v1plx6ju.com/`
- License Server API: `http://localhost:80/api` - License Server API: `https://api-software-undso.z5m7q9dk3ah2v1plx6ju.com/`
- Monitoring: See OPERATIONS_GUIDE.md - Monitoring: See OPERATIONS_GUIDE.md

Datei anzeigen

@@ -1,5 +1,19 @@
# V2-Docker Operations Guide # V2-Docker Operations Guide
## WICHTIGER HINWEIS
**NICHT VERWENDEN (für <100 Kunden nicht benötigt):**
- ❌ Redis - System verwendet direkte DB-Verbindungen
- ❌ RabbitMQ - System verwendet synchrone Verarbeitung
- ❌ Prometheus/Grafana/Alertmanager - Integrierte Überwachung ist ausreichend
- ❌ Externe Monitoring-Tools - Admin Panel hat alle benötigten Metriken
**NUR DIESE SERVICES VERWENDEN:**
- ✅ PostgreSQL (db)
- ✅ License Server (license-server)
- ✅ Admin Panel (admin-panel)
- ✅ Nginx Proxy (nginx-proxy)
## Deployment ## Deployment
### Prerequisites ### Prerequisites
@@ -16,12 +30,12 @@ Database initializes automatically via init.sql.
### Standard-Zugangsdaten ### Standard-Zugangsdaten
#### Admin Panel #### Admin Panel
- URL: http://localhost:80 (oder konfigurierte Domain) - URL: https://admin-panel-undso.z5m7q9dk3ah2v1plx6ju.com/
- User 1: `rac00n` / `1248163264` - User 1: `rac00n` / `1248163264`
- User 2: `w@rh@mm3r` / `Warhammer123!` - User 2: `w@rh@mm3r` / `Warhammer123!`
#### License Server API #### License Server API
- URL: http://localhost:80/api (über Nginx Proxy) - URL: https://api-software-undso.z5m7q9dk3ah2v1plx6ju.com/
- API Key: Wird im Admin Panel unter "Lizenzserver Administration" verwaltet - API Key: Wird im Admin Panel unter "Lizenzserver Administration" verwaltet
- Header: `X-API-Key: <api-key>` - Header: `X-API-Key: <api-key>`
@@ -31,41 +45,38 @@ Database initializes automatically via init.sql.
```yaml ```yaml
license-server: license-server:
build: ./v2_lizenzserver build: ./v2_lizenzserver
container_name: v2_license_server container_name: license-server
environment: environment:
- DATABASE_URL=postgresql://adminuser:supergeheimespasswort@postgres:5432/meinedatenbank - DATABASE_URL=postgresql://adminuser:supergeheimespasswort@db:5432/meinedatenbank
- JWT_SECRET=your-secret-jwt-key-here-minimum-32-chars - JWT_SECRET=your-secret-jwt-key-here-minimum-32-chars
- REDIS_HOST=redis # NICHT VERWENDEN:
- RABBITMQ_HOST=rabbitmq # - REDIS_HOST=redis # NICHT BENÖTIGT
# - RABBITMQ_HOST=rabbitmq # NICHT BENÖTIGT
expose: expose:
- "8000" - "8443"
networks: networks:
- backend - backend
- monitoring
depends_on: depends_on:
- postgres - db # Nur PostgreSQL wird benötigt
- redis
- rabbitmq
``` ```
#### Admin Panel #### Admin Panel
```yaml ```yaml
admin-panel: admin-panel:
build: ./v2_adminpanel build: ./v2_adminpanel
container_name: v2_admin_panel container_name: admin-panel
environment: environment:
- DATABASE_URL=postgresql://adminuser:supergeheimespasswort@postgres:5432/meinedatenbank - DATABASE_URL=postgresql://adminuser:supergeheimespasswort@db:5432/meinedatenbank
- SECRET_KEY=supersecretkey - SECRET_KEY=supersecretkey
- JWT_SECRET=your-secret-jwt-key-here-minimum-32-chars - JWT_SECRET=your-secret-jwt-key-here-minimum-32-chars
- REDIS_HOST=redis # NICHT VERWENDEN:
# - REDIS_HOST=redis # NICHT BENÖTIGT
expose: expose:
- "5000" - "5000"
networks: networks:
- backend - backend
- monitoring
depends_on: depends_on:
- postgres - db # Nur PostgreSQL wird benötigt
- redis
volumes: volumes:
- ./backups:/app/backups - ./backups:/app/backups
``` ```
@@ -74,7 +85,7 @@ admin-panel:
```yaml ```yaml
nginx: nginx:
build: ./v2_nginx build: ./v2_nginx
container_name: v2_nginx container_name: nginx-proxy
ports: ports:
- "80:80" - "80:80"
networks: networks:
@@ -91,82 +102,33 @@ nginx:
## Monitoring ## Monitoring
### Prometheus Configuration **WICHTIG**: Externe Monitoring-Tools werden NICHT verwendet! Die folgenden Konfigurationen sind VERALTET und sollten IGNORIERT werden.
#### Scrape Configs ### Integrierte Überwachung (Admin Panel)
```yaml
scrape_configs:
- job_name: 'license-server'
static_configs:
- targets: ['license-server:8000']
metrics_path: /metrics
- job_name: 'admin-panel' **HINWEIS**: Externe Monitoring-Tools (Grafana, Prometheus, etc.) werden NICHT verwendet!
static_configs:
- targets: ['admin-panel:5000']
metrics_path: /metrics
- job_name: 'postgres' Das Admin Panel bietet alle benötigten Überwachungsfunktionen:
static_configs:
- targets: ['postgres-exporter:9187']
- job_name: 'redis' 1. **Dashboard** (Startseite)
static_configs: - Aktive Lizenzen
- targets: ['redis-exporter:9121'] - Aktive Sessions
- Heartbeat-Statistiken
- System-Metriken
- job_name: 'node' 2. **Log-Seite**
static_configs: - Vollständiges Audit-Log aller Aktionen
- targets: ['node-exporter:9100'] - Filterbar nach Benutzer, Aktion, Entität
- Export in Excel/CSV
- job_name: 'cadvisor' 3. **Lizenz-Übersicht**
static_configs: - Aktive/Inaktive Lizenzen
- targets: ['cadvisor:8080'] - Session-Status in Echtzeit
``` - Letzte Heartbeats
#### Alert Rules 4. **Metriken-Endpoint**
- License server down: `up{job="license-server"} == 0` - `/metrics` im License Server für basic monitoring
- High error rate: `rate(http_requests_total{status=~"5.."}[5m]) > 0.05` - Zeigt aktuelle Anfragen, Fehler, etc.
- Database connections: `pg_stat_database_numbackends > 100`
### Grafana Dashboards
1. **System Overview Dashboard**
- CPU and memory usage
- Network traffic
- Disk usage
- Container status
2. **License Server Dashboard**
- Active licenses
- Heartbeat frequency
- API response times
- Error rates
3. **Database Performance Dashboard**
- Query performance
- Connection pool status
- Table sizes
- Slow queries
### Accessing Monitoring
- Prometheus: http://localhost:9090
- Grafana: http://localhost:3001
- Default Login: admin/admin
- Vorkonfigurierte Dashboards:
- System Overview
- License Server Metrics
- Database Performance
- Alertmanager: http://localhost:9093
### Monitoring Stack Services
- PostgreSQL Exporter: Sammelt DB-Metriken (Port 9187)
- Redis Exporter: Sammelt Cache-Metriken (Port 9121)
- Node Exporter: System-Level Metriken (Port 9100)
- cAdvisor: Container-Metriken (Port 8080)
- Prometheus: Metrics Collection (Port 9090)
- Grafana: Visualization (Port 3000)
- Alertmanager: Alert Management (Port 9093)
## Features Overview ## Features Overview
@@ -232,10 +194,10 @@ DROP TABLE IF EXISTS license_heartbeats_2024_01;
#### Backup Procedures #### Backup Procedures
```bash ```bash
# Backup # Backup
docker exec v2_postgres pg_dump -U adminuser meinedatenbank | gzip > backup_$(date +%Y%m%d).sql.gz docker exec db pg_dump -U adminuser meinedatenbank | gzip > backup_$(date +%Y%m%d).sql.gz
# Restore # Restore
gunzip -c backup_20250619.sql.gz | docker exec -i v2_postgres psql -U adminuser meinedatenbank gunzip -c backup_20250619.sql.gz | docker exec -i db psql -U adminuser meinedatenbank
``` ```
##### Integriertes Backup-System ##### Integriertes Backup-System
@@ -320,13 +282,13 @@ db:
#### License Server Not Responding #### License Server Not Responding
- Check status: `docker ps | grep license` - Check status: `docker ps | grep license`
- View logs: `docker logs v2_license_server --tail 100` - View logs: `docker logs license-server --tail 100`
- Test health: `docker exec v2_nginx curl http://license-server:8000/health` - Test health: `docker exec nginx-proxy curl http://license-server:8443/health`
#### Database Connection Issues #### Database Connection Issues
- Check status: `docker exec v2_postgres pg_isready` - Check status: `docker exec db pg_isready`
- Test connection: Use psql from admin panel container - Test connection: Use psql from admin panel container
- Check logs: `docker logs v2_postgres --tail 50` - Check logs: `docker logs db --tail 50`
#### High Memory Usage #### High Memory Usage
1. Check container stats: `docker stats` 1. Check container stats: `docker stats`
@@ -342,7 +304,7 @@ Quick health check script:
docker ps --format "table {{.Names}}\t{{.Status}}" docker ps --format "table {{.Names}}\t{{.Status}}"
# Key endpoints # Key endpoints
curl -s http://localhost/api/health curl -s https://api-software-undso.z5m7q9dk3ah2v1plx6ju.com/health
curl -s http://localhost:9090/-/healthy curl -s http://localhost:9090/-/healthy
``` ```
@@ -381,17 +343,18 @@ server {
server_name api-software-undso.z5m7q9dk3ah2v1plx6ju.com; server_name api-software-undso.z5m7q9dk3ah2v1plx6ju.com;
location / { location / {
proxy_pass https://license_servers; proxy_pass http://license_servers;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Connection ""; proxy_set_header Connection "";
} }
} }
``` ```
#### Scaling Considerations #### Scaling Considerations (für >100 Kunden)
- Redis für Session-Sharing zwischen Instanzen **HINWEIS**: Für <100 Kunden ist keine Skalierung notwendig!
- RabbitMQ für asynchrone Task-Verteilung - Direkter DB-Zugriff ist ausreichend (kein Redis benötigt)
- Sticky Sessions bei Bedarf aktivieren - Synchrone Verarbeitung ist schnell genug (kein RabbitMQ benötigt)
- Single Instance ist völlig ausreichend
### Database Scaling ### Database Scaling
- Read replicas for reporting - Read replicas for reporting

Datei anzeigen

@@ -1,8 +1,24 @@
# V2-Docker System Documentation # V2-Docker System Documentation
## WICHTIGER HINWEIS FÜR ZUKÜNFTIGE ENTWICKLUNG
**DIESE SERVICES WERDEN NICHT VERWENDET:**
- ❌ Redis - NICHT BENÖTIGT für <100 Kunden
- ❌ RabbitMQ - NICHT BENÖTIGT für <100 Kunden
- ❌ Prometheus - NICHT BENÖTIGT
- ❌ Grafana - NICHT BENÖTIGT
- ❌ Alertmanager - NICHT BENÖTIGT
- ❌ Externe Monitoring-Tools - NICHT BENÖTIGT
**Das System verwendet NUR:**
- ✅ PostgreSQL für alle Datenspeicherung
- ✅ Integrierte Überwachung im Admin Panel
- ✅ Direkte Datenbankverbindungen ohne Cache
- ✅ Synchrone Verarbeitung ohne Message Queue
## Overview ## Overview
V2-Docker is a comprehensive system featuring a License Server, Admin Panel, Lead Management, and Monitoring Stack. This document consolidates all architecture and implementation details. V2-Docker is a streamlined system featuring a License Server, Admin Panel, and Lead Management with integrated monitoring. This document consolidates all architecture and implementation details.
## License Server Architecture ## License Server Architecture
@@ -221,17 +237,22 @@ Pre-configured dashboards and alerts for system health.
### Docker Services ### Docker Services
#### Aktive Services #### Aktive Services
- `v2_postgres`: PostgreSQL database (Port 5432) - `db`: PostgreSQL database (Port 5432)
- `v2_admin_panel`: Admin interface (interner Port 5000) - `admin-panel`: Admin interface (interner Port 5000)
- `v2_nginx`: Reverse proxy (Port 80) - `nginx-proxy`: Reverse proxy (Ports 80, 443)
- `v2_license_server`: License server (interner Port 8000) - `license-server`: License server (interner Port 8443)
- `v2_redis`: Redis cache (Port 6379)
- `v2_rabbitmq`: Message queue (Ports 5672, 15672)
See monitoring configuration in `monitoring/docker-compose.monitoring.yml`. #### NICHT VERWENDETE Services (DO NOT USE)
-`redis`: Redis cache - NICHT BENÖTIGT für <100 Kunden
-`rabbitmq`: Message queue - NICHT BENÖTIGT für <100 Kunden
- ❌ External monitoring (Prometheus, Grafana, Alertmanager) - NICHT BENÖTIGT
-`monitoring/docker-compose.monitoring.yml` - NICHT VERWENDEN
**WICHTIG**: Das System verwendet KEINE externen Monitoring-Tools, Redis oder RabbitMQ. Die eingebaute Überwachung im Admin Panel ist ausreichend für <100 Kunden.
### Environment Configuration ### Environment Configuration
Required: DATABASE_URL, SECRET_KEY, JWT_SECRET Required: DATABASE_URL, SECRET_KEY, JWT_SECRET
NOT Required: REDIS_HOST, RABBITMQ_HOST (diese NICHT konfigurieren)
See docker-compose.yaml for all environment variables. See docker-compose.yaml for all environment variables.
@@ -240,5 +261,5 @@ System is production-ready with all core features implemented:
- ✅ License management with session enforcement - ✅ License management with session enforcement
- ✅ Lead management CRM - ✅ Lead management CRM
- ✅ Resource pool management - ✅ Resource pool management
-Complete monitoring stack -Integrierte Überwachung (Admin Panel)
- ✅ Backup and audit systems - ✅ Backup and audit systems