Read the rclone config file named by RCLONE_CONFIG #374

Merged
clawbot merged 1 commits from issue-321-rclone-config-env into next 2026-10-14 00:39:33 +02:00
Collaborator

Fixes #321.

What was wrong: an rclone destination whose remote is defined only in the file RCLONE_CONFIG names failed with "rclone remote not found in config". rclone reads that variable only as the value of its --config flag. vaultik does not have that flag, so it always read rclone's default config file.

What changed: NewRcloneStorer now sets rclone's config file path from RCLONE_CONFIG whenever the variable is set, as the --config flag would. This happens before the config is loaded. A new test writes a config file defining a local remote, points RCLONE_CONFIG at it, and checks that a Put through that remote lands in the remote's directory.

Not obvious from the diff:

  • An empty RCLONE_CONFIG is applied too. rclone takes it to mean no config file (an in-memory config), and vaultik now does the same rather than falling back to the default file.
  • rclone keeps the config file path in a process-wide variable, so the new test puts the previous path back when it finishes.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/vaultik/issues/321. **What was wrong:** an rclone destination whose remote is defined only in the file `RCLONE_CONFIG` names failed with "rclone remote not found in config". rclone reads that variable only as the value of its `--config` flag. vaultik does not have that flag, so it always read rclone's default config file. **What changed:** `NewRcloneStorer` now sets rclone's config file path from `RCLONE_CONFIG` whenever the variable is set, as the `--config` flag would. This happens before the config is loaded. A new test writes a config file defining a `local` remote, points `RCLONE_CONFIG` at it, and checks that a `Put` through that remote lands in the remote's directory. **Not obvious from the diff:** - An empty `RCLONE_CONFIG` is applied too. rclone takes it to mean no config file (an in-memory config), and vaultik now does the same rather than falling back to the default file. - rclone keeps the config file path in a process-wide variable, so the new test puts the previous path back when it finishes. Model: opus-5-5
clawbot added the needs-review label 2026-10-14 00:26:45 +02:00
clawbot self-assigned this 2026-10-14 00:26:45 +02:00
clawbot added 1 commit 2026-10-14 00:26:45 +02:00
An rclone destination whose remote is defined only in the file
RCLONE_CONFIG names was reported as not found: rclone reads that
variable only as the value of its --config flag, which vaultik does not
have, so vaultik always used rclone's default config file.
NewRcloneStorer now sets rclone's config path from RCLONE_CONFIG when
the variable is set, as that flag would, including an empty value,
which rclone takes to mean no config file.

Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 8d5e6f3399 into next 2026-10-14 00:39:33 +02:00
clawbot deleted branch issue-321-rclone-config-env 2026-10-14 00:39:34 +02:00
Sign in to join this conversation.