App Flask complète pour https://dynamic.alpinux.org : - 10 quiz Linux, 5 niveaux (Découverte → Expert), 50+ questions - Public : Découverte, Débutant, Intermédiaire (6 quiz) - Membres AlpID : Avancé, Expert (4 quiz — Git, Admin, Sécurité, Bash) - Navigation question par question avec avance automatique après choix - Score calculé côté serveur, enregistré en SQLite si connecté - Page profil : meilleurs scores par quiz + historique des tentatives Authentification : - OIDC via authlib + AlpID (Keycloak), SSO partagé avec Gitea/Nextcloud - Décorateur @login_required, redirection post-login sur l'URL d'origine - /auth/login, /auth/callback, /auth/logout Structure : - dynamic/app.py, db.py, quiz.py, auth_utils.py - dynamic/routes/ (public.py, auth.py, protected.py) - dynamic/templates/ (base, index, quiz/*, profil/) - dynamic/static/ (style.css thème Alpinux, quiz.js vanilla) - dynamic/data/quizzes.json (source de vérité des questions) - dynamic/.env.example Infrastructure : - scripts/dynamic.alpinux.org.vhost.conf (Apache reverse proxy) - scripts/dynamic.alpinux.org.service (systemd Gunicorn) - docs/technique/deploiement-dynamic.md (procédure complète) - mkdocs.yml : page de déploiement ajoutée à la nav Technique - .gitignore : exclut venv/ et .env Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
33 lines
1.5 KiB
Text
33 lines
1.5 KiB
Text
# Apache vhost pour dynamic.alpinux.org
|
|
# L'app Flask tourne derrière Gunicorn sur 127.0.0.1:5001
|
|
|
|
<VirtualHost *:80>
|
|
ServerName dynamic.alpinux.org
|
|
Redirect permanent / https://dynamic.alpinux.org/
|
|
</VirtualHost>
|
|
|
|
<VirtualHost *:443>
|
|
ServerName dynamic.alpinux.org
|
|
|
|
# ── Proxy vers Gunicorn ──────────────────────────────────────
|
|
ProxyPreserveHost On
|
|
ProxyPass / http://127.0.0.1:5001/
|
|
ProxyPassReverse / http://127.0.0.1:5001/
|
|
|
|
# En-têtes transmis à Flask
|
|
RequestHeader set X-Forwarded-Proto "https"
|
|
RequestHeader set X-Forwarded-For "%{REMOTE_ADDR}s"
|
|
|
|
# ── Sécurité ─────────────────────────────────────────────────
|
|
Header always set X-Content-Type-Options "nosniff"
|
|
Header always set X-Frame-Options "SAMEORIGIN"
|
|
Header always set Referrer-Policy "strict-origin-when-cross-origin"
|
|
|
|
# ── Logs ─────────────────────────────────────────────────────
|
|
ErrorLog /var/log/apache2/dynamic.alpinux.org-error.log
|
|
CustomLog /var/log/apache2/dynamic.alpinux.org-access.log combined
|
|
|
|
SSLEngine on
|
|
SSLCertificateFile /etc/letsencrypt/live/dynamic.alpinux.org/fullchain.pem
|
|
SSLCertificateKeyFile /etc/letsencrypt/live/dynamic.alpinux.org/privkey.pem
|
|
</VirtualHost>
|