FJ-69: move the MCP state volume to /data and adopt the Nushell key recipe #89

Merged
David merged 1 commit from chore/doc-formatting into main 2026-08-02 17:24:33 +02:00
Owner

Moves the MCP HTTP service's state volume out of the application directory and swaps every key-generation recipe to Nushell. Docs-and-config plus two error strings; no decoding or control-flow behavior changes.

State volume: /app/data -> /data

/app holds the binary and WORKDIR, so the SQLite state store was mutable state nested inside the immutable application directory. It now lives at /data: oci-build/Dockerfile creates it, declares VOLUME ["/data"], defaults FORGEJO_MCP_DATABASE_URL beneath it, and chowns it explicitly (chown -R appuser:appuser /app /data) because it no longer inherits ownership by sitting under /app. compose.mcp.yml mounts forgejo-mcp-data there, and .env.example plus docs/deployment.md agree.

Verified by rebuilding the runtime image and running it: /data is owned by uid 1001, FORGEJO_MCP_DATABASE_URL=sqlite:///data/forgejo-mcp.db, and a write probe as appuser succeeds.

Compatibility: the volume name is unchanged and the database file sits at the volume root, so a default deployment resolves /data/forgejo-mcp.db to the same file it previously reached at /app/data/forgejo-mcp.db. An .env pinning the old absolute path must be updated, or the service writes to the container's writable layer and loses state on recreate.

Key recipe: openssl rand -base64 32 -> random binary 32 | encode base64

Both emit the 44-character padded standard-base64 string the decoders require (random binary 32 | encode base64 | str length -> 44 on Nushell 0.112.2), but the Nushell form needs no external binary. Ten sites across README.md, docs/deployment.md, .env.example, compose.mcp.yml, and the two fail-closed startup errors in crates/fj-mcp/src/http.rs. Containing fences are retagged nu, and the pipeline is single-quoted inside compose's ${VAR:?...} messages so the | cannot read as message punctuation; docker compose config renders it correctly.

The same OpenSSL recipe in the upstream mcp-web crate is out of scope here and is tracked in MCPWEB-9.

Docs

docs/deployment.md is reflowed to ~120 columns with aligned tables.

Checks

just pre-commit green: fmt, clippy -D warnings, build, and the full suite (76 tests across the four crates plus doctests).

#FJ-69

Moves the MCP HTTP service's state volume out of the application directory and swaps every key-generation recipe to Nushell. Docs-and-config plus two error strings; no decoding or control-flow behavior changes. ## State volume: `/app/data` -> `/data` `/app` holds the binary and `WORKDIR`, so the SQLite state store was mutable state nested inside the immutable application directory. It now lives at `/data`: `oci-build/Dockerfile` creates it, declares `VOLUME ["/data"]`, defaults `FORGEJO_MCP_DATABASE_URL` beneath it, and chowns it explicitly (`chown -R appuser:appuser /app /data`) because it no longer inherits ownership by sitting under `/app`. `compose.mcp.yml` mounts `forgejo-mcp-data` there, and `.env.example` plus `docs/deployment.md` agree. Verified by rebuilding the runtime image and running it: `/data` is owned by uid 1001, `FORGEJO_MCP_DATABASE_URL=sqlite:///data/forgejo-mcp.db`, and a write probe as `appuser` succeeds. **Compatibility:** the volume name is unchanged and the database file sits at the volume root, so a default deployment resolves `/data/forgejo-mcp.db` to the same file it previously reached at `/app/data/forgejo-mcp.db`. An `.env` pinning the old absolute path must be updated, or the service writes to the container's writable layer and loses state on recreate. ## Key recipe: `openssl rand -base64 32` -> `random binary 32 | encode base64` Both emit the 44-character padded standard-base64 string the decoders require (`random binary 32 | encode base64 | str length` -> `44` on Nushell 0.112.2), but the Nushell form needs no external binary. Ten sites across `README.md`, `docs/deployment.md`, `.env.example`, `compose.mcp.yml`, and the two fail-closed startup errors in `crates/fj-mcp/src/http.rs`. Containing fences are retagged `nu`, and the pipeline is single-quoted inside compose's `${VAR:?...}` messages so the `|` cannot read as message punctuation; `docker compose config` renders it correctly. The same OpenSSL recipe in the upstream `mcp-web` crate is out of scope here and is tracked in MCPWEB-9. ## Docs `docs/deployment.md` is reflowed to ~120 columns with aligned tables. ## Checks `just pre-commit` green: fmt, clippy `-D warnings`, build, and the full suite (76 tests across the four crates plus doctests). #FJ-69
chore(mcp): move state to /data and adopt the Nushell key recipe
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 30s
Create release / Create release from merged PR (pull_request) Has been skipped
fd41e92a15
The runtime image kept its SQLite state under /app/data, nesting mutable state inside the immutable application directory that holds the binary and WORKDIR. It now lives at /data: the Dockerfile creates it, declares VOLUME ["/data"], chowns it explicitly (it no longer inherits ownership from /app), and defaults FORGEJO_MCP_DATABASE_URL beneath it; compose.mcp.yml mounts forgejo-mcp-data there. The volume name is unchanged and the database file sits at the volume root, so a default deployment resolves to the same file; only an .env pinning the old absolute path needs updating.

Every key-generation recipe is now the Nushell `random binary 32 | encode base64` instead of `openssl rand -base64 32`. Both emit the 44-character padded standard-base64 string the decoders require, but the Nushell form needs no external binary. This covers README.md, docs/deployment.md, .env.example, compose.mcp.yml, and the two fail-closed startup errors in crates/fj-mcp/src/http.rs; the containing fences are retagged nu, and the pipeline is quoted inside compose's ${VAR:?...} messages so the pipe cannot read as punctuation.

docs/deployment.md is reflowed to ~120 columns with aligned tables.

The same OpenSSL recipe in the upstream mcp-web crate is tracked in MCPWEB-9 and is out of scope here.

#FJ-69
David merged commit ae872fffb4 into main 2026-08-02 17:24:33 +02:00
David deleted branch chore/doc-formatting 2026-08-02 17:24:33 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pandoras-box/forgejo-cli!89
No description provided.