@@ -130,7 +129,15 @@ func writeError(path string, in rc.Params, w http.ResponseWriter, err error, sta
func (s *Server) handler(w http.ResponseWriter, r *http.Request) {
path := strings.TrimLeft(r.URL.Path, "/")
- w.Header().Add("Access-Control-Allow-Origin", "*")
+ allowOrigin := rcflags.Opt.AccessControlAllowOrigin
+ if allowOrigin != "" {
+ if allowOrigin == "*" {
+ fs.Logf(nil, "Warning: Allow origin set to *. This can cause serious security problems.")
+ }
+ w.Header().Add("Access-Control-Allow-Origin", allowOrigin)
+ } else {
+ w.Header().Add("Access-Control-Allow-Origin", s.URL())
+ }
// echo back access control headers client needs
//reqAccessHeaders := r.Header.Get("Access-Control-Request-Headers")
s.URL() is http://127.0.0.1:5572 on linux at least where go has resolved localhost to 127.0.0.1, whereas we are attempting to connect to http://localhost:5572 in the web ui by default.
Perhaps we should be using a URL synthesized from opt..HTTPOptions.ListenAddr here?
The problem is with the fact that we cannot predict if the request is coming from localhost or 127.0.0.1.
So I am adding a fix in the latest version of rclone-webui-react which will take the default URL from the browser instead of hard coding it.
The latest release v0.0.4 solves this issue. You can update to the latest version using the flag: - - rc-web-gui-update. Run using this flag only once, otherwise it will force download the files everytime you run rclone with this flag.
Something appears to have gone wrong with the release
2019/08/13 09:48:47 NOTICE: A new release for gui is present at https://github.com/rclone/rclone-webui-react/releases/download/v0.0.3/currentbuild.zip
2019/08/13 09:48:47 NOTICE: Downloading webgui binary. Please wait. [Size: 3812810, Path : /home/ncw/.cache/rclone/webgui/v0.0.3.zip]
very interesting project, the more I work with rclone the more I really like it
I updated to the latest beta version and the gui does come up but when I go to login the Login button is grey and does not allow one to click on it. when I click on verify I get a bad username / password message
yep, really cool software. very easy to create a new rclone config. very well done.
I tried to upload a file through the gui by clicking on the + button within Explorer and get the following error:
This remote cannot have empty directories.
When I click on Upload Media nothing happens and I suspect it is supposed to open Windows Explorer.
I used Rclone Browser with the same GCP storage Bucket and rclone configuration and was able to create a directory within the bucket itself.
can't wait for the final release to come out. really like what you have done.
Ok, I got both the current and beta versions of rclone installed and both are working well with Google Cloud Storage.
I am now testing out the rclone webgui on a virtual machine that is running in Google Cloud Compute Engine. It is Ubuntu 16.04 minimal Xenial. The command to launch the rclone web-gui works fine. Now I need to access the rclone web server component from an external IP address. I opened up the firewall for port 5572 but still cannot access the gui interface, which works great on my own Windows 10 machine when I am in fact also 127.0.0.1. Obviously on the Ubuntu Virtual Machine I can't access the rclone web-gui directly as all of the gui desktop experience stuff is not loaded which would allow me to open a local web browser and hit 127.0.0.1 on the machine running rclone rcd.
Anyone have any advice on access the rclone web-gui from a different machine/ip on the network I would appreciate your advice.
Hey @arnoldvilleneuve, thanks for taking the time to review this piece of software.
The upload file feature does not work directly yet. The + button only allows you to create directories. What you can do, is enter a local path in the explorer and you will be able to explore the local directories. Like this:
For accessing the web gui from a remote IP, you need to specify the public ip of your virtual machine using the flag --rc-addr=<ip_address>:<port_no>
I tried this on Ubuntu 16.04 on Amazon EC2 instance.
here is the issue. I am running a VM on Google Cloud Platform and from the Operating System's perspective it does not see the external ip address (see the IPconfig output in the attached image). The ping works because Google Cloud automatically NATs the public IP to the private IP in the background. But when I run the rclone rcd command it is expecting to be able to see within the Operating System the public IP assigned to it. The message "not in context" seems to indicate that rclone rcd cannot find the public IP address specified because the operating system does not know about it either.
Well, I have managed to configure VNC to tap into my Google Cloud Platform Linux Server that has the Gnome gui installed. The GCP Linux SSH Console of course does not allow you to access the Gnome gui but you can through a VNC session. With it I can now access the rclone web-gui locally on that host.