From a0d2da4587d2303586cbaa7d6222af6ffd82cf13 Mon Sep 17 00:00:00 2001 From: Muse Sweep Date: Sat, 31 Oct 2026 20:58:57 +0000 Subject: [PATCH] github-backup: portable Bitwarden env in drain wrapper The laptop has no ~/tools/bws-env.sh (that is the sandbox path); its bws-env.sh lives in ~/hatch/tools and bws also reads ~/.config/bws/access-token. Source whichever exists. --- infra/github-backup/systemd/drain-wrapper.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/infra/github-backup/systemd/drain-wrapper.sh b/infra/github-backup/systemd/drain-wrapper.sh index cb1a008a51..5bd6c00ffb 100755 --- a/infra/github-backup/systemd/drain-wrapper.sh +++ b/infra/github-backup/systemd/drain-wrapper.sh @@ -4,7 +4,13 @@ # see ../config.json). Values pass through the environment only and are # never written to disk. set -euo pipefail -source ~/tools/bws-env.sh +# Bitwarden env: sandbox keeps bws-env.sh in ~/tools, the laptop in +# ~/hatch/tools, and bws itself reads ~/.config/bws/access-token. +if [ -f ~/tools/bws-env.sh ]; then source ~/tools/bws-env.sh; +elif [ -f ~/hatch/tools/bws-env.sh ]; then source ~/hatch/tools/bws-env.sh; +elif [ -f ~/.config/bws/access-token ]; then + export BWS_ACCESS_TOKEN="$(cat ~/.config/bws/access-token)" +fi eval "$(python3 - <<'PY' import json, subprocess lst = json.loads(subprocess.run(["bws", "secret", "list"],