Add the mysql need: its own database on the Core's MariaDB

needs = ["mysql"] (coreapp new --mysql) makes a user and database
coreapp_<name> on pdnsmysql, with the same DB_* settings as postgres
(so an app has one or the other). Root's password is read inside the
container, so it stays out of installapp's set -x log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 15:15:23 -07:00
co-authored by Claude Opus 5.5
parent 6ab1db839b
commit 8ef2112e3c
12 changed files with 93 additions and 14 deletions
+17
View File
@@ -270,6 +270,23 @@ has the `DB_*` variables, `.coreapp` says `needs=postgres`.
`/federated/bin/reconcile-authelia-sso` doesn't bring it back; Authelia
healthy, other clients (Nextcloud) still work. Deploy again: one block.
### With mysql
1. `needs = ["postgres", "mysql"]`: refused ("postgres or mysql, not
both"); `coreapp new --postgres --mysql x` too.
2. `coreapp new --mysql my-test`: `needs = ["mysql"]`, deploy. `.env` has
`DB_HOST=pdnsmysql.<domain>`, `DB_PORT=3306`, `DB_NAME` and `DB_USER`
`coreapp_my_test`, a random `DB_PASSWORD`; `service` has
`DEPENDS="pdnsmysql"`.
3. `docker run --rm --network core --env-file /federated/apps/my-test/.env
mariadb:12.1.2 sh -c 'mariadb -h$DB_HOST -u$DB_USER -p$DB_PASSWORD $DB_NAME ...'`:
create, insert, select work; `show databases` lists only its own;
`@@character_set_database` is `utf8mb4`; `powerdns` is denied (1044);
a wrong password is denied (1045).
4. The install log (`/federated/logs/coreapps/my-test-install.log`) has
root's password only on Federated's `MYSQL_ROOTPASSWORD=` lines.
5. `coreapp remove`: no `coreapp%` user or database left in MariaDB.
### With email
1. `coreapp new --email mail-test`: `needs = ["email"]`, deploy. On the