coreapp: make, deploy and test apps on the Core in the VM

Apps are folders in Federated Core's generic services format (service,
docker-compose.yml.in, env.in, install, uninstall, icon.png) plus their
own Dockerfile. coreapp new scaffolds one from templates/app with an
address in 192.168.200.x; deploy builds the image, copies it to the Core
over SSH, installs it with installapp (and starts it, since the Core's
start only knows its own apps) or updates it keeping .env; check, status,
logs, shell and remove work on the Core.

Apps in development aren't registered with Federated's monitoring: deploy
drops MONITOR from the Core's copy of service. installapp/uninstallapp
traces go to private logs, not the terminal.

update.sh installs docker and docker-buildx and links coreapp into
~/.local/bin. PLAN.md: how the Core runs apps, and corrected evidence for
the Core's timers running their jobs at every boot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 11:54:25 -07:00
co-authored by Claude Opus 5.5
parent 0654d4c712
commit 1108060432
16 changed files with 621 additions and 13 deletions
+34 -2
View File
@@ -18,7 +18,7 @@ sibling add https://gitea.federated.computer/Federated_Computer/coreapp-dev.git
This installs libvirt and QEMU/KVM, adds you to the `libvirt` group (log out
and back in afterwards), sets up the `coreapp` VM network (10.123.0.0/24) and
installs the `coreapp-vm` command. CoreDesktop's `update` keeps them current.
installs Docker and the `coreapp-vm` and `coreapp` commands. CoreDesktop's `update` keeps them current.
## A Core in a VM
@@ -41,7 +41,37 @@ installs the `coreapp-vm` command. CoreDesktop's `update` keeps them current.
([Provisioning a Core](https://documentation.federated.computer/self-hosted/cores/provisioning-a-core/)),
with the public IP as `ip`.
## Commands
## Make an app
```
coreapp new my-app # makes ./my-app from the template
cd my-app
coreapp deploy # build, copy to the Core, install (or update)
coreapp check # https://my-app.<domain>/ answers, valid certificate
```
An app is a folder in the format Federated Core installs apps from
(`/federated/services/<app>/` on the Core): `service`,
`docker-compose.yml.in`, `env.in`, `install`, `uninstall`, `icon.png`, plus
the app's own `Dockerfile`. The README in each new app explains the files.
| Command | Does |
|---|---|
| `coreapp new <name>` | Make an app in `./<name>`; it gets an address in 192.168.200.x on the Core |
| `coreapp deploy` | Build its image, copy it to the Core over SSH, install it, or update it keeping its `.env` |
| `coreapp check` | It answers at its `MONITOR` URL with a valid certificate |
| `coreapp status` / `logs [-f]` / `shell` | Its container, its log, a shell in it |
| `coreapp remove` | Uninstall it from the Core (asks first) |
`COREAPP_VM` picks the VM (default `coreserver`).
Installing and removing an app go through the Core's own `installapp` and
`uninstallapp`. Those would also add its `MONITOR` URL to Federated's
external monitoring, so `coreapp deploy` copies `service` to the Core without
the `MONITOR` line: apps in development aren't monitored. `coreapp check`
uses the line from your folder.
## VM commands
| Command | Does |
|---|---|
@@ -76,5 +106,7 @@ stay installed.
| `install.sh`, `update.sh` | Run by CoreDesktop's `sibling add` and `update` |
| `libvirt/network-hook.sh` | NAT and firewall rules for the `coreapp` network |
| `bin/coreapp-vm` | Creates and manages CoreServer VMs (`coreapp-vm help`) |
| `bin/coreapp` | Makes, deploys and tests apps (`coreapp help`) |
| `templates/app/` | What `coreapp new` starts from |
| `uninstall.sh` | Removes what coreapp-dev set up |
| [PLAN.md](PLAN.md), [TEST.md](TEST.md) | What's next, and how to test it |