Apps are a coreapp.toml; a trusted installer makes the Core side

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>
This commit is contained in:
2026-12-03 13:36:47 -07:00
co-authored by Claude Opus 5.5
parent d8c6d1011f
commit b4d47fb1c5
36 changed files with 1046 additions and 413 deletions
+24
View File
@@ -0,0 +1,24 @@
services:
{{NAME}}:
image: @CONTAINER@:${IMAGE_VERSION}
container_name: {{NAME}}
hostname: {{NAME}}.@DOMAIN@
restart: always
networks:
core:
ipv4_address: {{IP}}
{{COMPOSE_EXTRA}}
env_file:
- ./.env
volumes:
- ./data:/data
labels:
- "traefik.enable=true"
- "traefik.http.routers.{{NAME}}.rule=Host(`{{NAME}}.@DOMAIN@`)"
- "traefik.http.routers.{{NAME}}.entrypoints=websecure"
- "traefik.http.routers.{{NAME}}.tls.certresolver=letsencrypt"
- "traefik.http.services.{{NAME}}.loadbalancer.server.port={{PORT}}"
networks:
core:
external: true
+5
View File
@@ -0,0 +1,5 @@
# The app's settings, filled in when it's installed. Updates keep the values
# (secrets don't change) and add settings a new version needs.
IMAGE_VERSION=@VERSION@
APP_URL=https://{{NAME}}.@DOMAIN@
APP_SECRET=@APP_SECRET:RANDOM:LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL@
Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

+14
View File
@@ -0,0 +1,14 @@
# Made by coreapps from the app's coreapp.toml. Sourced by the Core's
# installapp.
. /federated/lib/helpers.sh
# Besides /etc/federated's and service's values, the templates use
# @TRAEFIK_IP@, traefik's address on the core network
TRAEFIK_IP="$(sed -n 's/^INTERNAL_IP=//p' /federated/services/traefik/service)"
installGeneric {{NAME}}
# .env holds secrets
chmod 600 /federated/apps/{{NAME}}/.env
# What the app needs from the Core (its database, its sign-in client)
for setup in /federated/services/{{NAME}}/needs/*/setup; do
[ -e "$setup" ] && . "$setup"
done
unset setup
+8
View File
@@ -0,0 +1,8 @@
NAME="{{TITLE}}"
DESCRIPTION="{{DESCRIPTION}}"
DOCS={{DOCS}}
CONTAINER={{IMAGE}}
VERSION={{VERSION}}
INTERNAL_IP={{IP}}
DEPENDS="{{DEPENDS}}"
PORTS={{PORT}}
+9
View File
@@ -0,0 +1,9 @@
# Made by coreapps from the app's coreapp.toml. Sourced by the Core's
# uninstallapp (so no `exit` here): stop the app, undo what it needed from
# the Core, delete its settings and data.
docker compose -f /federated/apps/{{NAME}}/docker-compose.yml -p {{NAME}} down
for teardown in /federated/services/{{NAME}}/needs/*/teardown; do
[ -e "$teardown" ] && . "$teardown"
done
unset teardown
rm -rf /federated/apps/{{NAME}}