Open imthenachoman opened 2 years ago
It seems like it's the last build of rclone that is buggy and I suppose even incompatible with the web gui. Try to download a previuos version. It was working fine for me.
@redsector72 Are you using it in a Docker container?
@negative0 @ncw Sorry to bug but is this something you can help with?
If I had to guess, I'd say the issue is here: https://github.com/rclone/rclone/blob/3425726c503f7822508071b113e1cc5492d538e7/lib/oauthutil/oauthutil.go#L637
From https://github.com/skratchdot/open-golang/:
Open a file, directory, or URI using the OS's default application for that object type.
This works fine when you're on the machine rclone
is running on. But if you run rclone
in a container then open
won't do anything to the host machine.
Does this sound right?
So I guess rclone
GUI has to intercept the open request and open it on the user's browser.
Looks like https://github.com/rclone/rclone-webui-react/blob/9ed0e9e05b1805caa57d636fb590cf3413b44437/src/views/RemoteManagement/NewDrive/NewDrive.js#L485 is where a new config is created. So I guess it makes a post request to the webserver url config/create
(from https://github.com/rclone/rclone-webui-react/blob/9ed0e9e05b1805caa57d636fb590cf3413b44437/src/utils/API/endpoint.js#L87).
This, I assume, calls rclone's API: https://rclone.org/rc/#config-create.
Now, I assume that in the call to config/create
the data
object needs to include the authorization information from Google Drive. But I can't figure out where in the process that is supposed to be handled?
Looking through https://rclone.org/commands/rclone_config_create/, I think the process would be to call config/create
, which will return a question in JSON blob that then has to be answered in another call to config/create
.
@ncw Sorry to call you out but I'm hoping you can help me get some traction? I'm happy to modify the code but I need some guidance on how the GUI works.
I'd love to get the config create process working when running rclone in a Docker container.
Is there anyone that can help me with this?
I'd love to get the config create process working when running rclone in a Docker container.
I don't see how it can ever work.
You can't open a webbrowser window outside the container from within the container.
I don't see how it can ever work. You can't open a webbrowser window outside the container from within the container.
There would need to be some small logic changes in the code. Right now, from what I can tell, when you config a remote the code opens a URL. There should be an option to create a remote and have it return a JSON. That JSON has the information needed to finish the configuration (like the URL of the page to open). The caller would take that JSON, do what is needed, and make a second call to rclone
with return data to finish the config creation.
Then, the GUI would make the call using this new mechanism. It would take the JSON, send to the client (the browser) that would finish the auth, and then return the data back to rclone
.
Does that make sense?
I'm happy to see how I can make those tweaks but I have some questions about the rclone base and GUI code that I need to chat about.
Sorry, I misunderstood what you were trying to do
This problem has been solved in RCX by parsing the output of rclone config
as rclone prints the URL that needs to be opened in the JSON response.
However that doesn't work when configuring things over the rc so won't work for the GUI.
So what needs to happen is that rclone returns the URL in the JSON response instead of logging it
2022/08/09 17:45:54 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=upS8NlYieyGev9BohN-hpQ
We got nearly all the way there with RCX in this issue: https://github.com/rclone/rclone/issues/3455
But that last little - "Open this brower window to continue" state has eluded us.
The config state machine for the oauth is here
So what I'd suggest is that GUI sets a config key, say config_no_open_browser
and we check that here
That would probably mean splitting that state config state in half, and getting the first half to start the webserver and return the URL needed (and probably the URL to redirect to) and the second half to stop the webserver.
The redirect URL would need to point at the IP address of the docker container so rclone received the response. I think RCX runs their own webserver to do this. This might be a bit tricky to arrange.
So to sum that up - not easy - but it would be a worthwhile thing to do.
I'd love to get the config create process working when running rclone in a Docker container.
I don't see how it can ever work.
You can't open a webbrowser window outside the container from within the container.
Overseer, running in Docker, opens a browser window to login with Plex.
This problem has been solved in RCX
What is RCX?
So to sum that up - not easy - but it would be a worthwhile thing to do.
Agreed.
I am not completely following on everything you said, or what is mentioned in that other issue but my thought is the flow would be like this:
Does that make sense or do I have it completely wrong?
What is the problem you are having with rclone?
I am running rclone gui from a Docker container. I can browse configs fine. I am trying to add one for Google Drive and I am getting a 500 error. It creates the config but never finishes the creation process. It should open a new window so I can auth the Google Drive but it never opens that window.
Run the command 'rclone version' and share the full output of the command.
Which cloud storage system are you using? (eg Google Drive)
Google Drive
The command you were trying to run (eg
rclone copy /tmp remote:tmp
)n/a - using GUI
The rclone config contents with secrets removed.
it is empty
A log from the command with the
-vv
flagScreenshots
Creating a new config:
Before clicking
Next
Error after clicking
Next
Console error after clicking
Next
Config was created but never finished -- it didn't open a new window to auth: