feat: allow relative target paths for git mounts

- Remove absolute path requirement from target_path validation
- Resolve relative paths against working_directory at instance startup
- Fall back to /home/user if no working_directory is configured
- Update frontend to allow relative target paths
- Update spec to document relative path support
- Update tests to allow relative paths and test path traversal rejection
This commit is contained in:
Alex Blank
2026-05-27 15:01:16 +02:00
parent 8a58c61278
commit 33d08faf70
5 changed files with 15 additions and 10 deletions
@@ -16,7 +16,7 @@ The system SHALL allow config profiles to include git repository mounts that bin
- **THEN** the system validates that:
- `remote_url` is a valid git URL (starts with https://, git@, or ssh://)
- `source_path` is a relative path (no leading `/`)
- `target_path` is an absolute path (starts with `/`)
- `target_path` can be absolute (starts with `/`) or relative (resolved against working directory, defaulting to `/home/user`)
- `target_path` does not contain path traversal sequences (`..`)
- No database lookup or repository existence check is performed (validation is deferred to clone time)