Repository navigation
Description
Summary
backupStatus, backupList, backupDiff, backupRestore and volumeBackup run sudo restic -r <repo> ... without any way to supply the repository password. sudo strips RESTIC_PASSWORD/RESTIC_PASSWORD_FILE from the SSH session and there is no terminal to prompt on, so on the setup the skills describe (password kept in /etc/restic-env for the backup script) these tools fail.
Related: #87
Where
mcp-server/src/tools/backupStatus.ts:30mcp-server/src/tools/backupList.ts:30mcp-server/src/tools/backupDiff.ts:22mcp-server/src/tools/backupRestore.ts:40mcp-server/src/tools/volumeBackup.ts:29mcp-server/README.md:80(onlyHOMELAB_BACKUP_REPOis configurable)skills/backup-recovery/SKILL.md:32("Restic repository password (stored in MCP config or environment variable)"),:102(/etc/restic-env)
Details
homelab_backupRun works because it calls /opt/backup/backup.sh, which loads its own env file. The other restic tools call restic directly with only -r. The skill says the password can be "stored in MCP config", but no such setting exists.
Impact
Five backup tools, and the morning-health-check / pre-reboot-checklist prompts that call homelab_backupStatus, return restic password errors on a standard install instead of snapshot data.
Steps to reproduce
- Repository at
/mnt/backup/resticwhose password is only in/etc/restic-env(as the skill describes). - Call
homelab_backupStatus. - restic exits with a password error.
Suggested fix
- Add
HOMELAB_RESTIC_PASSWORD_FILE(path on the node, per-node overridable throughHOMELAB_NODESenv) and pass--password-file <path>on every restic call through one helper inmcp-server/src/utils/restic.ts. Optionally also support an env file to source (HOMELAB_RESTIC_ENV_FILE, for example/etc/restic-env) soRESTIC_REPOSITORYand remote-backend credentials work too. - Document it in
mcp-server/README.md,.env.exampleand the backup-recovery skill, and remove the "stored in MCP config" wording until it is true.
Acceptance criteria
- All restic-invoking tools pass the configured password file.
- A clear error names the setting when restic reports a missing password.
- Command tests assert the flag for each restic tool.
Getting started
- Relevant files:
mcp-server/src/utils/restic.ts, the five tool files above - How to run tests:
cd mcp-server && npm install && npm test
Filed by repo-audit/full-audit at a59395f. Severity: high. Effort: S. audit-key: bug|mcp-server/src/utils/restic.ts|resticPassword
Activity
TMHSDigital commentedon Nov 18, 2026
Fixed in c8605e0. All five restic tools now go through
resticCommand(), which sourcesHOMELAB_RESTIC_ENV_FILE(default/etc/restic-env) as root when present and passesHOMELAB_RESTIC_PASSWORD_FILEas--password-file; password failures name both settings. Verified with per-tool command tests, helper tests (363 passing), and by running the generatedsh -cwrapper against a stub restic.