A config.json managed outside the server: refuse the save, say where (K-S5) #496

Merged
jcoffey-dev merged 1 commits from feat/read-only-config into main 2026-11-20 04:48:50 +00:00
Owner

Part of #428 (K-S5, read-only root).

What the server writes, checked in the code and on the lab's pods (read-only root, after a day of mail, backups, metrics and both upgrade tests: /tmp and /var/lib/inbuxa both empty):

  • /tmp: application bundles unpack here (std::env::temp_dir()), unless an Application sets unpackDirectory.
  • the working directory (/var/lib/inbuxa in the image): migrations' work files under migrations/ (or $INBUXA_MIGRATIONS_DIR).
  • RocksDB/filesystem store snapshots: under the store's own path; not used with PostgreSQL.
  • config.json: only bootstrap and saving the data store settings write it.

That last one is the only thing a read-only setup gets wrong: on Kubernetes config.json is a read-only mount of server.dataStore, and a save through the API failed the whole request with the I/O error. Now the registry checks the file can be written first; when it can't (read-only or not permitted) that object is refused with forbidden and:

The data store settings are in config.json, which this server can't write: it's managed outside the server (on Kubernetes, the chart's server.dataStore value). Change them there.

Other write errors fail as before, now with the path in the event.

cargo check -p store -p jmap clean (no new warnings), unit test for the read-only check, fmt, fork checks. The chart side (documenting the paths) is a separate charts PR.

Part of #428 (K-S5, read-only root). What the server writes, checked in the code and on the lab's pods (read-only root, after a day of mail, backups, metrics and both upgrade tests: `/tmp` and `/var/lib/inbuxa` both empty): - `/tmp`: application bundles unpack here (`std::env::temp_dir()`), unless an Application sets `unpackDirectory`. - the working directory (`/var/lib/inbuxa` in the image): migrations' work files under `migrations/` (or `$INBUXA_MIGRATIONS_DIR`). - RocksDB/filesystem store snapshots: under the store's own path; not used with PostgreSQL. - `config.json`: only bootstrap and **saving the data store settings** write it. That last one is the only thing a read-only setup gets wrong: on Kubernetes `config.json` is a read-only mount of `server.dataStore`, and a save through the API failed the whole request with the I/O error. Now the registry checks the file can be written first; when it can't (read-only or not permitted) that object is refused with `forbidden` and: > The data store settings are in config.json, which this server can't write: it's managed outside the server (on Kubernetes, the chart's server.dataStore value). Change them there. Other write errors fail as before, now with the path in the event. `cargo check -p store -p jmap` clean (no new warnings), unit test for the read-only check, fmt, fork checks. The chart side (documenting the paths) is a separate charts PR.
jcoffey-dev added 1 commit 2026-11-20 04:34:25 +00:00
A config.json managed outside the server: refuse the save, say where (K-S5)
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 12m5s
2e0561026d
On Kubernetes config.json is a read-only mount of the chart's
server.dataStore. Saving the data store settings through the API then
failed the whole request with the write error. The registry now checks
the file can be written first and, when it can't (read-only or not
permitted), refuses that object with forbidden and a description saying
the settings are managed outside the server and where to change them.
Other write errors still fail as before, with the file's path.
jcoffey-dev merged commit 77d628f14e into main 2026-11-20 04:48:50 +00:00
jcoffey-dev deleted branch feat/read-only-config 2026-11-20 04:48:51 +00:00
Sign in to join this conversation.