I have a general question about precedence rules for rclone configuration. I'm extending a NixOS module for restic to add rclone functionality, and in it I'm providing options to set both environment variables and read from a configuration file.
My question is this: Suppose I have a remote called remoteA, and in rclone.conf I set it to be of type local. Now suppose I set an environment variable in my shell with RCLONE_CONFIG_REMOTEA_TYPE=s3. (This isn't the most realistic example, but it illustrates my point.) When I run rclone to interact with remoteA, rclone thinks it's an S3 remote, meaning the environment variable takes precedence over the value set in the config file. Is this intended behavior?
Are values set in environment variables supposed to take precedence over/override the same values set in a config file?
What is your rclone version (output from rclone version)
1.52.1
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Thanks! I was looking through the codebase for a bit to see if I could find it myself, but only managed to find where options were declared, not where they were merged. Appreciate the link to the code.
The docs at Documentation didn't quite make it clear how precedence was handled, so this helps clear things up. Maybe include that in the page?
Ah, so if a user did supply a config file, they should supply one that root or the rclone user can write to? If so, I'll make a note of that in the module.