diff --git a/__pycache__/gopass.cpython-312.pyc b/__pycache__/gopass.cpython-312.pyc index 56d1730..04322a5 100644 Binary files a/__pycache__/gopass.cpython-312.pyc and b/__pycache__/gopass.cpython-312.pyc differ diff --git a/gopass.md b/gopass.md index 867b4a2..71c32f1 100644 --- a/gopass.md +++ b/gopass.md @@ -238,14 +238,32 @@ clone under whichever it picks, and writes `env.sh` exporting one line to each host's *local* `~/.bashrc` (only on hosts where that backend is actually reachable for this account — neither mount is guaranteed reachable from literally everywhere; e.g. confirmed missing -on `saresb-cons-04` for `gac-bernina`'s `~/network_drives`): +on `saresb-cons-04` for `gac-bernina`'s `~/network_drives`) — put it +**near the top, before any "not interactive? return" guard**, so it also +reaches non-interactive invocations (cron, systemd units) and not just +interactive shells: ```bash -echo 'source /env.sh' >> ~/.bashrc +source /env.sh ``` ## Troubleshooting +- **Works fine most of the time, but the very first `gopass`/`gpg` command + in a brand-new terminal/session sometimes fails** (`not a recipient`, + `password-store is not initialized`, or similar), and simply retrying + (or running `gopass sync` first) makes it work: `~/network_drives` + (SMB, "Partially Shared Home") is mounted per login session, + asynchronously - on a session that isn't already warm (e.g. you don't + normally stay logged into that particular host), the mount can still be + settling when your first command runs, so it silently falls back to + this host's own empty local store instead. `env.sh` (written by + `gopass_bernina_setup.sh`/`gopass_bernina_service_setup.sh`) waits up + to 5s for this before exporting `GNUPGHOME`/`GOPASS_HOMEDIR` - re-run + the setup script to regenerate an older `env.sh` that predates this + fix. This looked at first like a host-specific bug (worked on one + console, not another) but was really about how warm/cold that host's + session was, not the host itself. - **`gopass clone` hangs forever** (stuck after "Gathering information for the git repository ..." with no error, no progress, and no child process doing visible work): a confirmed `gopass` bug/deadlock in its diff --git a/gopass_bernina_service_setup.sh b/gopass_bernina_service_setup.sh index 9f14e9d..cdc8043 100755 --- a/gopass_bernina_service_setup.sh +++ b/gopass_bernina_service_setup.sh @@ -196,7 +196,33 @@ fi # --- 4. write env.sh ---------------------------------------------------------- log "Step 4/5: writing ${ENV_FILE}" -cat > "${ENV_FILE}" < "${ENV_FILE}" < "${ENV_FILE}" <> ~/.bashrc" +echo " source ${ENV_FILE}" echo echo "Then open a fresh shell (or 'source ~/.bashrc') and confirm:" echo " gopass mounts # should show '${STORE_ALIAS}' with no error" diff --git a/gopass_bernina_setup.sh b/gopass_bernina_setup.sh index 1fac301..121bb7e 100755 --- a/gopass_bernina_setup.sh +++ b/gopass_bernina_setup.sh @@ -298,13 +298,40 @@ log " mounted and verified OK" # --- 6. env.sh + export pubkey + tell them what's left ----------------------- log "Step 6/6: writing ${ENV_FILE} and exporting your GPG public key" -cat > "${ENV_FILE}" < "${ENV_FILE}" < "${ENV_FILE}" < "${PUBKEY_FILE}" @@ -322,9 +349,13 @@ fi echo echo "======================================================================" echo "Add ONE line to this host's LOCAL ~/.bashrc (not shared - do this once" -echo "per host, or replace any older GNUPGHOME/GOPASS_HOMEDIR exports there):" +echo "per host, or replace any older GNUPGHOME/GOPASS_HOMEDIR exports there)." +echo "Put it NEAR THE TOP - before any '[are we interactive?] || return'" +echo "guard - so it also reaches non-interactive shells (VS Code Remote-SSH," +echo "cron, some Jupyter kernels), which would otherwise silently fall back" +echo "to this host's own empty local gopass store instead of erroring:" echo -echo " echo 'source ${ENV_FILE}' >> ~/.bashrc" +echo " source ${ENV_FILE}" echo if [[ "${ALREADY_RECIPIENT}" -eq 1 ]]; then echo "You're already an authorized recipient of '${STORE_ALIAS}' (${EMAIL}) -"