Online documentation at /docs/ for authors and administrators: built into dist, nginx auth_request (check-docs), editor and admin links, Docker/server_update integration

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
denis
2026-10-17 16:17:19 +02:00
parent f79727f793
commit 815a533a4e
22 changed files with 208 additions and 13 deletions
+14
View File
@@ -52,6 +52,20 @@ cd /opt/PyQuest
The whole procedure (MariaDB database, starting the service, first administrator, publishing, backups, rollback,
troubleshooting) is in [Going live and operations](operations.md).
## Online documentation (`/docs/`)
The site publishes its own documentation under `https://your-domain/docs/` (French and English). It is **restricted to
signed-in accounts**: **authors** (editor permission) and **administrators** (`is_staff` accounts). Without a session,
nginx redirects to the sign-in page, which then returns to the documentation. Links are in the level editor
(**Documentation** button) and in the Django administration (top right).
- It is built with the site: `make build` (and `./scripts/server_update.sh`, or the Docker image) generate `dist/docs/`.
`./scripts/server_update.sh --no-docs` publishes without it.
- An administrator who is **not** an author signs in on `/api/admin/` first: the session is the same.
- The documentation holds no secret: to make it **public**, remove `auth_request` and `error_page` from the
`location ^~ /docs/` block in `nginx/pyquest-locations.conf.example`.
- Pages are never kept by the service worker (outside the application, always online).
## Testing locally before deploying
Three levels of testing, from the simplest to the most faithful to production:
+14
View File
@@ -53,6 +53,20 @@ cd /opt/PyQuest
Toute la marche à suivre (base MariaDB, démarrage du service, premier administrateur, publication, sauvegardes,
retour arrière, dépannage) est dans [Mise en service et exploitation](operations.md).
## La documentation en ligne (`/docs/`)
Le site publie sa propre documentation sous `https://ton-domaine/docs/` (français et anglais). Elle est **réservée aux
comptes connectés** : les **auteurs** (permission de l'éditeur) et les **administrateurs** (comptes `is_staff`). Sans
session, nginx renvoie vers la page de connexion, qui ramène ensuite sur la documentation. Les liens se trouvent dans
l'éditeur de niveaux (bouton **Documentation**) et dans l'administration Django (en haut à droite).
- Elle est construite avec le site : `make build` (et `./scripts/server_update.sh`, ou l'image Docker) génèrent
`dist/docs/`. `./scripts/server_update.sh --no-docs` publie sans elle.
- Un administrateur qui n'est **pas** auteur s'identifie d'abord sur `/api/admin/` : la session est la même.
- La documentation n'a rien de secret : pour la **rendre publique**, supprimer `auth_request` et `error_page` du bloc
`location ^~ /docs/` dans `nginx/pyquest-locations.conf.example`.
- Les pages ne sont jamais conservées par le service worker (hors de l'application, toujours en ligne).
## Tester en local avant de déployer
Trois niveaux d'essai, du plus simple au plus fidèle à la production :