coreapp new --postgres: apps with their own database

A template overlay (templates/postgres) adds DEPENDS="postgresql", DB_*
settings with a random password, an install that creates the user and
database on the Core's PostgreSQL (safe to re-run), an uninstall that
drops them, and a Python example that counts visits. Tested with a
throwaway app: deploy, redeploy and a reboot of the Core keep the data,
remove drops the database and user.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 12:06:55 -07:00
co-authored by Claude Opus 5.5
parent 1108060432
commit 74bdc13f0f
12 changed files with 211 additions and 9 deletions
+14 -2
View File
@@ -155,8 +155,20 @@ What we learned:
Federated's monitoring. `coreapp deploy` drops `MONITOR` from the copy of
`service` on the Core
- [ ] Document the app format fully in the README (done in each app's README)
- [ ] Later: a database (`DEPENDS=postgresql`), SSO through Authelia, apps
published for other Cores (registry, submitting to Federated)
Databases (2026-12-03): `coreapp new --postgres <name>` adds
`DEPENDS="postgresql"`, DB_* settings in `env.in` (random password), an
`install` that creates the user and database on the Core's PostgreSQL
(`docker exec postgresql psql -U postgres`, as Federated's own installers
do) and an `uninstall` that drops them, and a Python example (psycopg)
that counts visits. Tested with `guest-book`: deploy, the count goes up,
a redeploy and a reboot of the Core keep the data, remove drops the database
and user. `postgresql.<domain>` resolves to the PostgreSQL container on the
`core` network (Docker's DNS); outside it, it's the public IP.
- [ ] Next: sign-in through the Core's Authelia (OIDC), as Federated's apps
do with `configsso_<app>`
- [ ] Later: apps published for other Cores (registry, submitting to
Federated)
## SDK packaging