Deploy now waits while an image's own HEALTHCHECK says "starting" and stops on "unhealthy" with the check and its result, since traefik doesn't route unhealthy containers (it used to say "Updated"); an update rolls back, a first install says it stays installed, and a rollback waits until the old version is routed again. coreapp signin follows a page's one "Core SSO" or "Authelia" link, prints the app's visible error when it doesn't end signed in, and has --help. The skill covers 127.0.0.1 among trusted proxies, the image's HEALTHCHECK, COPY --chmod, $TMPDIR outside the sandbox, patching an app's OIDC code for userinfo claims, and testing a new account's first sign-in. PLAN: ID-token claims for Federated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
52 KiB
Plan
coreapp-dev is a software development kit for building apps that run as
Docker containers on Federated Core. It is a CoreDesktop sibling project:
people install it with sibling add <url>, and CoreDesktop's update keeps
it current (format: ~/Projects/coredesktop/skills/sibling-project-format.md).
Delete an item once it's done; git history keeps the record.
Now: a working Core in a local VM
What we know about the CoreServer image (2026-12-02): it's Arch Linux, boots
with BIOS or UEFI, and needs a display device (it stalls at "Loading initial
ramdisk" with --graphics none). All passwords are locked; cloud-init
(NoCloud) installs root's SSH keys. / is a fixed 10 GiB btrfs partition;
the extra disk space goes to /federated, which the image's own
grow-federated.service grows on first boot.
The Core dev.fedcom.net was provisioned on 2026-12-03 in the VM
(10.123.0.10). It's reachable from the internet at 77.216.180.150
through corerelay, which also carries its outbound traffic.
What we learned provisioning (2026-12-02/03):
-
Federated Core finds its public IP with
dig @resolver4.opendns.com myip.opendns.comand publishes it in DNS, so the Core's outbound traffic must leave through the relay (first attempt published the home IP) -
The Core is the authoritative DNS server for its domain (ns1/ns2. point at
ip), so 53 tcp/udp must be forwarded, plus 25 143 465 587 993 4190 9980 besides 22 80 443 -
The domain is picked round-robin (dev.federatedcomputer.cloud, dev.federatedcomputer.net, dev.fedcom.net, ...)
-
The progress stream from core-create is server-sent events; it takes 5+ minutes, a full install about 40
-
Deleting a Core makes the platform SSH into its IP and tear it down, so never put a new VM behind an IP whose old Core still exists. A failed Core has no delete button; Federated has to remove it
-
The Core's containers use 192.168.0.0/16 and send replies for any 192.168.x.x address onto their own bridge, so the VM network is 10.123.0.0/24 (moved there on 2026-12-03 from 192.168.123.0/24)
-
libvirt's DHCP
<host>reservations are ignored on this workstation: libvirt writes the hosts file readable by root only and dnsmasq reads it asnobody. The reservation is adnsmasq:optionin the network instead -
Before core-create on a fresh VM:
systemctl is-active docker, opendns sees the VPS IP, and the hairpin (/dev/tcp/<vps-ip>/22from the VM) -
The Core shows as Active in the dashboard
-
Tell Federated (2026-12-03): -
upgrade's snapshot before each app update mounts/dev/sda4(alsobin/btrfs-snapshot). In coreapp-dev's VM the disk is virtio,/dev/vda4, so the mount fails and it sends a Matrix alert to Federated's room for every app it updates. Finding the device withfindmnt -no SOURCE /federatedwould work on both. (Or the VM's disk could be SCSI, so it's/dev/sdaas on their servers.) -lib/functions.shhas the Matrix alerts' access token in it, so every Core (and anyone who can read the Core repo) has it - Apps send mail asfcore(aninetOrgPersonin theadminsgroup) with the Core's admin password (MAIL_PASSWORD=$ADMINPASSin e.g.lib/bookstack.sh), so every app holds the admin password. The mail server also has noSPOOF_PROTECTION, so any account can send as any address. coreapps gives each app its own sending-only account instead (see Coreapps, step 4) - Authelia'sgroupsclaim isnull(not even[], which breaks apps that expect a list: Miniflux refuses every sign-in with group mapping on), and the ID token carries no email or name (only userinfo has them). The groups: its LDAP settings look for(member={dn})with names fromgidNumber, but the Core's groups (admins,everybody) aregroupOfUniqueNameswithuniqueMember.groups_filter: (uniqueMember={dn})andgroup_name: cnwould give appsadmins/everybody(checked 2026-12-03 on dev.fedcom.net's LDAP; not changed there) - Authelia 4.39 putsemail,nameandpreferred_usernameonly in userinfo. Apps that read the person only from the ID token (Leantime) fail every sign-in without a patch. A claims policy inidproviders.yml(identity_providers.oidc.claims_policieswithid_token: [email, email_verified, name, preferred_username, groups]), named by each client'sclaims_policy, would fix it for all apps. coreapps doesn't add it: it would edit Federated's part of the file, and a client naming a policy that's gone stops Authelia - On this image, disabling systemd-resolved isn't enough: networkd'ssystemd-networkd-resolve-hook.socketstarts it at boot, it takes port 53 and pdns can't start after a reboot. coreapp-dev masks it through cloud-init; the installer should mask it too - Every Core timer (upgrade-federated, free-up-space, backuptool, dumpcerts, fix-nextcloud, nextcloud-maintenance) hasRequires=<its service>in[Unit], so its job also runs at every boot, about 5 s in, not just on its schedule. Evidence (2026-12-03): boots at 18:01:20 and 18:14:08 UTC; all four checked jobs started at 18:01:25 and 18:14:13. Consequences: - upgrade-federated runs before the network is online (it has noAfter=network-online.target):git pullfails with "Could not resolve host: gitea.federated.computer", thensend_alert_upgradeemails ALERTS_EMAIL ("upgrade failed to run on - couldn't pull from git") and posts a Matrix alert, and it exits 2 (/federated/logs/upgrade.log). So every reboot sends a false alert - free-up-space runsdocker system prune -fanddocker image prune -a --filter until=24hwhile containers are still starting: at 18:01:25 it deleted the pdns container that had failed to start (port 53) and its image (/federated/logs/freeupspace.log). Any app container that is stopped at boot time goes the same way -/federated/bin/upgradehas an API token in it, readable by anyone with the image;lib/functions.shhas the monitoring registrar's bearer token, anduninstallapp'sset -xprints it -bin/startdoesn't know apps outside its fixed lists, so a new app in the generic format isn't started byinstallapp
Next: the SDK (build, deploy and test an app on the Core)
How the Core runs apps (studied 2026-12-03 on dev.fedcom.net)
/federatedis a git checkout of Federated'sCorerepo, updated by/federated/bin/upgrade(git pull). Untracked folders survive pulls.- Installed apps live in
/federated/apps/<app>/:docker-compose.yml,.env(mode 600), secrets in files, data underdata/. - Every container is on the external Docker network
core(192.168.0.0/16) with a fixedipv4_address. Federated's apps use 192.168.0.7 to .121. - traefik (
providers.docker,exposedByDefault=false) routes by labels:traefik.enable=true,routers.<app>.rule=Host(.),entrypoints=websecure,tls.certresolver=letsencrypt(DNS challenge through the Core's own pdns, so any hostname gets a certificate), andservices.<app>.loadbalancer.server.portwhen the port isn't 80. - DNS: the zone has
*.<domain>CNAMEwww.<domain>(the public IP), so every app hostname already resolves. Some apps also add their own A record. /federated/bin/installapp [-n] <app>installs an app from eitherlib/<app>.shwithconfig_<app>,start_<app>,uninstall_<app>and optionallyconfigsso_<app>(Authelia OIDC) andemail_<app>; or- the newer generic format,
services/<app>/:service:NAME,DESCRIPTION,DOCS,CONTAINER,VERSION,INTERNAL_IP,DEPENDS,PORTS,MONITOR="https://<app>.@DOMAIN@|http_2xx"docker-compose.yml.inandenv.in: templates.@DOMAIN@and other variables from/etc/federated;@IMAGE_VERSION@;@NAME:RANDOM:LLLL...@makes a random value (L = letter or digit)icon.pnginstall:. /federated/lib/helpers.shandinstallGeneric <app>(fills in the templates into/federated/apps/<app>/); installapp then runs/federated/bin/start <app>- optional
uninstall,timers/,services/(systemd units)
- installapp installs
DEPENDSfirst;uninstallapp <app>reverses it. - superpanel's catalog lists
services/*/service, so an app installed this way shows up in the Core's dashboard.
Design
An app is a folder (its own git repo) on the workstation; coreapp, run
inside it, works against the Core in the local VM (coreapp-vm ip): new,
deploy (build, docker save | ssh docker load, install or update),
check, status, logs, shell, list, remove. Since 2026-12-03 the
folder has only coreapp.toml, the Dockerfile, the code and an icon; the
Core side is made by the installer (see Coreapps below).
Built 2026-12-03 and tested against dev.fedcom.net: plain apps, a
database (--postgres), sign-in (--sso), both. David signed in to
sso-demo and team-visits in a browser.
What we learned:
/federated/bin/start <app>only starts apps in the fixedCORE_APPS/EXTRA_APPSlists inlib/functions.sh; for anything else it prints its usage. Soinstallappinstalls a new app but doesn't start it, andstart allskips it. The installer starts it with the samedocker compose ... up -d;restart: alwayscovers reboots.bin/stopdoesn't know them either, so when a dependency (postgresql, authelia) is upgraded, coreapps' apps keep running; they reconnectinstallapp/uninstallappcallupdate_monitors, which registers or removes the app'sMONITORURL with Federated's external monitoring (blackboxregistrar.monitoreast.fedcom.net). Decided 2026-12-03: apps in development aren't registered, so the installer writes noMONITORinstallappanduninstallapprun withset -x; the trace includes the monitoring registrar's bearer token (in plain text inlib/functions.sh), the Core's email addresses and the app's secrets. The installer keeps their output in/federated/logs/coreapps/(mode 600)uninstallapponly stops a generic app if it has anuninstallscript (sourced, so noexit)uninstallappmakes Superpanel's catalog before the services folder is deleted, so the installer makes it again afterwards- Databases: the app's own user and database (
coreapp_<name>, because PostgreSQL reservespg_*and Federated's apps have their own names) on the Core's PostgreSQL, made withdocker exec postgresql psql -U postgresas Federated's installers do.postgresql.<domain>resolves to the container on thecorenetwork (Docker's DNS); outside it, it's the public IP - Sign-in: the OIDC client
coreapp-<name>goes in Authelia'sidproviders.ymlbetween### coreapp-<name> begin/endmarkers (secret hashed with the running Authelia'sauthelia crypto hash generate pbkdf2), checked withauthelia validate-configbefore Authelia 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, alsobin/reconcile-authelia-sso) appends any client whose copy exists but whose first line is missing fromidproviders.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 goneinstallapp'sapply_authelia_2fa_policyapplies the Core's 2FA policy to it. The app reacheshttps://authelia.<domain>through traefik (extra_hoststo traefik's address; Federated's apps use the public IP, which here would loop out through the relay) /datais a bind mount Docker creates as root, so an app running as another user couldn't write there. The installer gives it to the image's user (Config.User, resolved withidin the image if it's a name)- Image names must include the registry:
coreapp/xmeans Docker Hub, so a Core that had to pull it (after its boot-time prune, say) would get whatever is published there. Dev images arelocalhost/coreapp/<name>, which can't be pulled
How Federated adds an app to every Core
From the Core repo's history, e.g. immich:
- The Core repo (
gitea.federated.computer/Federated_Computer/Core) getsservices/<app>/in the generic format, withCONTAINERa public image (most are on Docker Hub; Federated's own underfederatedcomputer/) and anINTERNAL_IPin 192.168.0.x not used by another app lib/functions.sh: the app goes intoEXTRA_APPS, orbin/startandstart allwon't start itservices/superpanel/tiers.json: the tiers (good, better, best) that include it- Work happens on branches with pull requests into
master; Cores run thereleasebranch, whichupgradepulls nightly
Coreapps: apps from the developer's own repository
Decided 2026-12-03 (David): a developer publishes an app to their own Gitea
repository. A Core's owner installs it in Superpanel, in a new Coreapps
screen (Superpanel doesn't have one yet), by giving the repository's URL.
A Claude Code skill helps developers make apps that use the Core's
services: Traefik, Authelia, PowerDNS (<app>.<domain>), email and the AI
features.
Rules that follow from it:
- An app from any URL must not run code as root on the Core. So the app's
repository has no
installscripts or compose file: onlycoreapp.toml, an image and an icon. The installer (core/coreapps, trusted, written by us or Federated) checks the manifest and makes everything else from its own templates. Values from the manifest go into shell-sourced and YAML 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: 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.coreappmarker, so Superpanel's catalog and the Core'sinstallapp/uninstallappsee them. That folder is Federated's git checkout; untracked folders survivegit pull, but agit cleanwould delete them. Ask Federated
Steps:
-
Done 2026-12-03:
coreapp.tomland the installer.coreapp deployputs the installer in/opt/coreappson the Core and runscoreapps install. Tested on dev.fedcom.net: new apps with no needs, postgres, and postgres + sso (trial-app); updates (a new version, adding a need, the three apps deployed before coreapp.toml); refusals (Federated's app names, the Core's hostnames, dropping a need, bad manifest values); remove (database, Authelia client, image and catalog entry gone)- David: sign in to
https://trial-app.dev.fedcom.net/in a browser
- David: sign in to
-
Publishing (2026-12-03):
coreapp publishbuilds the image, pushesimage:versionto the registry incoreapp.toml, never replacing a published version, and tags the commitv<version>; new apps also get.gitea/workflows/publish.yml, which does the same on av*tag. Federated's Gitea is 1.27.2 with its container registry on the same host; the Core's owngitearunnerregisters with the Core's Gitea only, so whether developers on gitea.federated.computer have a runner that can use Docker is unknown. Tested against a local registry.docker manifest inspectreported "no such manifest" for an image that existed, so the check usesdocker buildx imagetools inspect, and any error but "not found" stops the publish- Tested 2026-12-03 by David:
coreapp publishofgitea.federated.computer/david/pub-test:0.1.0worked (package and tagv0.1.0in Gitea). The accountdavidisn't visible anonymously (its profile, repository and API answer 404 without a login), so its packages probably can't be pulled without one either: see "Private repositories and packages" under step 3 - Run the workflow on a repository with a runner
- Tested 2026-12-03 by David:
-
Install from a repository (2026-12-03):
coreapps plan|install <https://host/owner/repo>[@tag]andcoreapps update <name>; on the workstationcoreapp install <url>(shows the app, its source and needs, asks) andcoreapp update <name>. The installer fetches only the tag's commit (depth 1, no blobs butcoreapp.tomlandicon.png, which must be regular files; a link is ignored), with git limited to https, no password prompts and no system or root git settings. The default tag is the newest numeric release (v1.2.3, compared as numbers);versionmust match the tag; the image is always pulled for a repository install (never a same-named image built on the Core). The marker recordssource,tagandcommit; installing the same name from another repository is refused. Tested on dev.fedcom.net with a stand-in repository (file://, the https rule relaxed for the test) and nginx 1.27/1.28 as the image: plan, install, update, "already newest", the other-repository refusal, remove; and, on the workstation, tag selection, the version check, the link icon and URL checks. Found and fixed: docker listsdocker.io/library/nginxasnginx, so old images weren't deleted;removeforce-deleted images, which could untag one another app uses- End to end with a real repository and registry: done with David's private pub-test (below)
- Private repositories and packages (2026-12-03; Coreapps are "private"
apps, so their repositories usually are):
coreapps login <host> <user>(token on stdin),logout,logins; on the workstationcoreapp login <host>asks for user and token. Tokens by host in/etc/coreapps/credentials(dir 700, file 600, outside/opt/coreapps, which deploys replace). git gets the token as anhttp.<url>.extraHeaderin its environment, for that host only (never in a URL or an error); docker gets it in a config made for each pull, so no docker login stays on the Core.loginchecks the token with the host's registry (/v2/, then its token endpoint) and saves nothing if it's rejected. Tested 2026-12-03: a wrong token for gitea.federated.computer is rejected, file modes, logout, bad input, and David's private repository and image without a token both stop with "coreapp login" hints. Found: David's packages can't be pulled without a login (unauthorized: reqPackageAccess)- Tested 2026-12-03 by David:
coreapp login gitea.federated.computerwith a read-only token, thencoreapp install https://gitea.federated.computer/david/pub-testfrom the private repository and package: installed athttps://pub-test.dev.fedcom.net/(HTTP 200),listshows the source@v0.1.0, no docker login left on the Core - Done 2026-12-03: tokens per host+owner.
coreapp login <host>/<owner>keeps a token for that owner's apps, used before the host's (repository: its first path segment; image: the one after the registry); git's header is scoped tohttps://<host>/<owner>/. Tested on dev.fedcom.net with David's pub-test: a wrong owner token is used first and fails with a hint naming it, another owner's leaves the host's in use, logout, and a re-install pulled the image with the host's token - Superpanel would manage these tokens
- Tested 2026-12-03 by David:
- Done 2026-12-03: downgrades and digests. Installing an older release
than the installed one is refused unless
--downgrade(coreapps install/plan, coreapp install; the plan says what it goes back from); a failed start still rolls back. After pulling a release, coreapps records its registry digest in the marker and.env(IMAGE_DIGEST=@sha256:..., written by coreapps, nottemplatize, which reads any@...@on a line as a variable), and the compose file runsimage:${IMAGE_VERSION}${IMAGE_DIGEST:-}, so a re-pushed tag can't change an installed app, even on a recreate; installing the same release again with another digest is refused and the tag is put back on the installed image. Folder deploys have it empty. Tested on dev.fedcom.net with a registry on the Core and afile://repository (install, refusal,--downgrade, upgrade, re-pushed tag refused, recreate), with pub-test from gitea.federated.computer (pinned), and hello (empty)
-
Email (2026-12-03):
needs = ["email"](coreapp new --email) gives the app its own mail account for sending: an LDAP entryuid=coreapp-<name>,ou=peoplewithobjectClass: account,simpleSecurityObject,PostfixBookMailAccount,mail: coreapp-<name>@<domain>,mailEnabled: FALSE(no mailbox),description: coreapps: <name>(whose it is), password from.envset withldappasswd(hashed by the server). Not a person, so Authelia (objectClass=person), Nextcloud (inetOrgPerson) and Superpanel don't see it; Federated's sharedfcoreaccount is aninetOrgPersoninadmins, hidden only by Superpanel'sHIDDEN_USERS, and apps get the admin password with it. Its own address so a person's mail login (by mail or uid) never finds two entries.SMTP_*settings: mail., 587, STARTTLS, user, password,SMTP_FROM=<name>@<domain>. Setup leaves an entry that isn't the app's alone and the installer warns. Tested on dev.fedcom.net: login from the core network with a valid certificate, sender and a local recipient accepted (nothing sent), wrong password refused (535), password stored{SSHA}, Authelia sign-in refused (401), not in Nextcloud or Superpanel users, teardown, a foreign entry left alone (with a warning), email added to an existing app on update- Send a real message, to an address outside the Core (through the relay)
- Spoofing: the mail server has no
SPOOF_PROTECTION, so any authenticated account (Federated's apps'fcoretoo) can send as any address. Tell Federated; with it on, an app could only send as its account's address - MySQL (2026-12-03):
needs = ["mysql"](coreapp new --mysql): a user and databasecoreapp_<name>(utf8mb4) onpdnsmysql(MariaDB 12.1, shared with PowerDNS), as Federated's apps do (e.g.lib/bookstack.sh); sameDB_*names as postgres, so an app has one or the other. Root's password is read inside the container ($MYSQL_ROOT_PASSWORD), not by the script, so it isn't in theset -xlog (Federated'sfunctions.shlogs it anyway asMYSQL_ROOTPASSWORD=, for every install: see "Logs"). Tested on dev.fedcom.net: both needs refused, install, a table made and read from the core network, no access topowerdns, wrong password refused, remove drops the user and database, reinstall - AI needs (findings below; needs Federated), then other services: PowerDNS records beyond the wildcard, if an app needs other hostnames
-
The skill (moved ahead of 2-4, 2026-12-03):
skills/coreapp/SKILL.md, linked into~/.claude/skills/coreappbyupdate.sh, so any Claude Code agent on this computer can use it. Rehearsed with a small app (memo-board)- Rehearsed again 2026-12-03 with Vikunja (postgres, sso, email), by an
agent given only the skill. It worked, but Vikunja's sign-in couldn't
use the fixed Authelia client (its browser code sends people back to
/auth/openid/<provider>, and its server doesn't send PKCE: checked in its v2.8.0 source), so the agent wrote a 450-line OpenID bridge into the container. Fixed in coreapps instead:[sso]incoreapp.toml(callback,pkce,token_auth) shapes the app's client; changing it registers the client again on deploy (Authelia restarts only then), and a rollback puts the old one back (needs' update steps run after the old files are restored). Stock Vikunja with[sso] callback = "/auth/openid/core",pkce = falseand a busybox entrypoint replaced the bridge. Also from it: the skill covers images without a shell (copy in a static busybox), upstreamENVdefaults, when Authelia checks PKCE, and says not to build bridges;coreapp shellexplains a missingsh;coreapp statushides the empty address before install; the example apps' README no longer mentionswww/- Done 2026-12-03: David signed in to
https://vikunja.dev.fedcom.net/with his Core account in a browser; it all works - Instead of a "test locally" recipe (the agent ran the image off the
Core with a stand-in Authelia, the only way it could test sign-in):
coreapp signin(2026-12-03, David chose it) signs in on the real Core, as a browser would (lib/signin.py: redirects with a cookie jar, Authelia 4.39's/api/firstfactorwith itsflow_id), as a test personuid=coreapp.test,ou=people(inetOrgPerson, so Superpanel's user list shows it; uid with a dot, so never an app'scoreapp-<name>mail account), made bycoreapps test-accountwith a new random password on stdin each run, kept nowhere. The Core's Authelia isone_factorwith implicit consent, so no second factor or consent step.--codeis for apps that start sign-in in the browser: it starts at Authelia with the app's client and prints the callback with the code. Tested on dev.fedcom.net: sso-demo signed in, its page shows coreapp.test; stock Vikunja signed in through its own API with a--codecode (a token, usercoreapp.test@<domain>); a wrong callback shows Authelia's hint- Hide the test account from Superpanel's users (HIDDEN_USERS, as
fcore), if it bothers anyone; it only exists on dev Cores
- Hide the test account from Superpanel's users (HIDDEN_USERS, as
- Done 2026-12-03: David signed in to
- Tested 2026-12-03 with David's candidate app, Supermarket (Go; its
server edition already had Postgres, mail, users and Core sign-in), by
an agent given only the skill, in a clone (commit 24338c7 there, not
in David's repository). Deployed at
https://supermarket.dev.fedcom.net/with postgres, sso ([sso] callback = "/auth/core/callback",token_auth = "client_secret_post") and email;coreapp check,coreapp signin, data kept by--recreate. Fixed from its findings:coreapp signinpresses a sign-in page's button (a POST form with only hidden fields, such as a CSRF token;--form <action>picks one), so the agent's extra GET route isn't needed;CORE_DOMAINin every app's.env(the Core's domain, set only on a Core; updates add it); the skill now says: apps that also run elsewhere choose Core behaviour onCORE_DOMAINwithout changing the Dockerfile for everyone; no build args (readIMAGE_VERSION);APP_SECRETisn't key bytes (hash it) and lives only in.env;groupsis empty today (see "Tell Federated"); the first admin comes from a setup link in the log, not whoever signs in first; apps with their own client-setup step takeOIDC_*instead; icons under 80 pixels get a note- Decided 2026-12-03 (David): on a Core, the Core's admin account
admin@<domain>(uidadmin, the one member ofadmins; Federated's own apps make it their admin too) is always an admin of the app, trusted only from the Core's sign-in. Every app's.envhasCORE_ADMIN_EMAIL; the skill says so instead of a setup link, and the sso example shows it. Supermarket (setup link) should change to it- David: sign in to a
coreapp new --ssoapp as admin in a browser ("the app's admin")
- David: sign in to a
- Run again 2026-12-03 with the updated skill, from a fresh clone (run
1's Supermarket removed from the Core; commit a7777e6 in the new
clone). It followed the new guidance unprompted:
CORE_DOMAINfor Core behaviour,CORE_ADMIN_EMAILmade owner at startup and on each Core sign-in,coreapp signin /signinpressing the button. It found what run 1 missed: Supermarket needs PostgreSQL 18 (LIKEwith its case-insensitive ICU collation) and the Core's is 17.6, so run 1's app would have failed on its first search; run 2 used the app's SQLite in/data. Fixed: the skill gives PostgreSQL's version and says to check the app's before choosing, with a newer server under "Not available yet" (SQLite in/datawhere the app has it);coreapp statusshows the Core's PostgreSQL/MariaDB version; deploy's health check sends the app'sHost(an app refusing unknown hosts passed on a 421 before); a same-version deploy says "(0.1.0 again, in a new container)"; the skill covers making the owner at startup, building differently shaped settings in the app's config loader, and checking mail (no inbox: logs, and the user)- Decided 2026-12-03 (David): ordinary Core accounts sign in without an invitation and get the app's lowest role; admins raise them in the app. In the skill
- Done 2026-12-03: "What the Core offers" in the skill (services,
versions, which PostgreSQL extensions an app can enable: the
trusted ones; pgvector needs a superuser), and
coreapp coreprints it live from the Core - Run 3, 2026-12-03 (after the table): deployed with SQLite in
/data(told by the skill this time), sso and email; the Core's admin is owner; other Core accounts join with nothing. Fixed from it: the skill's two settings rules no longer contradict (upstreamENVin an entrypoint: override; the app's own code: Core values as defaults); deploy waits until traefik routes the public address (it answered 404 for a moment after "Updated");coreapp mailshows what the Core's mail server did with the app's mail (from the mail log: accepted, delivered/deferred/bounced); the skill says the lowest role means read-only, not nothing; the Core's admin has no local password or reset; an app's SQLite mode may need allowing in its multi-user edition;coreapp statusshows a database version only for apps with one; signin runs in the app's folder; deploy's last line no longer says "from the internet"- Done 2026-12-03: the test account has a mailbox, and
coreapp inbox [--clear]reads it (coreapps test-inbox: the maildir on the Core, newest 10, text or HTML as text with links). The Core's mail server delivers tomailEnabled: TRUEentries and its Dovecot needshomeDirectory; people have it fromposixAccount, which needs auidNumber, so the test account gets it fromextensibleObjectinstead and never takes a number Superpanel would give a person. Older entries get it on the next use. Tested with Supermarket's password reset (sent through its account, read with its link) and an HTML message
- Done 2026-12-03: the test account has a mailbox, and
- Skill shortened 2026-12-03 (577 -> ~450 lines): sign-in details in
references/sign-in.md, publishing inreferences/publishing.md, read when SKILL.md says. Rehearsed with Miniflux (upstream image, postgres, sso; a new agent, an empty repository): deployed, signed in, data kept, and it used the reference file. Fixed from it:coreapp signincalled a quiet callback failure "Signed in" (the app sent the browser back to its sign-in page); it now says "Not signed in ... offers sign-in again". Every app's.envhasCORE_PROXY(traefik's address, to trust forX-Forwarded-*). The skill:groupsisnull(don't turn on group mapping), claims only in userinfo,preferred_usernameis the email; apps that can make admins only from groups can't follow the admin rule yet (Miniflux: no admin until groups work); wait in the entrypoint for Authelia's discovery and the database; chain to the upstream image's entrypoint; secure-cookie settings; a regular user is the lowest role where people have only private things; the cookie jar in one command- David: Miniflux runs without an admin until the Core's
groups work (then map
admins)
- David: Miniflux runs without an admin until the Core's
groups work (then map
- Rehearsed 2026-12-03 with listmonk (upstream image; postgres, sso,
email; a new agent with only the skill): deployed as
listmonk-appathttps://listmonk-app.dev.fedcom.net/, signed in (the test account a read-only Viewer), the admin rule kept by a trigger, a double opt-in confirmation read withcoreapp inboxand confirmed, data kept by--recreate. Usedmin_version(12). Fixed from it: the name refusal said "already has an app called 'listmonk'" for Federated's uninstalled listmonk; it now says it's Federated's app's name, andcoreapp corelists the names apps can't use. The porting checklist moved toreferences/porting.md(SKILL.md 500 -> ~430 lines), with: settings an app keeps in its database (write the Core's at every start), upstream entrypoints that assume root (PUID/PGID), andmin_versionfrom the app's documented minimum. sign-in.md: the admin rule in an upstream image (a setting, else CLI/API at startup, else a trigger on the admin's row only), and--formisn't needed beside a password form - Decided 2026-12-04 (David): apps call the Core's sign-in "Core SSO" or "Authelia" (provider name, button text: "Sign in with Core SSO"). In the skill, sign-in.md, porting.md and the sso examples
- Rehearsed 2026-12-04 with Leantime (upstream PHP image; postgres,
sso, email; it chose PostgreSQL over MySQL, as the skill says, so
mysqlis still unrehearsed): deployed athttps://leantime.dev.fedcom.net/, signed in (the test account read-only), admin rule by a trigger on the admin's row, a password reset read withcoreapp inbox, data kept by--recreate. Two patches to Leantime: claims from userinfo (it reads only the ID token) and no sample project for read-only newcomers (its first page was a 403). Fixed from it: deploy waited 30 s and said "Updated" when the image's own HEALTHCHECK failed (Leantime refused 127.0.0.1 after trusted proxies were set) and traefik didn't route it; it now waits while Docker says "starting", stops on "unhealthy" with the check and its last result (an update rolls back; a first install says it stays installed), and a rollback waits until the old version is routed again.coreapp signinfollows a page's one "Core SSO"/"Authelia" link like a button, prints the app's visible error when it doesn't end signed in, and has--help. Skill: 127.0.0.1 among trusted proxies, the image's HEALTHCHECK,COPY --chmod,$TMPDIRoutside the sandbox,coreapp shell's user, patching an app's OIDC code for userinfo claims, testing a new account's first sign-in- David: sign in to leantime as admin@dev.fedcom.net (owner; a project, a task, an upload); remove it when done
- A MySQL-only app, to rehearse
mysql - David: sign in to listmonk-app as admin@dev.fedcom.net
(Super Admin, Settings), and send a campaign from
listmonk-app@dev.fedcom.net; remove it when done
- Done 2026-12-03:
[postgres] extensions = ["vector"]in coreapp.toml: the installer checks the Core has each one and makes it in the app's database as the superuser (CASCADE, so dependencies come too), on install and every update; ones taken off the list are kept. Tested on dev.fedcom.net with vector, pg_trgm and earthdistance, a refused postgis, and a rollback that kept them. Also fixed:needswith both postgres and mysql was meant to be refused, but the check never ran - Done 2026-12-03:
[postgres]/[mysql]min_versionin coreapp.toml: the installer compares it with the Core's server (numerically) on install and update, and refuses an older one with both versions. Tested on dev.fedcom.net (PostgreSQL 17.6, MariaDB 12.1.2) - PostgreSQL 18 on the Core (Federated's; David is asking)
- David: the agent's changes, for Supermarket's own repository (and a login CSRF it noticed in the app's sign-in: its OIDC state isn't tied to a browser cookie)
- Decided 2026-12-03 (David): on a Core, the Core's admin account
- Rehearsed again 2026-12-03 with Vikunja (postgres, sso, email), by an
agent given only the skill. It worked, but Vikunja's sign-in couldn't
use the fixed Authelia client (its browser code sends people back to
-
The Coreapps screen in Superpanel (Federated's code: needs their agreement). Until then, the installer could run as a small web app behind Authelia, for admins only
Later:
- Done 2026-12-03: a failed update rolls back. Before updating, coreapps
keeps, in
/federated/apps/.coreapps-rollback-<name>-*/(mode 700; not/tmp, which is in memory on a Core):services/<name>/,.env,docker-compose.yml, a dump of its database (pg_dump -Fc, ormariadb-dump --single-transaction, run in the database's container), and a reflink copy of/data(cp --reflink=always: instant on btrfs, as dev.fedcom.net's/federatedis; where it can't, no copy, and the messages say/dataisn't rolled back). A dump that fails refuses the update. If anything fails until the app answers (or on Ctrl-C), it stops the new container, runs the teardown of needs the update added, restores the database (drop, create, restore) and/data, puts the files back, starts the old version and removes the new image. The folder is deleted either way. Tested on dev.fedcom.net, with postgres and with mysql: data changed while the failed version ran is back as before- Cores' filesystem (checked 2026-12-03 on the VM, which runs
Federated's own Core image):
/and/federatedare btrfs,/federateda subvolume of its own (/dev/vda4,subvol=/federated). Federated relies on it:upgradetakes a read-only snapshotfederated-before-<app>-<version>of the whole subvolume before updating each of its apps (lib/functions.sh), andbin/btrfs-snapshot,restore-btrfs-snapshotandfree-up-space -smanage snapshots. So/data's reflink copy works on every Core - Large databases (2026-12-03): before dumping, coreapps reads the
database's size (
pg_database_size; MariaDB'sinformation_schematable sizes) and refuses the update, changing nothing, if the apps' disk can't hold the copy and still keep 1 GB free; above 1 GB (200 MB before zstd) it says the copy takes a while, and above 30 seconds how long it took. Tested on dev.fedcom.net (sizes, the refusal with a raised reserve, the message with a lowered limit)- Done 2026-12-03: PostgreSQL dumps use zstd at level 1 (
pg_dump -Fc -Z zstd:1; pg_dump's default compression if it fails, for a PostgreSQL without zstd). Measured on dev.fedcom.net with a 1.3 GB database: gzip (the default) 27.2 s / 223 MB, lz4 5.2 s / 363 MB, zstd:1 6.4 s / 158 MB, none 7.5 s / 896 MB; restoring each took 28-34 s (mostly index builds). A whole update of an app with that database took 26 s; a failed one rolled back with all 4.5 million rows (2 minutes) - Very large databases (tens of GB): even at ~5 s/GB the copy
grows with the data; a btrfs snapshot can't replace it (the server's
data is shared by all apps), so skipping the copy with the user's
agreement would be next, if a Core needs it. A faster rollback:
pg_restore -j(needs the dump as a file in the container)
- Done 2026-12-03: PostgreSQL dumps use zstd at level 1 (
- Cores' filesystem (checked 2026-12-03 on the VM, which runs
Federated's own Core image):
- Done 2026-12-03: dropping a need from an installed app.
ssoandemailgo freely;postgres/mysql(the app's data) need--drop-database(coreapps install/plan;coreapp deployasks for the app's name). The dropped needs' settings leave.envbefore the update (so a switch postgres -> mysql gets mysql's ownDB_*), and their teardown, from the service folder kept for the rollback, runs only once the new version answers; a failed update rolls back with them intact. Tested on dev.fedcom.net: sso and email dropped, a crashing version rolled back with them kept, the refusals, postgres -> mysql. Found and fixed with it: deploy's route wait took an app's own 404 for traefik's (it now waits for traefik to answer as the app does) bin/start/bin/stopdon't know coreapps' apps (see "Tell Federated");restart: alwayscovers reboots- Trust: a list of reviewed apps, or signed releases, and a warning in 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) forinstallapp,uninstallappandinstallapp-sso: not done. The installer uses the genericservices/<app>/format (installGeneric), whichinstallappalso supports. Alib/<app>.shfrom an app's repository would be root code from its author; the installer could generate one from its own templates instead services/<app>/servicefor version, internal IP, container and image: done- MySQL apps use the
pdnsmysqlcontainer (MariaDB, 192.168.0.10, also PowerDNS's database), PostgreSQL appspostgresql: postgres is done; done (mysqlneed, Coreapps step 4) - Authelia through
installapp-sso/configsso_<app>: needs alib/<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/appsonly) would need to learn it. Decided 2026-12-03 (David): go on with/opt/coreappsand today's paths, and tell Federated what Superpanel needs later - Internal IPs in 192.168.5.0/24: done
Superpanel's dashboard tiles come from applist.json
(superpanel-generate-applist-dashboard: every folder in
/federated/apps with a services/<name>/service), which installapp,
uninstallapp and upgrade make. Our apps are in it (checked 2026-12-03;
the earlier "not in applist" was wrong or from before installapp ran it).
Done 2026-12-03:
- Updates didn't remake it (or the catalog), so a new title, description or icon didn't show: coreapps now remakes both after an update, as after a remove
- The tile's link: without
URLinservice, Superpanel makes one from the app (its binary is stripped, so how isn't known; hyphenated names likememo-boardwere at risk). Ourservicenow hasURL="https://<name>.$DOMAIN/", as Federated's castopod, docuseal and wordpress do - Without
docs, the tile links a search of Federated's documentation; apps installed from a repository now default to the repository - Icons (2026-12-03): an unusable
icon.png(missing, a link, over 1 MB, not a PNG) used to become the default silently. The installer now says so;coreapp deployalso notes one that isn't square or is under 80px (the tile is 40x40);coreapp publishrefuses an unusable one, or one that isn't committed. Only PNG: Superpanel's scripts takeicon.svgtoo, but an SVG can carry scripts, so it'd need cleaning first - Look at the dashboard signed in as an admin: the tiles' links and icons, and "Disk Usage by App"
The installer in /federated/bin/coreapps/ (wanted, 2026-12-03)
David wants the installer on the Core in /federated/bin/coreapps/
instead of /opt/coreapps. What may need to change on the Core, for
Federated (checked on dev.fedcom.net):
- It has to come from the Core repo.
/federatedis a git checkout thatupgradepulls nightly. An untrackedbin/coreapps/survives pulls until the repo gets files of the same name; thengit pullrefuses, and the upgrade fails (bin/upgradealready has a workaround for exactly this withbin/sync-calcomusers). So Federated commitsbin/coreapps/to the Core repo, and Cores get it and its updates throughupgrade - coreapp-dev stops copying it there.
coreapp deployreplaces/opt/coreappson every deploy. Doing that in/federated/bin/coreapps/would modify tracked files and break the nextgit pullthe same way. Instead coreapp-dev would use the Core's copy, and keep/opt/coreappsonly as an override for testing installer changes - Layout. Everything else in
/federated/binis a single executable that Federated's scripts call by full path. A folder there means the command is/federated/bin/coreapps/coreapps. Alternatives: the command as/federated/bin/coreappswith its templates and needs in/federated/lib/coreapps/(where Federated keeps shared files), or a wrapper. Decide with Federated - Python. The installer needs Python 3.11 or newer (
tomllib); the Core's scripts are otherwise bash. The image has 3.14 today; Federated would have to keep python3 in the image - Superpanel has to run it as root on the host. Superpanel runs
installapp/uninstallappalready (strings in its binary) but its container only mounts/federated/lib(read-only),/federated/apps,/federated/logsand the Docker socket, not/federated/binor/federated/services. How it reaches the host now is still to find out. The Coreapps screen would callcoreapps plan,install,removeandlistthe same way - Where the apps' files go. The installer writes
/federated/services/<name>/(untracked, like the test apps now show ingit status). It works, and Superpanel's catalog andinstallapp/uninstallappfind them there, but they're untracked files in Federated's checkout. Federated may prefer a separate folder (e.g./federated/coreapps/<name>/) withinstallapp,uninstallappandsuperpanel-generate-catalogtaught to look there too, and.gitignorecovering whatever stays inservices/ - Starting and stopping.
bin/startandbin/stoponly know the fixedCORE_APPS/EXTRA_APPSlists, soinstallappdoesn't start a coreapp andstart all/stopskip them (the installer starts them itself). They should also handle apps marked.coreapp - The nightly upgrade.
upgrade_federatedgoes through installed apps; for a coreappVERSIONequalsIMAGE_VERSION, so nothing happens, which is right (coreapps updates them). Butupgrade_appreads the current image withcut -d: -f2, which breaks on an image whose registry has a port (gitea.example.com:5000/owner/app): it would think the image changed and rewrite the compose file wrongly. Either skip apps marked.coreapp, or parse the image properly - free-up-space. Its
docker image prune -a --filter until=24hdeletes images of stopped apps. Published apps can be pulled again; alocalhost/dev image can't. Fine for published apps; for dev it means a stopped test app may needcoreapp deployagain - Monitoring, billing.
installapprecords non-hidden apps inADDON_APPSon non-enterprise tiers, and would registerMONITORURLs (the installer writes none). Federated decides whether third-party apps are billed as add-ons, and whether published apps get monitored - Logs. The installer keeps the Core scripts' output (which contains
secrets because of their
set -x) in/federated/logs/coreapps/(mode 700). Federated may want that elsewhere, or fewer secrets in the traces (see "Tell Federated")
What the Core offers apps (studied 2026-12-03)
Superpanel (federatedcomputer/superpanel 26.12.01, a Go binary, at
192.168.0.85; its .env has LDAP, SMTP, Authelia client and
STORE_DB_URL). Its AI features:
/ai/settings(and/models): the LLM provider and model (Anthropic, OpenAI, OpenRouter, custom), stored in Hermes's.env(HERMES_LLM_PROVIDER,HERMES_LLM_API_KEY,HERMES_LLM_MODEL). The AI Settings toggle runsinstallapp hermes/ai/terminal(/stream): a chat with Hermes, through Hermes's API (HERMES_API_URL=http://192.168.0.92:8642,/v1/chat/completions, bearerHERMES_API_KEY)/api/mcp-apps: which apps the AI can use;/api/mcp/validate: the forward-auth check formcphub.<domain>, with per-user tokens insuperpanel/data/mcp_tokens- On dev.fedcom.net hermes and mcpserver aren't installed
hermes (nousresearch/hermes-agent, 192.168.0.92, no traefik route): the
agent. It uses mcpserver-hub (http://192.168.0.91:8080/sse) for tools.
mcpserver (federatedcomputer/mcpserver 1.8.8, 192.168.0.90 per-app
endpoints at mcpserver.<domain> with basic auth; mcpserver-hub at .91,
mcphub.<domain>, one endpoint for all apps, auth through Superpanel). It
only knows a fixed list of apps (MCPSERVER_APPS in lib/mcpserver.sh,
"keep in sync with APPS in the mcpserver image's entrypoint.py"): listmonk,
nextcloud, espocrm, baserow, bookstack, n8n, immich, gitea, plane, erpnext,
kimai, matomo, wordpress, vaultwarden. An app is linked with
installapp-mcpserver <app>, which calls config_mcpserver_<app> in the
app's lib file. So a coreapp can't offer tools to the AI today.
What an ai need could be:
- The app offers tools: it serves MCP (streamable HTTP) on a path, and the hub lists it. Needs mcpserver to accept a generic upstream (a URL and a token per app) instead of its fixed list. Ask Federated
- The app uses the model: through Hermes's OpenAI-compatible API. But that key is Superpanel's (full agent, all tools); an app would need its own, limited key, or the provider's key, which is the owner's money. Decide with Federated
Email (docker-mailserver 16.0.1 at 192.168.0.16, accounts in LDAP): Core
apps send through mail.<domain>:587 (STARTTLS) as fcore (or admin)
with the Core's admin password (MAIL_PASSWORD=$ADMINPASS, e.g. in
lib/bookstack.sh; SMTPUSER in get_appvars). A coreapp must not get
the admin password, so an email need has to create its own mail account
for the app (an LDAP user allowed to send as <app>@<domain>). To study:
how lib/mail.sh and Superpanel create accounts.
PowerDNS: *.<domain> already points every app hostname at the Core, and
traefik gets certificates through the DNS challenge, so apps need nothing
from PowerDNS for <app>.<domain>.
SDK packaging
- Tag the first release once install and VM creation work end to end
- Documentation on https://documentation.federated.computer (asked by
David, 2026-12-03): Coreapps for Core owners (installing an app from
a repository, private apps' tokens, updates, rollback, removing) and
for developers (coreapp-dev, coreapp.toml, the needs, publishing),
from README.md, the skill and its references
- Drafted 2026-12-04 (six pages, Hugo front matter and shortcodes). Built with the site: renders, links resolve, no raw shortcodes in the Markdown versions
- Copied 2026-12-04 into
federated-documentation(content/self-hosted/coreapps/), linked from the Software Library page ("add your own software to a Core: see Coreapps"); the site builds. Not committed there - David: review, commit and deploy the site; resolve the
reviewmarkers first (the installer's location on customer Cores, Superpanel's screen, add-on billing, the groups claim, the Actions workflow). The pages live only infederated-documentation - Done 2026-12-04:
coreapps loginat a terminal asks for the token without showing it (getpass); piped, it reads one line as before. Tested on dev.fedcom.net. The docs' review marker about it (Private Coreapps) can go, and its text becomes "paste the token when asked"