UndoHaven · Pricing · Docs · Plugins · Log gate · Encryption · What we see · Log in · Account · 中文

Why a backup of .credentials.yaml copies your API keys

Saved credentials are read from $DSH_HOME/.credentials.yaml first, then the process environment, then a project .env, then $DSH_HOME/.env. The file is YAML. The docs say it should be readable only by the current user. The agent runs as that same user, so the file mode does not hide the keys from the agent. Putting the file in an archive copies the keys in the clear.

Fix it by hand

  1. Quit dsh. When you tar the home, keep the excludes for .dsh/.credentials.yaml and .dsh/.env. A project .env outside the home is not in that tar, but the credential lookup will still read it.
  2. If you remove those excludes so you do not have to type keys again, chmod the archive so only you can read it. Do not send it through chat or a shared drive.
  3. To restore keys later, copy only .credentials.yaml out of the home you moved aside, and check the mode again. Do not drop the whole damaged tree back on top.
  4. The desktop settings JSON under %APPDATA% or ~/Library/Application Support is not this file and does not hold the session logs.

UndoHaven leaves .credentials.yaml and .env out of a snapshot unless you pass --include-credentials. That option is a Pro feature. The default local snapshot does not upload the home.

Optional encrypted snapshot

Optional. UndoHaven is an unofficial third-party, compatible with dsh. Copy the directory by hand first, then use an encrypted snapshot if you want one.

npx undohaven init

  1. Install: copy this command.
  2. First snapshot: it stays encrypted on this machine.
  3. Roll back: undohaven restore --to SNAPSHOT_ID

Free covers 7 days of history and 1 device. Pricing

Related