New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload from headless server #15
Comments
Glad you appreciate it ! I didn't have this case in mind when developing it, but I can try to work on that when I have the time. In the meantime for it to work you'd have to:
so... not exactly straightforward |
Also want to thank you for this tool, but also want to ask if you could implement a way to authenticate on a headless server. Would really like to use my VServer to automatically upload my photos to Google Photos. |
As an authentication workflow suggestion, check Grive. I don't specifically know their oauth workflow, but it asks the user to access a specific URL in their browser, where they authenticate and get a key in exchange, which has to be pasted to Grive in the command line. +1 from my side for headless uploading, I can create a cron job which kind of syncs my photos folder to GPhotos, especially when adding new photos. |
Any progress on headless to make it work like the python youtube upload script? It points me to an URL I could open on another PC. nmrshell, you said "insert the token manually into your keyring at the right key on the headless server" |
@vixing no progress at all yet as I'm in search of my next gig/job, which will steal a lot of time from me, but I intend to get back to it once that's done Also I don't think any of this would work on windows yet (because of the config file paths and because I make use of the MacOS keychain / Linux keyring in the code). I don't have a windows machine to test this so I assume it's completely broken on windows. |
I don't have any Mac or windows machines at home and run only Linux, as well as my desktop as on my Homeserver. My preferred workflow would be to copy new photos from my camera to the Photos share I have set up on my Homeserver, which would then be automatically synced to Google Photos. Currently I still need to open Google Photos in the browser and upload them manually, so a few less steps in the workflow, and a "copy on server and forget" would be great. |
Hi, in your instruction for headerless server
please explain in more detail last point exactly where i should insert token, sorry for english, I will be very grateful for the feedback! |
Hey @nmrshll I know linking to a spec and writing code are different things, but I remember an early version of Google Cloud Print Connector gave me a URL to copy-paste into a browser to authorize the app. It looks like the new version uses Google Sign-In for TVs and Devices which seems like it would be a good fit. Basically it generates a unique verification code that would be entered at https://www.google.com/device. The code then takes you to the proper auth page for the app. Hum. Let me look at the code. Maybe it might not be that hard to add in myself. |
I submitted a PR against your oauth project to add logs so the user can manually do the oauth steps on their main computer. |
Oh cool, thanks, that sounds useful ! Don't have a computer right now or
tomorrow but I should be able to have a look at this on tuesday.
There would still need a way to re-inject the token into the headless
uploader after the auth was done on your main computer, right ? I started
turning gphotos-uplader into a proper cli tool with options for several use
cases, this could be one.
…On Sun, Nov 25, 2018, 15:07 Nick Horvath ***@***.***> wrote:
I submitted a PR against your oauth project to add logs so the user can
manually do the oauth steps on their main computer.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGw1NLMgw0UlG1atX7rxbJWL9ZSNUpOlks5uyrIUgaJpZM4W8NqU>
.
|
Yes, the logs give instructions, saying you should curl the result url
manually on the headless machine. They can be made more clear if you don't
think they are.
On Sun, Nov 25, 2018 at 2:27 PM Nicolas Marshall <notifications@github.com>
wrote:
… Oh cool, thanks, that sounds useful ! Don't have a computer right now or
tomorrow but I should be able to have a look at this on tuesday.
There would still need a way to re-inject the token into the headless
uploader after the auth was done on your main computer, right ? I started
turning gphotos-uplader into a proper cli tool with options for several use
cases, this could be one.
On Sun, Nov 25, 2018, 15:07 Nick Horvath ***@***.***> wrote:
> I submitted a PR against your oauth project to add logs so the user can
> manually do the oauth steps on their main computer.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <
#15 (comment)
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AGw1NLMgw0UlG1atX7rxbJWL9ZSNUpOlks5uyrIUgaJpZM4W8NqU
>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKE3PX_JyI0osU-FSnFUrd1kAqT7I_4ks5uyu8TgaJpZM4W8NqU>
.
|
Any news on making this possible or instructions for doing this? |
Not yet but I'm working actively on fixing bugs and other improvements today. Though, I started with the most pressing stuff like the config init being broken and not uploading videos and gifs, hope that's all right |
Look at "bin/smregister" in https://github.com/marekrei/smuploader for a python headless way of configuring oauth |
Adding a comment here so I know when headless server uploading is possible... |
Hello Regards |
My fork dumps a url you can manually put in a browser.
|
Thanks, |
This project is used for the keystore https://github.com/zalando/go-keyring. Maybe take a look and see if you can find a way to provide a keyring it can use. Otherwise... install gnome-keyring. I don't think it depends on a full gnome setup to work. |
@rysi3k I created a fork that let's you store the oauth cred in the main db. This way it can run on a non-desktop linux vm |
I have a similar problem, to workaround I ran an X server on the remote desktop so I could see Chromium. However it tries to redirect to 127.0.0.1 after authentication and never connects. How do I get the resulting key? |
@tonymet Looked at your I'm working on a Docker Image for this tool and I believe that I have practically everything ready to build a working image. The only thing missing is a workaround to the keyring issue. Tried to install I don't think there's a workaround to this problem, the only solution is to use something else (like the main DB as @tonymet mentioned above) to store the authentication token. Note: My Docker Image doesn't solve the issue with the manual authentication process, that's still required so that the user can given consent to Google Photos access at least once. I've used @nhorvath work to workaround this, kudos to him. See here fore more details (just changed one little thing 😄). Hopefully we can workaround this keyring issue and have this amazing tool working on headless machines like a NAS (my own use case) or something. |
Need this nice feature too. |
@rfgamaral Sorry about the confusion I forgot that there were 2 components needed. See this commit: tonymet@8143d3b To make the build easy...
|
@rfgamaral
|
@tonymet Awesome work, I was finally to get everything up and running. After reading this thread a couple of times and experimenting everything I'll sum up the things that IMO should be done to accommodate different scenarios for for
For a), we could, perhaps, use ngrok to create a tunnel to a local server and allow "ngrok.io" in the OAuth consent page. This way we might be able to handle redirection automatically without requiring the user to If the "ngrok" solution doesn't work, I believe b) can be the most user friendly approach. The user starts the authentication process on the terminal, gets a simple URL to open and code to input on that page. On the server-side, Hope this summary helps :) |
In the meantime, if you have Docker on the machine you want to use Anyway, if you want to try my Docker image, please follow the link below and look at the instructions carefully: Feel free to open any issues with bugs, suggestions or whatever on the GitHub repository. Only if related to the Docker image, everything else belongs to |
@rfgamaral It's good to see there's demand for this use-case. @nmrshll built a great app, and I think this featureset could help expand it's use on a VM or server. For oauth, I like @darryllee's suggestion to use the Google login for TVs -- that way no public domain is needed. I'll start by formalizing the headless work into options that can be integrated into master gracefully. If someone wants to work on the google-login-for-tvs then we can meet in the middle and create a seamless "headless" feature out of it. |
I agree 😃
Awesome 🎊
Would love to help but my Go skills are practically none... Hopefully someone else can pitch in and help get that done while @nmrshll focus on other things. |
with some basic reading i found that the scopes for "oauth for tv" may be limited... https://developers.google.com/youtube/v3/guides/auth/devices#allowedscopes But i'm still optimistic -- i've seen other docs say that certain scopes are limited when they are not in fact (perhaps the docs are out of date). Still worth a try, just an fyi in case things don't work |
I can do the oauth stuff too it'd be a fun project...let's see if someone else chimes in otherwise I'm happy to work that component to. |
@rfgamaral awesome work with the docker version ! Thanks for the help ! |
@rfgamaral I think the oauth-for-devices won't work for this scope. i did testing with the scopes. here is an example testing just one and it fails with "invalid_scope"
|
Just tried it myself too, I guess the documentation is up to date 😆 The way I see it, there's a few alternatives to make the process as seamless as possible:
Both option 2 and 3 are a lot more work though... And none of them avoid the step of manually opening some sort of URL in a different machine/device with a browser. This will always be required for "headless" servers. EDIT: Forget about ngrok and Heroku, both |
Another things guys, this is issue discussion is getting quite big and there's a few, different, but related, steps required to make a fully functional headless version of this tool:
|
Hey everyone, I've been thinking about this issue, researching possible ideas, discussing it with @tonymet, etc... Here's the solution I propose:
What do you think guys? What about you @nmrshll? If this sounds like a good solution maybe @tonymet and/or @nhorvath could work on clean branches for this? I'd do it myself but I'd rather leave this to someone who is more comfortable with Go than me. |
When? |
Most of the issues that are described here has been fixed in @rfgamaral docker fork. |
First, thank you for developing this incredibly useful project.
018/09/27 09:03:22 You will now be taken to your browser for authentication
2018/09/27 09:03:23 failed authenticating new client
Not sure how to go past this, is there a way?
The text was updated successfully, but these errors were encountered: