-
Notifications
You must be signed in to change notification settings - Fork 172
Refactor restic mount directory handling to use <working-dir>/<cluster>/mount as default path to prevent permission problem; update related tests and documentation. #1343
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
Conversation
…r>/mount as default path to prevent permission problem; update related tests and documentation.
Code Review: Restic Mount Directory Refactoring (PR #1343)SummaryThis PR refactors the restic mount directory handling to use a safer default path ( ✅ Strengths
|
…s for validation and cleanup.
|
@claude review my pull request |
|
Claude finished @caffeinated92's task in 1m 15s —— View job Code Review: Restic Mount Directory Refactoring✅ Overall AssessmentThis PR improves security and flexibility by changing the default restic mount location from 🔴 Critical Issues1. Missing Cluster Name in Default Mount PathSeverity: CRITICAL - Creates data collision risk between clusters In baseDir := filepath.Join(cluster.WorkingDir, resticDefaultMountSubdir)
mountDir := baseDir // ← BUG: No cluster name appended!Expected behavior (per test expectations at Impact:
Fix: Add cluster name to default path: baseDir := filepath.Join(cluster.WorkingDir, cluster.GetClusterName(), resticDefaultMountSubdir)
mountDir := baseDir2. Variable
|
…name check; simplify base directory assignment.
|
@claude review my pull request |
|
Claude finished @caffeinated92's task in 44s —— View job Code Review: Restic Mount Directory Refactoring (PR #1343)
SummaryThis PR successfully refactors restic mount directory handling from the system-wide Key finding: The ✅ Strengths
|
| File | Impact | Status |
|---|---|---|
cluster/cluster_bck.go |
Core path resolution logic | ✅ Correct |
server/api_restic.go |
API endpoint mount handling | ✅ Uses strict validation |
cluster/cluster_bck_test.go |
Added validation tests | ✅ Good coverage |
server/server.go |
Flag description update | ✅ Updated |
config/config.go |
Config field addition | ✅ Appropriate |
ResticMountSettings.jsx |
UI help text | ✅ Improved |
docs/swagger.json |
OpenAPI documentation | ✅ Updated |
✅ Verdict
APPROVED - This PR is ready to merge.
The implementation correctly addresses the security concerns from moving off /mnt/restic, with proper path resolution, escape detection, and a well-layered API design. The critical issue from the previous review (missing cluster name) has been resolved through the clear understanding that WorkingDir already includes the cluster name.
Key improvements:
- Reduced permission issues by using per-cluster directories
- Proper path safety validation prevents directory traversal
- Clean API design with permissive and strict resolution variants
- Comprehensive test coverage and documentation updates

This pull request updates the default location and configuration logic for restic FUSE mount directories to improve security and flexibility. The default base directory for restic mounts is now set to
<working-dir>/<cluster>/mountinstead of/mnt/restic, reducing the risk of permission issues. The logic for resolving relative and absolute paths for mount directories has been improved throughout the codebase, and documentation and help text have been updated to reflect these changes.Restic mount directory logic and configuration:
/mnt/resticto<working-dir>/<cluster>/mountin both code and configuration, including updating the constant and all usages. [1] [2]BackupResticMountDir: relative paths are now resolved under the new default base, and absolute paths are respected. Added informative logging when resolving relative paths. [1] [2]Documentation and user interface updates:
backup-restic-mount-dir. [1] [2] [3] [4]Test updates: