Erstumsetzung: OAMC Turnierauswertung (AP 0–7, 9)
* Datenmodell + Alembic-Initialmigration (Plan §4), Seed Saison 2026 * Wertungs-Engine (Plan §3.3), regelbasiert je Kategorie/Saison - Abnahmetest gegen die Ergebnisliste 2026-05-31 * Meisterschaftsberechnung mit Streichresultaten + Tie-Break (PLATZHALTER-Punktetabelle, O-1 offen) * Ingest-API (idempotent, dry_run) inkl. Excel-Leser und Fahrer-Matching/Merge * Zeitmessungs-Endpoint (Batch, idempotent, unzugeordnet/unplausibel) + SSE-Anzeige - Mess-Pi-Client bewusst NICHT enthalten (docs/zeitmessung-endpoint.md) * Frontend: öffentliche Seiten + internes Backend (Jinja2/HTMX, kein Build) * Auslieferung: Docker (multi-arch) + docker-compose sowie Debian-Paket/APT-Repo * 57 Tests grün gegen echte PostgreSQL-Testdatenbank Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# Taeglicher pg_dump der OAMC-Turnierdatenbank (Plan §5.3).
|
||||
# Als Cron/Timer fuer den Benutzer 'postgres' oder 'oamc' einrichten:
|
||||
# 15 2 * * * /usr/share/doc/oamc-turnier/examples/pg_dump.sh
|
||||
set -eu
|
||||
|
||||
DB="${OAMC_DB_NAME:-oamc}"
|
||||
ZIEL="${OAMC_BACKUP_DIR:-/var/backups/oamc}"
|
||||
BEHALTEN_TAGE="${OAMC_BACKUP_KEEP_DAYS:-30}"
|
||||
STAMP="$(date +%Y-%m-%d_%H%M)"
|
||||
|
||||
mkdir -p "$ZIEL"
|
||||
DATEI="$ZIEL/oamc_${STAMP}.sql.gz"
|
||||
|
||||
pg_dump --format=plain --no-owner --dbname="$DB" | gzip -9 > "$DATEI"
|
||||
echo "Backup: $DATEI ($(du -h "$DATEI" | cut -f1))"
|
||||
|
||||
# Alte Backups aufraeumen
|
||||
find "$ZIEL" -name 'oamc_*.sql.gz' -mtime "+${BEHALTEN_TAGE}" -delete
|
||||
|
||||
# WICHTIG (Plan §5.3): woechentlich eine Vollsicherung auf ein EXTERNES Medium
|
||||
# ziehen und den Restore mindestens einmal testen:
|
||||
# gunzip -c oamc_....sql.gz | psql -d oamc_restore_test
|
||||
@@ -0,0 +1,40 @@
|
||||
# nginx vHost fuer die OAMC Turnierauswertung (bare-metal / Raspberry Pi).
|
||||
# TLS via certbot: certbot --nginx -d mt.oamc.de
|
||||
# Danach ergaenzt certbot die listen-443- und ssl_*-Zeilen automatisch.
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name mt.oamc.de;
|
||||
|
||||
# certbot-Challenge
|
||||
location /.well-known/acme-challenge/ { root /var/www/html; }
|
||||
|
||||
# Rest auf HTTPS umleiten (nach dem ersten certbot-Lauf aktivieren):
|
||||
# return 301 https://$host$request_uri;
|
||||
|
||||
client_max_body_size 25m;
|
||||
|
||||
location = /favicon.ico { access_log off; log_not_found off; }
|
||||
|
||||
location /api/v1/turniere/aktiv/anzeige {
|
||||
proxy_pass http://127.0.0.1:8000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_read_timeout 3600s;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 60s;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
# Manuelle Installation ohne .deb (git-Checkout + venv unter /opt/oamc-turnier/app).
|
||||
# sudo cp deploy/systemd/oamc-turnier.service /etc/systemd/system/
|
||||
# sudo systemctl daemon-reload && sudo systemctl enable --now oamc-turnier
|
||||
[Unit]
|
||||
Description=OAMC Turnierauswertung (FastAPI/uvicorn)
|
||||
After=network-online.target postgresql.service
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
User=oamc
|
||||
Group=oamc
|
||||
EnvironmentFile=/etc/oamc-turnier/oamc-turnier.env
|
||||
WorkingDirectory=/opt/oamc-turnier/app
|
||||
ExecStartPre=/opt/oamc-turnier/app/.venv/bin/alembic upgrade head
|
||||
ExecStart=/opt/oamc-turnier/app/.venv/bin/uvicorn oamc.main:app \
|
||||
--host 127.0.0.1 --port 8000 --proxy-headers --forwarded-allow-ips '*'
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
NoNewPrivileges=true
|
||||
ProtectSystem=strict
|
||||
ProtectHome=true
|
||||
PrivateTmp=true
|
||||
ReadWritePaths=/var/oamc
|
||||
StateDirectory=oamc-turnier
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user