You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Validate safe host-wide roots during guided and direct initialization
- Reject bind source changes to prevent silent database data moves
BREAKING CHANGE: `host.data_root` is now required in `config.yml`.
### Requirement: Database data root safety and immutability
4
+
`host.data_root` SHALL be a normalized absolute non-symlink path for one dedicated evdb database tree.
5
+
It SHALL NOT overlap source, generated assets, Traefik assets, backups, locks, or a local Restic
6
+
repository. A custom root's immediate parent SHALL already exist and be safe. evdb SHALL reject a desired
7
+
database bind source that differs from the source recorded in an existing generated role Compose file,
8
+
and SHALL NOT move database data.
9
+
10
+
#### Scenario: Custom root uses mounted storage
11
+
-**WHEN**`host.data_root` is `/mnt/database-volume/evdb`
12
+
-**THEN** project `example-prod-01` Postgres data resolves to `/mnt/database-volume/evdb/example-prod-01/postgres/data`
13
+
14
+
#### Scenario: Root overlaps backup storage
15
+
-**WHEN**`host.data_root` is equal to or contains the managed backup path
16
+
-**THEN** validation fails before source, directories, or services change
17
+
18
+
#### Scenario: Existing generated bind differs
19
+
-**WHEN** a role's generated Compose file records a data bind under one root and source selects another
20
+
-**THEN** rendering fails before creating the new data directory or replacing Compose
21
+
22
+
## MODIFIED Requirements
23
+
24
+
### Requirement: Canonical host paths
25
+
Non-secret source SHALL live at `/etc/evdb/config.yml` and secret source at `/etc/evdb/secrets.yml`.
26
+
An rclone repository SHALL reference one private native rclone file in place; a local repository SHALL
27
+
omit `host.backup.rclone_config`. Generated database assets SHALL live under
28
+
`/var/lib/evdb/projects/<project>/<role>`, dedicated Traefik assets under `/var/lib/evdb/traefik`, and
29
+
mutable local backups and locks under `/var/lib/evdb`. Database data SHALL live under the required
30
+
`host.data_root` using `<project>/<role>/data`; fresh initialization SHALL default that root to
31
+
`/var/lib/evdb/databases` and write it explicitly.
32
+
33
+
#### Scenario: Default Postgres paths are derived
34
+
-**WHEN** fresh setup creates project `example-prod-01` with a Postgres role using the default data root
35
+
-**THEN** its Compose path is `/var/lib/evdb/projects/example-prod-01/postgres/compose.yaml` and its data path is `/var/lib/evdb/databases/example-prod-01/postgres/data`
36
+
37
+
#### Scenario: Custom Postgres data path is derived
38
+
-**WHEN**`host.data_root` is `/mnt/database-volume/evdb` and project `example-prod-01` has a Postgres role
39
+
-**THEN** its data path is `/mnt/database-volume/evdb/example-prod-01/postgres/data` while its Compose path remains canonical
40
+
41
+
#### Scenario: Local repository is configured
42
+
-**WHEN**`host.backup.repository` is a normalized absolute local path
43
+
-**THEN**`config.yml` contains no rclone configuration field
44
+
45
+
#### Scenario: Operator locates host inputs
46
+
-**WHEN** an operator reviews `/etc/evdb`, `/var/lib/evdb`, and `host.data_root`
47
+
-**THEN** evdb's desired settings and managed credentials are separated from generated runtime and database data
-[x] 1.1 Add the required host data root to source loading, validation, serialization, guided setup, direct initialization, and review.
4
+
5
+
## 2. Database Storage
6
+
7
+
-[x] 2.1 Derive database paths and managed directories from the configured root, and reject changes that conflict with an existing generated Compose bind.
8
+
9
+
## 3. Verification
10
+
11
+
-[x] 3.1 Cover default, custom, unsafe, missing, and immutable-root behavior with focused tests and validate the change artifacts.
0 commit comments