Repository navigation
fix(openclaw): land sops-nix secrets on main + repoint wrappers to /run/secrets/openclaw (#1558) #2871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
fix(openclaw): land sops-nix secrets on main + repoint wrappers to /run/secrets/openclaw (#1558) #2871
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { lib, ... }: | ||
| let | ||
| userSecret = key: { | ||
| inherit key; | ||
| sopsFile = lib.from-root "secrets/sops/common/bws.yaml"; | ||
| owner = "user"; | ||
| mode = "0400"; | ||
| }; | ||
| in | ||
| { | ||
| # OpenClaw gateway + channel tokens. Bitwarden Secrets Manager is the | ||
| # source of truth; lib/bws-to-sops.sh mirrors every bws secret into | ||
| # secrets/sops/common/bws.yaml (age-encrypted to this host). sops-nix | ||
| # decrypts these at system activation to /run/secrets/openclaw/*, | ||
| # where the openclaw-gateway user service reads them through the | ||
| # wrapper's file-based environment (see home/openclaw). | ||
| sops.secrets = { | ||
| "openclaw/gateway-token" = userSecret "openclaw.gateway-token"; | ||
| "openclaw/slack-bot-token" = userSecret "openclaw.slack-bot-token"; | ||
| "openclaw/slack-app-token" = userSecret "openclaw.slack-app-token"; | ||
| }; | ||
| } |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When applying the declared
nixos(Intel) host, these new token paths are never provisioned:nixos/hosts/default.nixincludesuseron both hosts, andnixos/users/user/default.nix→home/user/default.niximports OpenClaw unconditionally, but onlyamdimports the new secrets module. An Intel deployment using the previous machine-local token files therefore loses its gateway and Slack credentials after this change. Either provision the secrets wherever OpenClaw is enabled or scope the new paths and OpenClaw configuration toamd.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disposition: valid multi-host concern, not fixable inside this PR — tracked as a follow-up (filed from queue task 1640).
Why provisioning the secrets on the
nixos(Intel) host is not an option today:secrets/sops/common/bws.yamlhas exactly one age recipient (age125ac…, anchored&laptop-frameworkin.sops.yaml), and the module this PR lands says why: "age-encrypted to this host". Host sops keys derive from each host's SSH host key (nixos/sops/default.nix: age.sshKeyPaths), so the Intel host holds a different key and cannot decrypt bws.yaml. Adding the secrets module there would make sops-nix fail during Intel activation — strictly worse than the current state.home/openclaw/workspace/CHANNELS.mddocuments the Control UI on the amd tailnet host, and PR OpenClaw secrets via sops-nix (bws mirror) #1242 deliberately named the moduleamd-openclaw-secrets.nix. Issue fix(openclaw): PR #1242's sops-nix secrets landed on a stranded feature branch — not on main, and the promised /run/secrets/openclaw wrapper repoint was never filed #1558's acceptance is scoped to "the target host" (amd)..sops.yamlalready carries the underlying TODO: "separate keys for other hosts, don't share" — per-host keys are the prerequisite for provisioning anywhere else.The one real regression path the finding identifies — an Intel deployment that manually created
~/.secrets/openclaw/*— is exactly what the follow-up issue covers: audit whether the Intel host runs the gateway, and either add its key as a bws.yaml recipient + import the secrets module there, or scope the OpenClaw home module to amd.This PR therefore keeps the amd-only provisioning that #1242 designed; merging it does not change the Intel host's ability to decrypt anything, and its gateway (if any) is the follow-up's subject, not silently dropped here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow-up from task 7989 at current main (
7d3dbd0): the source still includeshome/openclawfor bothnixosandamd, while onlyamdimports the OpenClaw sops secrets. PR #2871 is merged and issue #2875 remains the active follow-up. I could not verify Intel runtime service state or legacy~/.secrets/openclaw/*:ssh nixosdoes not resolve from this laptop, and Tailscale shows only localamd-6. The issue is blocked pending reachable-host/read-only runtime evidence; do not add Intel sops provisioning without a per-host age recipient.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outcome (task 17504, 2026-11-16): this thread is now closed by PR #10777, merged as
be7c0be. The gateway unit (home/openclaw/default.nix) carriesConditionPathExists = /run/secrets/openclaw/gateway-token, so the Intelnixoshost — which imports the home module but not the amd-only sops secrets — skips the unit quietly instead of crash-looping; amd is unchanged. Verified at current main. Residual question (should the Intel host run the gateway at all, i.e. provision its age recipient) stays open on issue #2875 pending Drew — the host is still absent from the tailnet andnixosdoes not resolve from the fleet.