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:
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
oamc-turnier (0.1.0) unstable; urgency=medium
|
||||
|
||||
* Erste Paketierung: FastAPI-Anwendung, Datenmodell + Alembic-Migrationen,
|
||||
Wertungs-Engine (Plan §3.3), Meisterschaftsberechnung (Platzhalter-Punkte,
|
||||
O-1 offen), Ingest-API, Geraete-/Zeitmessungs-Endpoint, oeffentliches und
|
||||
internes Frontend.
|
||||
|
||||
-- OAMC Reinheim e.V. im ADAC <webmaster@oamc.de> Fri, 05 Sep 2026 18:00:00 +0200
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
Source: oamc-turnier
|
||||
Section: web
|
||||
Priority: optional
|
||||
Maintainer: OAMC Reinheim e.V. im ADAC <webmaster@oamc.de>
|
||||
Build-Depends: debhelper-compat (= 13),
|
||||
python3 (>= 3.11),
|
||||
python3-venv,
|
||||
python3-pip
|
||||
Standards-Version: 4.6.2
|
||||
Homepage: https://oamc.de
|
||||
Rules-Requires-Root: no
|
||||
|
||||
Package: oamc-turnier
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends},
|
||||
python3 (>= 3.11),
|
||||
adduser,
|
||||
libpq5,
|
||||
postgresql-client
|
||||
Recommends: postgresql-17 | postgresql, nginx
|
||||
Suggests: certbot
|
||||
Description: Auswertung von ADAC Motorrad-Turnieren (OAMC Reinheim)
|
||||
Webanwendung fuer Turnierergebnisse, Zeitmessungs-Ingest, Fahrerdatenbank und
|
||||
Meisterschaftswertung. Enthaelt die FastAPI-Anwendung als eigenstaendiges
|
||||
virtualenv unter /opt/oamc-turnier sowie eine systemd-Unit.
|
||||
.
|
||||
Nach der Installation ist /etc/oamc-turnier/oamc-turnier.env auszufuellen
|
||||
(DATABASE_URL, SECRET_KEY) und der Dienst mit
|
||||
"systemctl enable --now oamc-turnier" zu starten.
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: oamc-turnier
|
||||
|
||||
Files: *
|
||||
Copyright: 2026 OAMC Reinheim e.V. im ADAC
|
||||
License: proprietary
|
||||
Interne Nutzung des OAMC Reinheim e.V. im ADAC. Weitergabe nur mit
|
||||
ausdruecklicher Zustimmung des Vereinsvorstands.
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
# /etc/oamc-turnier/oamc-turnier.env — nach der Installation ausfuellen!
|
||||
# Danach: systemctl enable --now oamc-turnier
|
||||
|
||||
# Pflicht:
|
||||
OAMC_DATABASE_URL=postgresql+psycopg://oamc:CHANGE_ME@localhost:5432/oamc
|
||||
OAMC_SECRET_KEY=CHANGE_ME_zufaellig_mind_32_zeichen
|
||||
|
||||
# Ingest-API-Keys (kommagetrennt), fuer die Excel-Auswertung:
|
||||
OAMC_INGEST_API_KEYS=CHANGE_ME_ingest_key
|
||||
|
||||
# Betrieb:
|
||||
OAMC_ENV=prod
|
||||
OAMC_PUBLIC_BASE_URL=https://mt.oamc.de
|
||||
OAMC_UPLOAD_DIR=/var/oamc/uploads
|
||||
|
||||
# Plausibilitaetsgrenzen Zeitmessung (Sekunden):
|
||||
OAMC_MESS_MIN_SEKUNDEN=15
|
||||
OAMC_MESS_MAX_SEKUNDEN=600
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
var/oamc/uploads
|
||||
etc/oamc-turnier
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
debian/env/oamc-turnier.env etc/oamc-turnier
|
||||
deploy/nginx/oamc-turnier.conf usr/share/doc/oamc-turnier/examples
|
||||
deploy/backup/pg_dump.sh usr/share/doc/oamc-turnier/examples
|
||||
docs/zeitmessung-endpoint.md usr/share/doc/oamc-turnier
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
[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
|
||||
# Migrationen vor dem Start (idempotent)
|
||||
ExecStartPre=/opt/oamc-turnier/venv/bin/alembic -c /opt/oamc-turnier/alembic.ini upgrade head
|
||||
ExecStart=/opt/oamc-turnier/venv/bin/uvicorn oamc.main:app \
|
||||
--host 127.0.0.1 --port 8000 --proxy-headers --forwarded-allow-ips '*'
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
# Haertung
|
||||
NoNewPrivileges=true
|
||||
ProtectSystem=strict
|
||||
ProtectHome=true
|
||||
PrivateTmp=true
|
||||
ReadWritePaths=/var/oamc
|
||||
StateDirectory=oamc-turnier
|
||||
RuntimeDirectory=oamc-turnier
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
# Systembenutzer fuer den Dienst
|
||||
if ! getent passwd oamc >/dev/null; then
|
||||
adduser --system --group --home /var/oamc --no-create-home \
|
||||
--gecos "OAMC Turnierauswertung" oamc
|
||||
fi
|
||||
mkdir -p /var/oamc/uploads
|
||||
chown -R oamc:oamc /var/oamc
|
||||
|
||||
# Konfig-Datei nur beim ersten Mal, mit engen Rechten
|
||||
if [ ! -e /etc/oamc-turnier/oamc-turnier.env ]; then
|
||||
echo "Hinweis: /etc/oamc-turnier/oamc-turnier.env anlegen (siehe Beispiel)."
|
||||
fi
|
||||
chown root:oamc /etc/oamc-turnier/oamc-turnier.env 2>/dev/null || true
|
||||
chmod 0640 /etc/oamc-turnier/oamc-turnier.env 2>/dev/null || true
|
||||
|
||||
echo "-----------------------------------------------------------------"
|
||||
echo " oamc-turnier installiert. Naechste Schritte:"
|
||||
echo " 1) PostgreSQL-DB + Rolle anlegen (siehe /usr/share/doc/oamc-turnier)"
|
||||
echo " 2) /etc/oamc-turnier/oamc-turnier.env ausfuellen"
|
||||
echo " 3) systemctl enable --now oamc-turnier"
|
||||
echo " 4) /opt/oamc-turnier/venv/bin/oamc-turnier seed # Stammdaten 2026"
|
||||
echo " 5) nginx: /usr/share/doc/oamc-turnier/examples/oamc-turnier.conf"
|
||||
echo "-----------------------------------------------------------------"
|
||||
;;
|
||||
esac
|
||||
|
||||
#DEBHELPER#
|
||||
exit 0
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
purge)
|
||||
rm -rf /opt/oamc-turnier/venv
|
||||
rm -rf /var/oamc/uploads
|
||||
# DB und /etc-Konfig bewusst NICHT loeschen (Datenverlust vermeiden)
|
||||
echo "Hinweis: Datenbank und /etc/oamc-turnier bleiben erhalten."
|
||||
;;
|
||||
esac
|
||||
|
||||
#DEBHELPER#
|
||||
exit 0
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/make -f
|
||||
# Baut ein in sich geschlossenes virtualenv unter /opt/oamc-turnier.
|
||||
# Bewusst ohne dh-virtualenv (nicht in Debian 13 main) — venv + pip von Hand.
|
||||
|
||||
export DH_VERBOSE = 1
|
||||
VENV = debian/oamc-turnier/opt/oamc-turnier/venv
|
||||
APPDIR = debian/oamc-turnier/opt/oamc-turnier
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
override_dh_auto_build:
|
||||
# nichts zu kompilieren
|
||||
|
||||
override_dh_auto_test:
|
||||
# Tests laufen in CI gegen eine echte DB, nicht im Paketbau
|
||||
|
||||
override_dh_auto_install:
|
||||
mkdir -p $(APPDIR)
|
||||
python3 -m venv $(VENV)
|
||||
$(VENV)/bin/pip install --no-cache-dir --upgrade pip
|
||||
$(VENV)/bin/pip install --no-cache-dir .
|
||||
# Migrationen + alembic.ini mitliefern (fuer "oamc-turnier migrate")
|
||||
cp -r migrations $(APPDIR)/migrations
|
||||
cp alembic.ini $(APPDIR)/alembic.ini
|
||||
# venv relozierbar halten: absolute Shebangs auf den Zielpfad umschreiben
|
||||
find $(VENV)/bin -type f -exec sed -i \
|
||||
"1s|^#!.*python.*|#!/opt/oamc-turnier/venv/bin/python3|" {} + || true
|
||||
# Wrapper in /usr/bin
|
||||
mkdir -p debian/oamc-turnier/usr/bin
|
||||
ln -sf /opt/oamc-turnier/venv/bin/oamc-turnier debian/oamc-turnier/usr/bin/oamc-turnier
|
||||
|
||||
override_dh_installsystemd:
|
||||
dh_installsystemd --no-start --no-enable
|
||||
|
||||
override_dh_fixperms:
|
||||
dh_fixperms
|
||||
chmod 0640 debian/oamc-turnier/etc/oamc-turnier/oamc-turnier.env || true
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
3.0 (native)
|
||||
Reference in New Issue
Block a user