Install apps from their repository, including private ones

coreapps plan|install <https://host/owner/repo>[@tag] reads only
coreapp.toml and icon.png at the tag's commit (depth 1, blobs on demand,
regular files only), with git limited to https and no prompts or system
settings. The default tag is the newest numeric release; version must
match the tag; the image is always pulled. The marker records source,
tag and commit; the same name from another repository is refused.
coreapps update <name> moves to the newest release. On the workstation:
coreapp install <url> (shows the app and its needs, asks) and update.

Private apps: coreapps login <host> <user> keeps a read-only token (from
stdin) in /etc/coreapps/credentials (root only), checked with the host's
registry first. git gets it as an extraHeader for that host only, docker
in a config made for each pull. coreapp login/logout/logins on the
workstation. Tested with a private repository and package on Federated's
Gitea.

Fixed: old images of docker.io/library/... weren't deleted (docker lists
them by short name); remove force-deleted images another app could use;
coreapp help cut off multi-line descriptions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 14:51:41 -07:00
co-authored by Claude Opus 5.5
parent ed2841f092
commit bef3b86970
6 changed files with 608 additions and 37 deletions
+43
View File
@@ -292,6 +292,49 @@ then says which needs it has. Apps with an address outside 192.168.5.0/24
get a new one on their next update (the container moves; the app keeps
working), and apps with sign-in get their client copy.
## Installing from a repository (coreapp install, update)
Needs a public git repository over https whose release tag `v<version>`
has a `coreapp.toml` with a published, public `image` (e.g. after
`coreapp publish`).
1. `coreapp install https://<host>/<owner>/<repo>`: shows the title,
version, source with tag and commit, image, needs and URL, and asks.
Answering no installs nothing. Yes: "<title> <version> from <url>
(v<version>, commit ...)", "Pulling ...", "Installed: https://...".
`coreapp list` shows `<url>@v<version>`; on the Core,
`/federated/services/<name>/.coreapp` has `source`, `tag`, `commit`.
2. Publish a newer version, then `coreapp update <name>`: "Updated", the
old image is gone from the Core. Again: "at the newest release".
3. `coreapp install <url>@v<old version>`: installs that tag.
4. Refused with a message, nothing changed:
- a URL with a password (`https://u:p@host/o/r`), `http://`, `ssh://`,
or one level only (`https://host/repo`)
- a repository without `v1.2.3` tags (unless `@<tag>` is given), a tag
that doesn't exist, `@main`
- a tag whose `coreapp.toml` has another `version`
- `image = "localhost/..."` at the tag
- the same app name from another repository
- a private repository, or an image that can't be pulled
5. `icon.png` that's a symbolic link in the repository: the default icon is
used.
6. Private: with a private repository and package, `coreapp install <url>`
stops with "If it's private, give this Core a token for <host>: coreapp
login <host>". `coreapp login <host>` with a wrong token: "rejected the
token", nothing saved. With a read-only token (Gitea: repositories and
packages, read): "Saved a token ... (its registry accepts it)", then
`coreapp install <url>` works; `coreapp logins` lists the host (no
token shown); on the Core `/etc/coreapps` is 700, `credentials` 600, and
`/root/.docker/config.json` has no entry for the host. `coreapp logout
<host>`: installing fails again.
7. `coreapp remove` in the app's folder (or `coreapps remove <name>` on the
Core) removes it like any other.
Without a public repository, the fetch can be tested on a local bare
repository (`git config uploadpack.allowFilter true`) by loading
`core/coreapps` as a module and replacing `REPO_URL`, `normalize_url` and
`GIT_ENV["GIT_ALLOW_PROTOCOL"]` for `file://` (only in the test).
## Publishing (coreapp publish)
With a throwaway registry on the workstation