Skip to content

feat(pbs): load relay headers from a secret file or env var - #498

Merged
JasonVranek merged 2 commits into
mainfrom
feat/relay-header-secrets
Sep 14, 2026
Merged

feat(pbs): load relay headers from a secret file or env var#498
JasonVranek merged 2 commits into
mainfrom
feat/relay-header-secrets

Conversation

@JasonVranek

Copy link
Copy Markdown
Collaborator

Summary

A relay's custom headers, which is how a relay X-Api-key is supplied, can now come from a secret file or an environment variable instead of the config file:

headers = { X-Api-Key = { file = "/run/secrets/relay-key" } }
# or: headers = { X-Api-Key = { env = "RELAY_API_KEY" } }
# or: headers = { X-Api-Key = "literal" }   # unchanged

The value is read when the relay client is built, at startup and on every config reload, so a rotated secret is picked up by a reload.

Header values are marked sensitive so they never appear in debug output, and a literal never appears in the config's Debug. A header loaded from a secret logs its source and a 4-byte fingerprint of the value, never the value, so a rotation is visible across reloads.

commit-boost init mounts every file path read-only into the PBS container at the same path and passes every env variable through from the compose environment, for default and mux relays alike. A relative or missing file fails init rather than producing a compose file docker fills with a root-owned directory.

@JasonVranek
JasonVranek requested a review from a team September 11, 2026 02:44
Comment thread crates/cli/src/docker_init.rs
@JasonVranek
JasonVranek force-pushed the feat/relay-header-secrets branch from f1de14f to eb3551f Compare September 14, 2026 15:25
@JasonVranek
JasonVranek merged commit 3b0b051 into main Sep 14, 2026
4 checks passed
@JasonVranek
JasonVranek deleted the feat/relay-header-secrets branch September 14, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants