feat: configure MariaDB TLS for setup and runtime connections (#5)
This commit is contained in:
1 parent
15f81e053c
commit
370407d3ba
9 files changed
+325
-9
No files matched your search
@@ -444,3 +444,12 @@ MariaDB:
|
||||
- there is no GORM `AutoMigrate` against MariaDB: it retypes production columns to match the
|
||||
running binary's models. On 2026-09-24 a stale v1.18 binary run with the old AutoMigrate
|
||||
`-migrate` did exactly that, which is why it was removed.
|
||||
|
||||
## Connection transport
|
||||
|
||||
`connection_settings.tls_mode` defaults to `preferred`; `tls_ca_pem` stores an
|
||||
optional public CA certificate bundle. SQLite startup adds these columns for
|
||||
legacy settings. Every runtime/setup MariaDB DSN uses `internal/mariadb` to
|
||||
apply the policy documented in [05-config.md](05-config.md). Private keys are
|
||||
never part of the CA field. No mode silently falls back to plaintext except
|
||||
`preferred`.
|
||||
@@ -79,3 +79,17 @@ They are stored in SQLite and encrypted with `local_encryption.key` unless `QUOT
|
||||
`QFS_RESET_LOCAL_DB` is no longer supported. Reset requires an explicit CLI flag
|
||||
on each launch. A forced reset still stops if the safety backup cannot be created
|
||||
and verified. See [06-backup.md](06-backup.md).
|
||||
|
||||
## MariaDB TLS
|
||||
|
||||
`/setup` stores `tls_mode` and `tls_ca_pem` in SQLite `connection_settings`,
|
||||
alongside encrypted credentials. Existing and new connections default to
|
||||
`preferred`, which encrypts when advertised by MariaDB but can fall back to
|
||||
plaintext and does not authenticate the server. `required` mandates encryption
|
||||
without verifying the certificate. `verify-ca` requires a PEM CA and validates
|
||||
the server certificate chain without checking its hostname. `verify-full`
|
||||
validates both chain and hostname, using the supplied PEM or system roots.
|
||||
Only the verification modes accept CA input; invalid modes/PEM are rejected.
|
||||
Use `verify-full` for authenticated server connections. The setup form tests
|
||||
the selected policy before saving. Sync, setup checks and migration tooling
|
||||
share the same TLS configuration builder.
|
||||
Reference in new issue
Block a user