Files
coreapp-dev/PLAN.md
T
davidandClaude Opus 5.5 0654d4c712 coreapp-vm command, uninstall.sh, stale-system check
- bin/coreapp-vm replaces scripts/create-coreserver-vm.sh: create (downloads
  and checks the CoreServer image when it's missing, resumes an interrupted
  download), list, ip, ssh (own known_hosts), start, stop, delete (asks for
  the name). update.sh symlinks it into ~/.local/bin.
- uninstall.sh removes coreapp-vm, the coreapp network, its hook and ufw
  rules; asks before deleting VMs, the image and keys.
- install.sh runs CoreDesktop's update first when the system wasn't
  upgraded in the last day, as `sibling add` does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 11:40:04 -07:00

61 lines
3.2 KiB
Markdown

# Plan
coreapp-dev is a software development kit for building apps that run as
Docker containers on Federated Core. It is a CoreDesktop sibling project:
people install it with `sibling add <url>`, and CoreDesktop's `update` keeps
it current (format: `~/Projects/coredesktop/skills/sibling-project-format.md`).
Delete an item once it's done; git history keeps the record.
## Now: a working Core in a local VM
What we know about the CoreServer image (2026-12-02): it's Arch Linux, boots
with BIOS or UEFI, and needs a display device (it stalls at "Loading initial
ramdisk" with `--graphics none`). All passwords are locked; cloud-init
(NoCloud) installs root's SSH keys. `/` is a fixed 10 GiB btrfs partition;
the extra disk space goes to `/federated`, which the image's own
`grow-federated.service` grows on first boot.
The Core `dev.fedcom.net` was provisioned on 2026-12-03 in the VM
(10.123.0.10). It's reachable from the internet at 77.216.180.150
through corerelay, which also carries its outbound traffic.
What we learned provisioning (2026-12-02/03):
- Federated Core finds its public IP with `dig @resolver4.opendns.com
myip.opendns.com` and publishes it in DNS, so the Core's outbound traffic
must leave through the relay (first attempt published the home IP)
- The Core is the authoritative DNS server for its domain (ns1/ns2.<domain>
point at `ip`), so 53 tcp/udp must be forwarded, plus 25 143 465 587 993
4190 9980 besides 22 80 443
- The domain is picked round-robin (dev.federatedcomputer.cloud,
dev.federatedcomputer.net, dev.fedcom.net, ...)
- The progress stream from core-create is server-sent events; it takes 5+
minutes, a full install about 40
- Deleting a Core makes the platform SSH into its IP and tear it down, so
never put a new VM behind an IP whose old Core still exists. A failed Core
has no delete button; Federated has to remove it
- The Core's containers use 192.168.0.0/16 and send replies for any
192.168.x.x address onto their own bridge, so the VM network is
10.123.0.0/24 (moved there on 2026-12-03 from 192.168.123.0/24)
- libvirt's DHCP `<host>` reservations are ignored on this workstation:
libvirt writes the hosts file readable by root only and dnsmasq reads it as
`nobody`. The reservation is a `dnsmasq:option` in the network instead
- Before core-create on a fresh VM: `systemctl is-active docker`, opendns
sees the VPS IP, and the hairpin (`/dev/tcp/<vps-ip>/22` from the VM)
- [ ] The Core shows as Active in the dashboard
- [ ] Tell Federated (2026-12-03):
- On this image, disabling systemd-resolved isn't enough: networkd's
`systemd-networkd-resolve-hook.socket` starts it at boot, it takes
port 53 and pdns can't start after a reboot. coreapp-dev masks it
through cloud-init; the installer should mask it too
- `upgrade-federated.timer` has `Requires=upgrade-federated.service`, so
the upgrade runs at every boot, not just at 5:00. It fails there
(exit 2), and on the first reboot it removed the pdns container that
couldn't start
- `/federated/bin/upgrade` has an API token in it, readable by anyone
with the image
## SDK packaging
- [ ] Tag the first release once install and VM creation work end to end