Authelia¶
Container : LXC 103 (authelia:9091)
URL : https://auth.ncls.ltd
Services protégés : voir SSO.
Configuration¶
Fichiers :
- Config :
/opt/docker/authelia/configuration.yml - Users :
/opt/docker/authelia/users_database.yml - DB :
/opt/docker/authelia/db.sqlite3
Utilisateur admin :
- Login :
admin - Email : nicolas.liautaud@gmail.com
- Groups :
admins,users
Modifier le mot de passe¶
# Générer hash bcrypt
pct exec 103 -- docker run --rm authelia/authelia:latest authelia hash-password 'NOUVEAU_PASSWORD'
# Éditer users_database.yml avec le nouveau hash
pct exec 103 -- nano /opt/docker/authelia/users_database.yml
# Redémarrer
pct exec 103 -- docker restart authelia
Forward Auth (Caddy)¶
Snippet réutilisable défini dans le Caddyfile global :
(authelia_sso) {
forward_auth authelia:9091 {
uri /api/authz/forward-auth
copy_headers Remote-User Remote-Groups Remote-Name Remote-Email
}
}
Inclus dans chaque vhost protégé avec import authelia_sso.
Ajouter une application¶
-
Ajouter le domaine dans
configuration.yml→access_control: -
Redémarrer Authelia :
-
Ajouter
import authelia_ssodans le vhost Caddy — voir Caddy.
Vérification¶
# Tester redirection SSO
curl -I https://portainer.ncls.ltd
# HTTP/2 302 → https://auth.ncls.ltd/...
# Logs
pct exec 103 -- docker logs authelia --tail 50
# Vérifier endpoint
pct exec 103 -- docker exec caddy wget -qO- http://authelia:9091/api/verify
# 401 (normal sans auth)
Troubleshooting¶
| Symptôme | Cause probable | Fix |
|---|---|---|
| 500 Internal Server Error | Endpoint /api/verify incorrect |
Vérifier snippet authelia.conf |
| 403 Forbidden | Domaine absent de access_control |
Ajouter domaine dans configuration.yml |
| 401 en boucle | Cookies session mal configurés | Vérifier domain: ncls.ltd dans config |
| 502 Bad Gateway | Backend inaccessible | Vérifier IP/port et proxy_ssl_verify off si HTTPS self-signed |