An app's repository now has only coreapp.toml, its Dockerfile, its code and an icon: no install scripts or compose file, so installing an app from someone else's repository can't run their code as root on a Core. core/coreapps runs on the Core (coreapp deploy puts it in /opt/coreapps). It checks the manifest, refuses Federated's app names and the Core's hostnames, picks a free address on that Core, writes the generic app format from its own templates, sets up the needs (postgres, sso) and installs through installapp. Updates keep the address, secrets and data, add settings for new needs and delete old images; dropping a need is refused. remove rebuilds Superpanel's catalog afterwards. PLAN.md: the Coreapps direction and steps, and what the Core offers apps (Superpanel's AI features, mcpserver, hermes, email, PowerDNS). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
16 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): - On this image, disabling systemd-resolved isn't enough: networkd's
systemd-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).installapp'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) - 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 (192.168.200.10-250, free on that Core)
- 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: a Gitea Actions workflow in new apps that builds the image
on a version tag and pushes it to the repository's Gitea registry; and
coreapp publishfor developers without a runner. Pin the image by digest in what the Core installs? Private registries need a pull token - Install from a URL on the Core:
coreapps install <repo-url>[@tag](git clone at the tag, readcoreapp.tomlandicon.pngonly, pull the image). Show the source and what the app needs before installing - Email and AI needs (findings below), then other services: PowerDNS records beyond the wildcard, if an app needs other hostnames
- The skill: a Claude Code skill in coreapp-dev (installed by
update.sh) that teachescoreapp.toml, the needs, thecoreappcommands and testing against the VM - 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:
- Uninstalling a need without removing the app (now refused)
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)
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