coreapp new --sso: sign-in through the Core's Authelia

A template overlay (templates/sso) registers the app as an OpenID Connect
client in Authelia's idproviders.yml (between markers, secret hashed by
the running Authelia), checks the configuration before restarting
Authelia and restores it if the check fails; uninstall removes the client.
The app reaches Authelia's https address through traefik (@TRAEFIK_IP@,
provided by the template's install and by redeploys). The example is a
standard-library Python OIDC client (code flow with PKCE). Tested by
install, redeploy, remove and reinstall, and a real sign-in in a browser.

Also: the postgres overlay appends to the base install, uninstall and
env.in; database names get a coreapp_ prefix (PostgreSQL reserves pg_*);
deploy waits until the app answers on its own address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 12:34:27 -07:00
co-authored by Claude Opus 5.5
parent 74bdc13f0f
commit 284f52fc29
19 changed files with 419 additions and 37 deletions
+22 -2
View File
@@ -165,8 +165,28 @@ a redeploy and a reboot of the Core keep the data, remove drops the database
and user. `postgresql.<domain>` resolves to the PostgreSQL container on the
`core` network (Docker's DNS); outside it, it's the public IP.
- [ ] Next: sign-in through the Core's Authelia (OIDC), as Federated's apps
do with `configsso_<app>`
Sign-in (2026-12-03): `coreapp new --sso <name>`. Its `install` registers
the OIDC client `coreapp-<name>` in Authelia's `idproviders.yml` between
`### coreapp-<name> begin/end` markers (secret from `.env`, hashed with the
running Authelia's `authelia crypto hash generate pbkdf2`), checks the
result with `authelia validate-config`, restores the old file if that fails,
and restarts Authelia; `uninstall` removes the block. `installapp`'s
`apply_authelia_2fa_policy` then applies the Core's 2FA policy to it.
The app reaches `https://authelia.<domain>` through traefik
(`extra_hosts` to `@TRAEFIK_IP@`, which the template's `install` and
coreapp's redeploy both provide; Federated's apps use the public IP, which
here would loop out through the relay). The example is a standard-library
Python OIDC client (code flow with PKCE).
Tested with `sso-demo`: install, redeploy, remove and reinstall each leave
one (or no) client block, a valid config, and the other clients and
Nextcloud working; `/login` redirects to Authelia with PKCE.
A real sign-in to sso-demo with a Core account in a browser worked
(2026-12-03, tested by David).
- `bin/stop` and `bin/start` don't know apps outside Federated's lists, so
when a dependency (postgresql, authelia) is upgraded, coreapp apps keep
running instead of being stopped and restarted; they reconnect
- [ ] `--postgres` and `--sso` together (each has its own example app)
- [ ] Later: apps published for other Cores (registry, submitting to
Federated)