Environment variable config not used for remote control

What is the problem you are having with rclone?

Configuring an instance of remote control instance of rclone with environment variables doesn't expose those variables in RC.

Run the command 'rclone version' and share the full output of the command.

$ rclone version
rclone v1.62.2
- os/version: darwin 13.3.1 (64 bit)
- os/kernel: 22.4.0 (arm64)
- os/type: darwin
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.20.2
- go/linking: dynamic
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

S3 (based on Ceph)

The command you were trying to run (eg rclone copy /tmp remote:tmp)

export RCLONE_CONFIG_CEPH_ACCESS_KEY_ID=xxxxxxxxxxxxx
export RCLONE_CONFIG_CEPH_SECRET_ACCESS_KEY=yyyyyyyyyyyyyy
export RCLONE_CONFIG_CEPH_TYPE=s3
export RCLONE_CONFIG_CEPH_ENDPOINT=https://myobjectstorage.example.org
export RCLONE_CONFIG_CEPH_PROVIDER=Other
export RCLONE_CONFIG_CEPH_ACL=private
rclone rcd --rc-user foo --rc-pass bar
$ rclone rc --user foo --pass bar config/listremotes
{
	"remotes": []
}

The rclone config contents with secrets removed.

export RCLONE_CONFIG_CEPH_ACCESS_KEY_ID=xxxxxxxxxxxxx
export RCLONE_CONFIG_CEPH_SECRET_ACCESS_KEY=yyyyyyyyyyyyyy
export RCLONE_CONFIG_CEPH_TYPE=s3
export RCLONE_CONFIG_CEPH_ENDPOINT=https://myobjectstorage.example.org
export RCLONE_CONFIG_CEPH_PROVIDER=Other
export RCLONE_CONFIG_CEPH_ACL=private

A log from the command with the -vv flag

$ rclone -vv rcd --rc-user foo --rc-pass bar
2023/06/14 10:32:19 DEBUG : rclone: Version "v1.62.2" starting with parameters ["rclone" "-vv" "rcd" "--rc-user" "foo" "--rc-pass" "bar"]
2023/06/14 10:32:19 INFO  : Using --user foo --pass XXXX as authenticated user
2023/06/14 10:32:19 NOTICE: Serving remote control on http://127.0.0.1:5572/
2023/06/14 10:32:21 DEBUG : rc: "config/listremotes": with parameters map[]
2023/06/14 10:32:21 NOTICE: Config file "/Users/mbaur/.config/rclone/rclone.conf" not found - using defaults
2023/06/14 10:32:21 DEBUG : rc: "config/listremotes": reply map[remotes:[]]: <nil>
2023/06/14 10:32:25 DEBUG : rc: "config/listremotes": with parameters map[]
2023/06/14 10:32:25 DEBUG : rc: "config/listremotes": reply map[remotes:[]]: <nil>
$ rclone -vv rc --user foo --pass bar config/listremotes
2023/06/14 10:32:25 DEBUG : rclone: Version "v1.62.2" starting with parameters ["rclone" "-vv" "rc" "--user" "foo" "--pass" "bar" "config/listremotes"]
{
	"remotes": []
}
2023/06/14 10:32:25 DEBUG : 6 go routines active

It doesn't expose them in rclone listremotes is the root of the problem.

I think there is an issue about that somewhere.

It would be relatively easy to fix - list remotes would just have to look for env vars named RCLONE_CONFIG_*_TYPE and list them as part of listremotes.

Do you want to have a go at that?

1 Like

I have tried as I need it too:). PR sent.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.