Apps get 192.168.5.0/24; keep a copy of each Authelia client

Addresses now come from 192.168.5.0/24, the range Federated's Core
developer set aside for custom apps. Apps installed in 192.168.200.x get
a new address on their next update.

Like Federated's apps, the sso need keeps a copy of its Authelia client in
/federated/apps/<name>/.<name>.oidc-client.yml, so Authelia's start
(reconcile_authelia_sso) restores it if Authelia is reinstalled. Removing
an app deletes the copy before restarting Authelia, which would otherwise
add the client back. Needs can have an update step, run on every update;
sso's writes the copy for apps installed before this.

Fixed: an update of an app with no needs failed at its end (a test that
found nothing to run set the exit status), leaving the app on its old
address.

PLAN.md: the Core developer's guidance and where coreapp-dev stands on
each point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 14:10:43 -07:00
co-authored by Claude Opus 5.5
parent fdb57d260d
commit 89585e81aa
9 changed files with 96 additions and 22 deletions
+45 -3
View File
@@ -152,7 +152,14 @@ What we learned:
`idproviders.yml` between `### coreapp-<name> begin/end` markers (secret
hashed with the running Authelia's `authelia crypto hash generate
pbkdf2`), checked with `authelia validate-config` before Authelia
restarts (the old file is put back if the check fails). `installapp`'s
restarts (the old file is put back if the check fails). Like Federated's
apps, it keeps a copy in `/federated/apps/<name>/.<name>.oidc-client.yml`
(mode 600): Authelia's start (`reconcile_authelia_sso`, also
`bin/reconcile-authelia-sso`) appends any client whose copy exists but
whose first line is missing from `idproviders.yml`. So uninstalling
deletes the copy before restarting Authelia, or the client would come
back. Tested 2026-12-03: a removed block is restored by reconcile; an
uninstalled app's client stays gone `installapp`'s
`apply_authelia_2fa_policy` applies the Core's 2FA policy to it. The app
reaches `https://authelia.<domain>` through traefik (`extra_hosts` to
traefik's address; Federated's apps use the public IP, which here would
@@ -197,8 +204,10 @@ Rules that follow from it:
files, so each is limited to safe characters
- Images are built outside the Core (CI in the developer's Gitea, pushed to
its container registry); the Core only pulls `image:version`
- Each Core picks the app's address itself (192.168.200.10-250, free on
that Core)
- Each Core picks the app's address itself: the first free one in
192.168.5.0/24, the range Federated's Core developer set aside for
custom apps (since 2026-12-03; apps installed in 192.168.200.x before
move on their next update)
- Apps live in `/federated/services/<name>/` with a `.coreapp` marker, so
Superpanel's catalog and the Core's `installapp`/`uninstallapp` see them.
That folder is Federated's git checkout; untracked folders survive
@@ -234,6 +243,8 @@ Steps:
Authelia, for admins only
Later:
- [ ] A failed update leaves the new `services/<name>/` in place with the
old container running; keep the old folder until the update works
- [ ] Uninstalling a need without removing the app (now refused)
- [ ] `bin/start` / `bin/stop` don't know coreapps' apps (see "Tell
Federated"); `restart: always` covers reboots
@@ -241,6 +252,37 @@ Later:
Superpanel for others
- [ ] Monitoring for published apps (dev apps aren't registered)
### Guidance from Federated's Core developer (2026-12-03)
Their points, and where coreapp-dev stands:
- Apps as `lib/<app>.sh` (config, start, uninstall, sso functions) for
`installapp`, `uninstallapp` and `installapp-sso`: not done. The
installer uses the generic `services/<app>/` format (`installGeneric`),
which `installapp` also supports. A `lib/<app>.sh` from an app's
repository would be root code from its author; the installer could
generate one from its own templates instead
- `services/<app>/service` for version, internal IP, container and image:
done
- MySQL apps use the `pdnsmysql` container (MariaDB, 192.168.0.10, also
PowerDNS's database), PostgreSQL apps `postgresql`: postgres is done;
[ ] a `mysql` need (its own user and database there)
- Authelia through `installapp-sso` / `configsso_<app>`: needs a
`lib/<app>.sh`, so not used; the sso need does the same, and keeps the
client copy Federated's apps keep
- Base directory `/federated/custom` (`custom/lib/<app>.sh`,
`custom/apps/<app>/`, `custom/services/<app>/service`): it doesn't exist
yet and no Core script knows it, so installapp, uninstallapp,
installapp-sso, start, stop, upgrade, the catalog and Superpanel (its
container mounts `/federated/apps` only) would need to learn it. Decided
2026-12-03 (David): go on with `/opt/coreapps` and today's paths, and tell
Federated what Superpanel needs later
- Internal IPs in 192.168.5.0/24: done
Superpanel lists our apps in its catalog (`catalog.json`) but not in its
installed-apps list (`applist.json`, made by
`superpanel-generate-applist-dashboard`), so they probably don't show on
its dashboard or in "Disk Usage by App". [ ] Find out why
### The installer in /federated/bin/coreapps/ (wanted, 2026-12-03)
David wants the installer on the Core in `/federated/bin/coreapps/`