An rclone:// path to a local remote resolves against the working directory #465

Open
opened 2026-11-19 08:03:26 +01:00 by clawbot · 1 comment
Collaborator

Found by the acceptance test (#418), testing rclone destinations on next at d747dde.

Steps to reproduce

  • Define a local remote in the rclone config: [localfs] with type = local.
  • Set storage_url to rclone://localfs/srv/backup, the form the README shows (rclone://remote/path).
  • Run vaultik snapshot create from /home/user.

What happened

The backup exits 0 and is written to /home/user/srv/backup. parseRcloneURL (internal/storage/url.go) strips the path's leading slash, so vaultik opens localfs:srv/backup. rclone resolves that against the working directory, and its local backend creates the directory. Run from another directory, snapshot list warns directory not found and shows only the local index, and snapshot create is refused for the missing vaultik-destination.txt. Only rclone://localfs//srv/backup reaches /srv/backup, and the README does not mention that form.

A relative file:// path is refused when the config loads for the same reason (#299).

What should happen

An rclone destination never depends on the working directory. Suggested: refuse a relative path on a remote whose backend is local, with an error that shows the absolute form, and say in the README that rclone://remote//absolute/path gives an absolute path. Keeping the leading slash would also fix it, but would move rclone://sftp-remote/backups from the login directory to /backups.

Not blocking: once a snapshot exists, the destination marker stops a backup from the wrong directory. Worth fixing before 1.0.

Model: opus-5-5

Found by the acceptance test (https://git.eeqj.de/sneak/vaultik/issues/418), testing rclone destinations on `next` at `d747dde`. **Steps to reproduce** - Define a local remote in the rclone config: `[localfs]` with `type = local`. - Set `storage_url` to `rclone://localfs/srv/backup`, the form the README shows (`rclone://remote/path`). - Run `vaultik snapshot create` from `/home/user`. **What happened** The backup exits 0 and is written to `/home/user/srv/backup`. `parseRcloneURL` (`internal/storage/url.go`) strips the path's leading slash, so vaultik opens `localfs:srv/backup`. rclone resolves that against the working directory, and its local backend creates the directory. Run from another directory, `snapshot list` warns `directory not found` and shows only the local index, and `snapshot create` is refused for the missing `vaultik-destination.txt`. Only `rclone://localfs//srv/backup` reaches `/srv/backup`, and the README does not mention that form. A relative `file://` path is refused when the config loads for the same reason (https://git.eeqj.de/sneak/vaultik/issues/299). **What should happen** An rclone destination never depends on the working directory. Suggested: refuse a relative path on a remote whose backend is `local`, with an error that shows the absolute form, and say in the README that `rclone://remote//absolute/path` gives an absolute path. Keeping the leading slash would also fix it, but would move `rclone://sftp-remote/backups` from the login directory to `/backups`. Not blocking: once a snapshot exists, the destination marker stops a backup from the wrong directory. Worth fixing before 1.0. Model: opus-5-5
clawbot self-assigned this 2026-11-19 08:03:26 +01:00
Author
Collaborator

PR: #475 (branch issue-465-rclone-local-absolute-path).

Took the suggested fix. A relative or empty path on a remote of type local is refused when the destination opens, and the error shows the absolute form (rclone://localfs//srv/backup). Other remotes keep relative paths. The README now explains the second-slash form.

Model: opus-5-5

PR: https://git.eeqj.de/sneak/vaultik/pulls/475 (branch `issue-465-rclone-local-absolute-path`). Took the suggested fix. A relative or empty path on a remote of type `local` is refused when the destination opens, and the error shows the absolute form (`rclone://localfs//srv/backup`). Other remotes keep relative paths. The README now explains the second-slash form. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/vaultik#465