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
+4
View File
@@ -0,0 +1,4 @@
# Reach Authelia's https address through traefik on the core network
# (inside it, authelia.@DOMAIN@ is Authelia's own plain-http container)
extra_hosts:
- "authelia.@DOMAIN@:@TRAEFIK_IP@"
+1
View File
@@ -0,0 +1 @@
authelia
+5
View File
@@ -0,0 +1,5 @@
# Sign-in through the Core's Authelia (OpenID Connect); needs/sso/setup
# registers the client
OIDC_ISSUER=https://authelia.@DOMAIN@
OIDC_CLIENT_ID=coreapp-{{NAME}}
OIDC_CLIENT_SECRET=@OIDC_CLIENT_SECRET:RANDOM:LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL@
+42
View File
@@ -0,0 +1,42 @@
# Register it with the Core's Authelia as an OpenID Connect client, with the
# secret from .env (hashed), between markers so uninstall can remove it.
# Safe to run again. Authelia is checked with the new client before it
# restarts; if the check fails, its old configuration is put back.
IDP=/federated/apps/authelia/data/config/idproviders.yml
OIDC_CLIENT_SECRET="$(sed -n 's/^OIDC_CLIENT_SECRET=//p' /federated/apps/{{NAME}}/.env)"
OIDC_HASH="$(docker exec authelia authelia crypto hash generate pbkdf2 --password "$OIDC_CLIENT_SECRET" | awk '/Digest:/ {print $2}')"
cp -p "$IDP" "$IDP.coreapp-{{NAME}}.bak"
sed -i '/^ ### coreapp-{{NAME}} begin$/,/^ ### coreapp-{{NAME}} end$/d' "$IDP"
cat >> "$IDP" <<OIDC
### coreapp-{{NAME}} begin
- client_id: 'coreapp-{{NAME}}'
client_name: '{{TITLE}}'
client_secret: '$OIDC_HASH'
consent_mode: 'implicit'
public: false
authorization_policy: 'one_factor'
require_pkce: true
pkce_challenge_method: 'S256'
redirect_uris:
- 'https://{{NAME}}.$DOMAIN/auth/callback'
scopes:
- 'openid'
- 'profile'
- 'email'
- 'groups'
response_types:
- 'code'
grant_types:
- 'authorization_code'
token_endpoint_auth_method: 'client_secret_basic'
userinfo_signed_response_alg: 'none'
### coreapp-{{NAME}} end
OIDC
if docker exec authelia authelia validate-config > /dev/null 2>&1; then
rm -f "$IDP.coreapp-{{NAME}}.bak"
restart_service authelia
else
echo "Authelia rejected the new client; left its configuration as it was." >&2
mv "$IDP.coreapp-{{NAME}}.bak" "$IDP"
fi
unset IDP OIDC_CLIENT_SECRET OIDC_HASH
+4
View File
@@ -0,0 +1,4 @@
# Remove its OpenID Connect client from the Core's Authelia
sed -i '/^ ### coreapp-{{NAME}} begin$/,/^ ### coreapp-{{NAME}} end$/d' \
/federated/apps/authelia/data/config/idproviders.yml
restart_service authelia