Keep Superpanel's dashboard current: link, docs and updates

The service file gets URL="https://<name>.$DOMAIN/", as Federated's
apps on their own hostnames do. Apps from a repository without docs
link to it. Updates remake Superpanel's applist and catalog, as removes
do, so a new title or icon shows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 15:37:21 -07:00
co-authored by Claude Opus 5.5
parent 4e0292fd91
commit 14311cee21
6 changed files with 45 additions and 13 deletions
+18 -4
View File
@@ -386,10 +386,24 @@ Their points, and where coreapp-dev stands:
Federated what Superpanel needs later Federated what Superpanel needs later
- Internal IPs in 192.168.5.0/24: done - Internal IPs in 192.168.5.0/24: done
Superpanel lists our apps in its catalog (`catalog.json`) but not in its Superpanel's dashboard tiles come from `applist.json`
installed-apps list (`applist.json`, made by (`superpanel-generate-applist-dashboard`: every folder in
`superpanel-generate-applist-dashboard`), so they probably don't show on `/federated/apps` with a `services/<name>/service`), which `installapp`,
its dashboard or in "Disk Usage by App". [ ] Find out why `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 `URL` in `service`, Superpanel makes one from
the app (its binary is stripped, so how isn't known; hyphenated names
like `memo-board` were at risk). Our `service` now has
`URL="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
- [ ] 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) ### The installer in /federated/bin/coreapps/ (wanted, 2026-12-03)
+7 -1
View File
@@ -231,7 +231,13 @@ The Core's own scripts trace secrets, so their output goes to
port, the new tag is gone from `docker image ls`, and `coreapp_hello` port, the new tag is gone from `docker image ls`, and `coreapp_hello`
isn't in PostgreSQL. With the same `version` (and `port = 9999`): isn't in PostgreSQL. With the same `version` (and `port = 9999`):
"Rolled back hello's settings. It's the same image tag as before". "Rolled back hello's settings. It's the same image tag as before".
11. On a Core whose tier isn't enterprise, deploying a new app asks before 11. Superpanel: after deploy, `/federated/apps/superpanel/data/applist.json`
(the dashboard) and `catalog.json` have the app; `service` has
`URL="https://hello.$DOMAIN/"` and applist the same `url`. Change
`title`, raise `version`, deploy: both files have the new title. After
`coreapp remove`, neither has it. An app installed from a repository
with no `docs` has `DOCS=<the repository>` in `service` and applist.
12. On a Core whose tier isn't enterprise, deploying a new app asks before
it's recorded as an add-on; answering no deploys nothing. it's recorded as an add-on; answering no deploys nothing.
### With a database ### With a database
+15 -7
View File
@@ -576,7 +576,8 @@ def make_service_folder(m, p, source, origin):
"""/federated/services/<name>/ in the Core's generic format, from m.""" """/federated/services/<name>/ in the Core's generic format, from m."""
values = { values = {
"NAME": m["name"], "TITLE": m["title"], "DESCRIPTION": m["description"], "NAME": m["name"], "TITLE": m["title"], "DESCRIPTION": m["description"],
"DOCS": m["docs"], "IMAGE": m["image"], "VERSION": m["version"], # Without docs, Superpanel links a search of Federated's documentation
"DOCS": m["docs"] or (origin["source"] if origin else ""), "IMAGE": m["image"], "VERSION": m["version"],
"IP": p["address"], "PORT": str(m["port"]), "DBNAME": m["dbname"], "IP": p["address"], "PORT": str(m["port"]), "DBNAME": m["dbname"],
"DEPENDS": " ".join(read_text(NEEDS_DIR, n, "depends").strip() for n in m["needs"]), "DEPENDS": " ".join(read_text(NEEDS_DIR, n, "depends").strip() for n in m["needs"]),
} }
@@ -782,6 +783,8 @@ def install_app(m, p, folder, origin, addon_ok, recreate):
check_needs(m) check_needs(m)
if p["state"] == "update": if p["state"] == "update":
remove_old_images(m) remove_old_images(m)
# Its title, description, icon or link may have changed
refresh_superpanel(log)
say(f"{'Installed' if p['state'] == 'new' else 'Updated'}: {p['url']}") say(f"{'Installed' if p['state'] == 'new' else 'Updated'}: {p['url']}")
return 0 return 0
@@ -961,16 +964,21 @@ def remove(name):
if image: if image:
remove_images(image) remove_images(image)
# uninstallapp made superpanel's catalog while the folder was still # uninstallapp made superpanel's catalog while the folder was still
# there, so it would still offer the app: make it again, as installapp # there, so it would still offer the app: make it again
# does refresh_superpanel(log)
if os.path.exists(APPS + "/superpanel/.env"):
run_logged([FEDERATED + "/bin/superpanel-generate-catalog"], log,
"Updating superpanel's app catalog failed")
run(["docker", "exec", "superpanel", "pkill", "-HUP", "superpanel"])
say(f"Removed {name}.") say(f"Removed {name}.")
return 0 return 0
def refresh_superpanel(log):
"""Superpanel's lists of installed apps (its dashboard) and of apps it
offers, as installapp and uninstallapp make them."""
if os.path.exists(APPS + "/superpanel/.env"):
for script in ("superpanel-generate-applist-dashboard", "superpanel-generate-catalog"):
run_logged([f"{FEDERATED}/bin/{script}"], log, f"{script} failed")
run(["docker", "exec", "superpanel", "pkill", "-HUP", "superpanel"])
def list_apps(): def list_apps():
rows = [] rows = []
for name in sorted(os.listdir(SERVICES)): for name in sorted(os.listdir(SERVICES)):
+2
View File
@@ -6,3 +6,5 @@ VERSION={{VERSION}}
INTERNAL_IP={{IP}} INTERNAL_IP={{IP}}
DEPENDS="{{DEPENDS}}" DEPENDS="{{DEPENDS}}"
PORTS={{PORT}} PORTS={{PORT}}
# Superpanel's dashboard link, as Federated's apps give it (with $DOMAIN)
URL="https://{{NAME}}.$DOMAIN/"
+1 -1
View File
@@ -62,7 +62,7 @@ What the Core gives every app:
name = "my-app" # id and hostname: https://my-app.<domain> name = "my-app" # id and hostname: https://my-app.<domain>
title = "My App" # shown in the Core's dashboard title = "My App" # shown in the Core's dashboard
description = "What it does, in a sentence" description = "What it does, in a sentence"
docs = "https://example.com/docs" # optional docs = "https://example.com/docs" # optional; installed from a repository, defaults to it
image = "localhost/coreapp/my-app" # image name; the Core runs image:version image = "localhost/coreapp/my-app" # image name; the Core runs image:version
version = "0.1.0" # the image tag; raise it for each release version = "0.1.0" # the image tag; raise it for each release
port = 8080 # the port the app serves HTTP on (any; 8080 is usual) port = 8080 # the port the app serves HTTP on (any; 8080 is usual)
+2
View File
@@ -6,6 +6,8 @@
name = "{{NAME}}" name = "{{NAME}}"
title = "{{TITLE}}" title = "{{TITLE}}"
description = "{{TITLE}}, made with coreapp-dev" description = "{{TITLE}}, made with coreapp-dev"
# Its documentation, linked from the Core's dashboard (installed from a
# repository, it defaults to the repository)
# docs = "https://..." # docs = "https://..."
# The image, as image:version. localhost/... images only exist where # The image, as image:version. localhost/... images only exist where