baurmatt
(Matthias Baur)
June 14, 2023, 8:34am
1
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
ncw
(Nick Craig-Wood)
June 14, 2023, 2:10pm
2
It doesn't expose them in rclone listremotes
is the root of the problem.
I think there is an issue about that somewhere.
opened 01:01PM - 05 Nov 22 UTC
#### The associated forum post URL from `https://forum.rclone.org`
I have not… found any mention of that issue on the forum, or on existing issues
#### What is the problem you are having with rclone?
I'm using `rclone rcd` on a kubernetes cluster to move my backups around and out of the cluster.
The rclone rcd have the following env vars:
```
env | grep RCLONE_CONFIG
RCLONE_CONFIG_INTERNAL_PROVIDER=Minio
RCLONE_CONFIG_INTERNAL_TYPE=s3
RCLONE_CONFIG_INTERNAL_ACCESS_KEY_ID=bH0t8Cb4b8UrPpXV
RCLONE_CONFIG_INTERNAL_SECRET_ACCESS_KEY=GMBGlXPVsLzCzzQnohBL86Il
RCLONE_CONFIG_INTERNAL_ENDPOINT=https://minio.foundation
```
> Those are temporary credentials, this is not a leak :)
Despite the variables being defined correctly running `rclone rc config/listremotes` returns an empty array.
If I use `--rc-serve`, the remote is correctly listed and working.
If I try to access the remote using `operations/list` it works correctly.
I've found this extremely confusing and spent a few hours trying to debug something that was actually working.
It seems the function `config.FileSections()` is not called when the `listremotes` operation is called via rc.
So essentially my question is: is it a bug or a feature ?If this is expected behavior, I'd like to see something added in the doc to save the next fellow the few hours I've lost. If this is a bug, let's try to fix it ?
#### What is your rclone version (output from `rclone version`)
```
rclone v1.60.0
- os/version: alpine 3.16.2 (64 bit)
- os/kernel: 5.4.0-122-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.19.2
- go/linking: static
- go/tags: none
```
#### Which OS you are using and how many bits (e.g. Windows 7, 64 bit)
The official rclone docker image
#### Which cloud storage system are you using? (e.g. Google Drive)
S3, but probably irrelevant here
#### How to use GitHub
* Please use the 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to show that you are affected by the same issue.
* Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
* Subscribe to receive notifications on status change and new comments.
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.
rclone:master
← kapitainsky:rc_env_remotes
opened 03:02PM - 14 Jun 23 UTC
Fixes:
#6540
Discussed:
https://forum.rclone.org/t/environment-variable-co… nfig-not-used-for-remote-control/39014
2 Likes
system
(system)
Closed
July 14, 2023, 3:03pm
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.