From 4bf3dd96df9289dbadcb567382d8f02f4c195a79 Mon Sep 17 00:00:00 2001 From: vl Date: Sun, 20 Sep 2026 18:08:36 +0200 Subject: [PATCH] chore: align the auth variables with the Auth.js v5 convention Renames the OIDC settings to AUTH_URL, AUTH_SECRET and AUTH_AUTHENTIK_*, the names Auth.js v5 discovers on its own, which is also what the api_llm_loxi project already runs against this same Authentik instance. Matching it means one fewer thing to translate when comparing the two applications, and no glue code to read the variables manually. Also settles on a single public domain: the panel and the browser reach the application on the same origin, so APP_DOMAIN and AUTH_URL cannot disagree. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_012cSY9pVhZmJUKNN7wf1Myd --- .env.example | 38 +++++++++++++++++++++++--------------- .env.swp | Bin 0 -> 12288 bytes 2 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 .env.swp diff --git a/.env.example b/.env.example index 0c8dfc0..ace6a89 100644 --- a/.env.example +++ b/.env.example @@ -6,9 +6,10 @@ # ----------------------------------------------------------------------------- # Application # ----------------------------------------------------------------------------- -# Nom de domaine public de l'app sur le VPS. Sert à trois choses : -# le callback OIDC, l'URL d'image envoyée à l'écran, et les liens du README. -APP_DOMAIN=trmnl.loxi.ch +# Nom de domaine public de l'app sur le VPS. Un seul domaine sert à la fois +# l'écran et le navigateur : le callback OIDC, l'URL d'image envoyée au panneau +# et les liens du README en dépendent tous. Doit rester cohérent avec AUTH_URL. +APP_DOMAIN=horaires.loxi.ch # Port publié en local (dev). En production, Traefik s'en charge : aucun port publié. APP_PORT=3010 APP_BIND=127.0.0.1 @@ -28,19 +29,26 @@ TEST_DATABASE_URL= # ----------------------------------------------------------------------------- # Authentification — Authentik (OIDC, Authorization Code + PKCE) # ----------------------------------------------------------------------------- -# Doit correspondre EXACTEMENT à l'`issuer` du document de découverte : -# https://auth.loxi.ch/application/o//.well-known/openid-configuration -AUTHENTIK_ISSUER=https://auth.loxi.ch/application/o/CHANGEME/ -AUTHENTIK_CLIENT_ID= -AUTHENTIK_CLIENT_SECRET= -# Groupe Authentik dont les membres sont administrateurs. Les autres utilisateurs -# authentifiés sont en lecture seule (rôle `viewer`). -AUTHENTIK_ADMIN_GROUP=horaires-admins -# URL publique complète de l'app. L'URI de redirection à déclarer dans Authentik est -# /api/auth/callback/authentik -NEXTAUTH_URL=https://trmnl.loxi.ch +# Noms de variables imposés par Auth.js v5, identiques au projet api_llm_loxi : +# le provider est découvert automatiquement à partir d'AUTH_AUTHENTIK_*. +# +# URI de redirection à déclarer dans Authentik (correspondance stricte) : +# /api/auth/callback/authentik +AUTH_URL=https://horaires.loxi.ch # Générer avec : openssl rand -base64 33 -NEXTAUTH_SECRET= +AUTH_SECRET= + +AUTH_AUTHENTIK_ID= +AUTH_AUTHENTIK_SECRET= +# Doit correspondre EXACTEMENT à l'`issuer` du document de découverte, slash +# final compris : +# https://auth.loxi.ch/application/o//.well-known/openid-configuration +AUTH_AUTHENTIK_ISSUER=https://auth.loxi.ch/application/o/horaires-ita-ito/ +# Libellé du bouton sur la page de connexion. +AUTHENTIK_DISPLAY_NAME=Loxi +# Groupe Authentik dont les membres sont administrateurs. Tout autre utilisateur +# authentifié est en lecture seule (rôle `viewer`). +AUTHENTIK_ADMIN_GROUP=horaires-admins # ----------------------------------------------------------------------------- # Écran e-ink — API appareil (BYOS) diff --git a/.env.swp b/.env.swp new file mode 100644 index 0000000000000000000000000000000000000000..48d7bb2c1947c0b511434fb0221379c776bb172c GIT binary patch literal 12288 zcmeI2J#W)M7=W*Z4GIVrHr#e4Uk#-qk_B#kZ7uBBvYl4#VqKCWHg$cjeGWuIFtG6x z_yG(|u)+=-Gdl>0f5GdL651jaRSZ;m&w6zBz4!6@xm%*RTi-A&2p71r4Bq zQyZ8e&4ot296moct6aOk@q&+=O{rb3` zI#Q1xu|flA01co4G=K)s02)98XaEhM0W^RH&Y%I-C*<`-Lgr>5dHDbT;P?Nx%Y=Le zJ^~+rx4=sv1Ny*u;N2xc9KZ&afE&O$;494a1$Ym<0$u>SfCJb-xz;Rz1r4A9G=K)s z02)98XaEhM0W|P`8CbVXL)W&vKy!?sGa{(N1wFST40{Y8$qz#^P~wEOwu6smB_B z&#la-99iv!gy?j`SfPPSS6%9@2P>xSQ9bbJin_D_Sse-64sGuTZ%<;HY1*5?y6-#c z0~Y7}V2ojDYcyE3T}$)T?rsY2Pdz`-HD6oSJi4zd6}cQ_Jl~7K+4#Hfyw&H!ib zB@wd1Dmm|ET;6LeELH1pHCl^{x0=mg-2=&Uc{lHce3z+d(T$@XnOBTN@;X|H{6v?_Vzp3Oxks%)`11`&(C{x6vMCmgKvz%ASKTr2aruuT=*sibc zzY}q6&tHR$2prAxHf>i||L9`Uuj5fyJrFl()|V%Z#NSqFk->?qZ5LSto31&|&qbSc Z_~5sE(rrsK+HjtFEDm8$TIHD}KLFPd6k7lQ literal 0 HcmV?d00001