Repository navigation
fix(compose): the stdio token the gateway never got - #32
Merged
Merged
Conversation
The documented `--profile stdio` flow could not work. The shim's bearer is
resolved by the *gateway* — auth/upstream.go:91 reads secretRef from fold's
own environment — but compose passed SHIM_TOKEN only to the shim service,
leaving it commented out for fold. So the upstream failed to authenticate on
every start. Passed as ${SHIM_TOKEN:-}, which keeps the file's deliberate
property of having no compose-level required variables.
Also:
- make compose-up / compose-down / compose-logs, with a PROFILES variable
(default "stdio observability", PROFILES= for the gateway alone).
SHIM_TOKEN is generated into .env once rather than per invocation: a fresh
value on every `up` would leave the running shim rejecting the gateway
until both restart.
- gitignore fold.config.json, .env, and data/. The docs tell operators to
copy the example config to the repo root, which then sat untracked in
git status.
- Document both in docs/deploy.md and the README.
Verified end to end on this host: all four services up, the fold Prometheus
target scraping (no 403), the packaged dashboard loaded, and an MCP
initialize + tools/list through the gateway returning 14 tools namespaced
as files__*.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
The documented
--profile stdioflow (docs/deploy.md) could not work as shipped.The shim's bearer is resolved by the gateway, not the shim —
auth/upstream.go:91reads the upstream'ssecretReffrom fold's own environment. Butcompose.yamlpassedSHIM_TOKENonly to thestdioservice and left it commented out forfold, so the upstream failed to authenticate on every start.Now passed as
${SHIM_TOKEN:-}, which preserves the file's deliberate property of having no compose-level required variables (the:-default keepsdocker compose upclean for anyone not running the profile).Also
make compose-up/compose-down/compose-logs, with aPROFILESvariable — defaults tostdio observability,PROFILES=for the gateway alone.SHIM_TOKENis generated into.envonce rather than per invocation: a fresh value on everyupwould leave the running shim rejecting the gateway until both restart.fold.config.json,.env,data/. The docs tell operators to copy the example config to the repo root, which then sat untracked ingit status.docs/deploy.mdgains the make targets and the both-services explanation; README "Deploying" now lists all three profiles (it still said "an optional Redis profile", predating the stdio and observability profiles).No Go code changed; no config fields, schema, or defaults touched.
Verification
Ran the full stack on a local host — all four services up,
filesupstream connected, the fold Prometheus target scraping without the 403, the packaged Grafana dashboard loaded, and an MCPinitialize+tools/listthrough the gateway returning 14 tools correctly namespaced asfiles__*.🤖 Generated with Claude Code