google-drive-ocamlfuse
google-drive-ocamlfuse copied to clipboard
Cannot open url on any browser
I am trying to use google-drive-ocamlfuse on a vps without display (Ubuntu server 20.04 TLS) and its trying to opena browser, I tried to install chromium to avoid this issue, but then its trying to open chromium as getting error.
Check this comment (https://github.com/astrada/google-drive-ocamlfuse/issues/764#issuecomment-1076281507), maybe you can do the same.
I just ran into this on Ubuntu Server and #764 helped me out here. Follow the directions provided there by creating a web client with the redirect URI of http:127.0.0.1:8080/oauth2callback
. Then try running the command with these options:
google-drive-ocaml-fuse -id *CLIENT_ID* -secret *CLIENT_SECRET* -headless -redirect_uri http:://127.0.0.1:8080/oauth2callback
You should land on an error page after you've authenticated the application. This is where you can nab the verification code you need from the URL params of that address.
I literally just ran into this problem but didn't want to bother with creating a client, etc. My workaround: create a "firefox" executable that dumps the auth url somewhere I can grab and that I can easily close "remotely":
cat <<-EOF > ./firefox
#! /bin/env bash
echo "$@" > "${HOME}/url"
while ! [ -e "${HOME}/go" ]; do sleep 1; done
rm "${HOME}/go"
EOF
chmod a+x ./firefox
sudo mv ./firefox /usr/bin/firefox
... Now when you run google-drive-ocamlfuse
for auth, it halts while you cat
out the "url" file for copying, paste it into the browser on your actual desktop, run through auth, then touch ~/go
to terminate the "browser" so the tool can write the config file.
Hacky, yes... but it works, and it's faster and easier than creating a custom OAuth client. 🤷