Provision local MariaDB databases from the panel

This commit is contained in:
parkel committed 2026-11-21 01:26:10 +01:00
1 parent 091193baa0
commit 902a769eb3
14 files changed
+417 -54

No files matched your search

+31
View File
@@ -211,3 +211,34 @@ permission.
The worker applies the domain shown in the preview. If the account's primary
domain changes before the worker starts, create a preview for the new domain.
An existing web node reservation stays bound to the domain it was created for.
## Provision local databases from the panel
Enable the [database provisioning socket](development.md#enable-local-database-provisioning)
on the panel host. Install the MariaDB worker under a dedicated identity with
access to that socket.
```sh
sudo useradd --system --user-group --no-create-home --home-dir /nonexistent \
--shell /usr/sbin/nologin coulobre-db-provisioner
sudo install -m 0644 deploy/systemd/coulobre-database-provisioner.service /etc/systemd/system/
sudo systemctl daemon-reload
```
Set `COULOBRE_LOCAL_DATABASE_PROVISIONING=1` in `/etc/coulobre/panel.env`, then
apply pending migrations and restart the panel services.
```sh
panel_manage migrate --noinput
sudo systemctl restart coulobre-panel coulobre-worker coulobre-beat
sudo systemctl enable --now coulobre-database-provisioner.service
```
Open a hosting account and select **Provision database** for a database request.
Reload the account page to see the status. Use **Retry provisioning** after a
reported failure. Operators need permission to view hosting accounts and
database requests and the **Can add database provisioning** permission.
The MariaDB node stores the application login in the root-only file
`/var/lib/coulobre/database-node/<database-name>.json`. Use the credentials
from that file when configuring the hosted application.