rclone-webui-react
rclone-webui-react copied to clipboard
WebUI issue with proxy
copied from: https://github.com/rclone/rclone/issues/7059
What is the problem you are having with rclone?
When running rclone via docker-compose behind a nginx-proxy (Nginx Proxy Manager) there are some issues:
- After providing the login credentials at the web-login it is stuck.
- the logs give you the needed info
This is my docker-compose.yml:
rclone:
image: rclone/rclone
container_name: rclone
command: rcd --rc-web-gui --rc-addr :5572 --rc-user admin --rc-pass password
ports:
- "5572:5572"
volumes:
- /var/docker/config/rclone/data:/config/rclone:rw
- /var/docker/config/rclone/logs:/logs:rw
environment:
- PHP_TZ=Europe/Berlin
- PUID=1000
- PGID=1000
restart: unless-stopped
docker logs -f rclone
shows me:
ERROR : Failed to open Web GUI in browser: exec: "xdg-open": executable file not found in $PATH. Manually access it at: http://admin:password@[::]:5572/?login_token=###TOKEN###
I want to point the attention to this part in the log: [::]:5572
As I access the webui through my domain (rclone.domain.tld
) and this is getting proxied through Nginx, this does not work.
So if I take the URL http://admin:password@[::]:5572/?login_token=###TOKEN###
and replace the [::]:5572
part with rclone.domain.tld
this works just fine.
So it would be cool if we could set some additional environment variables like:
-
EXT_HOST
-
EXT_PORT
Which then (if available and set) are getting used to generate/form the URL. Then it should look like this:
http://admin:password@EXT_HOST:EXT_PORT/?login_token=###TOKEN###
Which in my case would be:
http://admin:[email protected]:443/?login_token=###TOKEN###
Which worked just fine. I think this is a Bug, but if you like, you can see it as a Feature Request. Anyways I also tried to change the --rc-addr
parameter to 443
so it matches my external port, but this did not work.
In general it would be cool, if the URL would not be generated with a wildcard [::]
IPv6, but if the value from the login form was taken?
Does this make sense? For me it at least would work.
I am open for discussion!
What is your rclone version (output from rclone version
)
rclone v1.62.2
- os/version: alpine 3.17.2 (64 bit)
- os/kernel: 6.1.0-9-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.2
- go/linking: static
- go/tags: none
Which OS you are using and how many bits (e.g. Windows 7, 64 bit)
OS: Debian SID
Kernel: 6.1.27-1 (6.1.0-9-amd64)
Docker: v24.0.2, build cb74dfc
Docker compose: v2.18.1
How to use GitHub
- Please use the 👍 reaction 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.
I also want to add, that I think it would be way more convenient to run it like this:
rclone:
image: rclone/rclone
container_name: rclone
ports:
- "5572:5572"
volumes:
- "/rclone/data:/config/rclone:rw"
- "/rclone/logs:/logs:rw"
environment:
- WEB=true # optional - just needed if webui wanted
- WEB_USER=admin # optional - just needed if webui wanted
- WEB_PASS=password # optional - just needed if webui wanted
- WEB_PORT=5572 # optional - just needed if webui wanted
- EXT_HOST=rclone.domain.tld # optional - just needed if proxied
- EXT_PORT=443 # optional - just needed if proxied
- PHP_TZ=Europe/Berlin
- PUID=1000
- PGID=1000
restart: unless-stopped
That would make it more like all other containers. If the WebUI would be build with golang aswell the whole image could be run in a docker-scratch container from one little binary - maybe worth a tought.
ERROR : Failed to open Web GUI in browser: exec: "xdg-open": executable file not found in $PATH. Manually access it at: http://admin:password@[::]:5572/?login_token=###TOKEN###
This is a harmless error. Rclone was trying to find a browser in your system. You can set RCLONE_RC_WEB_GUI_NO_OPEN_BROWSER=true env, then this error will go away
I want to point the attention to this part in the log:
[::]:5572
As I access the webui through my domain (rclone.domain.tld
) and this is getting proxied through Nginx, this does not work. So if I take the URLhttp://admin:password@[::]:5572/?login_token=###TOKEN###
and replace the[::]:5572
part withrclone.domain.tld
this works just fine.
This is expected behavior. Docker bridge network container doesn't have ipv6 network on default, so you can't visit via IPv6.
Just ignore this log output and visit via your nginx proxy.
That would make it more like all other containers. If the WebUI would be build with golang aswell the whole image could be run in a docker-scratch container from one little binary - maybe worth a tought.
This WebUI needs no binary, all files are static web assets. You can use any web server software like nginx / caddy to serve WebUI.