Initial commit
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
# skyevouchers
|
||||
|
||||
Web-App zur Ausgabe von UniFi Hotspot-Vouchers mit Admin-Backend.
|
||||
|
||||
## Features
|
||||
- **Frontend**: Zeigt einen Voucher-Code mit Slot-Maschinen-Animation an
|
||||
- **Einmalig**: Jeder Code kann nur einmal verwendet werden
|
||||
- **Admin** (`/admin`): Passwort-geschütztes Dashboard
|
||||
- Voucher-Import per Paste aus UniFi-Export
|
||||
- Übersicht verfügbarer & verwendeter Vouchers
|
||||
- **Gotify-Benachrichtigung** wenn ≤ 2 Vouchers übrig sind
|
||||
- MySQL-Datenbank
|
||||
|
||||
## Schnellstart mit Docker
|
||||
|
||||
```bash
|
||||
# 1. Repo klonen / Dateien kopieren
|
||||
# 2. .env erstellen
|
||||
cp .env.example .env
|
||||
# .env anpassen (Passwörter, Gotify-URL etc.)
|
||||
|
||||
# 3. Starten
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
Die App läuft dann auf `http://localhost:5000`
|
||||
Admin: `http://localhost:5000/admin`
|
||||
|
||||
## Ohne Docker (lokal)
|
||||
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
|
||||
# Umgebungsvariablen setzen (oder .env manuell sourcen)
|
||||
export DB_HOST=localhost
|
||||
export DB_USER=root
|
||||
export DB_PASSWORD=...
|
||||
export DB_NAME=skyevouchers
|
||||
export ADMIN_PASSWORD=geheim
|
||||
export GOTIFY_URL=http://gotify:8080
|
||||
export GOTIFY_TOKEN=abc123
|
||||
|
||||
python app.py
|
||||
```
|
||||
|
||||
## Vouchers importieren
|
||||
|
||||
1. In UniFi → Vouchers exportieren (als Text kopieren)
|
||||
2. Admin-Bereich öffnen (`/admin`)
|
||||
3. Text in das Import-Feld einfügen → „Vouchers extrahieren & importieren"
|
||||
|
||||
Das Format wird automatisch erkannt: `GUESTS64071-58673 1 day ...`
|
||||
Extrahiert werden Codes im Format `XXXXX-XXXXX`.
|
||||
|
||||
## Umgebungsvariablen
|
||||
|
||||
| Variable | Standard | Beschreibung |
|
||||
|-----------------|---------------------|---------------------------|
|
||||
| `DB_HOST` | `localhost` | MySQL-Host |
|
||||
| `DB_USER` | `root` | MySQL-Benutzer |
|
||||
| `DB_PASSWORD` | *(leer)* | MySQL-Passwort |
|
||||
| `DB_NAME` | `skyevouchers` | Datenbankname |
|
||||
| `ADMIN_PASSWORD`| `admin123` | Admin-Login-Passwort |
|
||||
| `SECRET_KEY` | *(default)* | Flask Session Secret |
|
||||
| `GOTIFY_URL` | `http://localhost:8080` | Gotify-Basis-URL |
|
||||
| `GOTIFY_TOKEN` | *(leer)* | Gotify App-Token |
|
||||
Reference in New Issue
Block a user