Entware / Entware

Ultimate repo for embedded devices
https://entware.net
Other
2.27k stars 155 forks source link

grive daily limit for unauthenticated use exceeded #187

Closed amplatfus closed 5 years ago

amplatfus commented 5 years ago

Package request

{Add instruction for replacing the OAuth2 client}


Hi, Grive is not working any more with older authentication method. I saw here some commits in order to resolve this issue. https://github.com/vitalif/grive2/pull/242/commits

Could you please update it on Entware too?

Thank you so much!

zyxmon commented 5 years ago

done via https://github.com/Entware/rtndev/commit/38d2ccb41f50edd45cad6a91e1d7ed7c5c1b90e3

amplatfus commented 5 years ago

Hi,

Thank you for files. Could you please help me to obtain the ipk file? I mention that I have entware-ng armv7.

I appreciate your answer, All the best!

zyxmon commented 5 years ago

I mention that I have entware-ng armv7.

Entware-ng is not supported. If you run opkg update; opkg upgrade 2 times your entware-ng will update to Entwate. Probably this was already done.

Test package for armv7sf-k2.6 is here http://bin.entware.net/armv7sf-k2.6/test/grive2_0.5.1-20180819-2_armv7-2.6.ipk

amplatfus commented 5 years ago

Thank you. The source for opkg update is http://pkg.entware.net/binaries/armv7/ where the current version is older than from your link.

I would have needed the latest changes merged because the older authentication method was changed by Google. The one from test package link you send seems to be older than this. The commits here are newer https://github.com/vitalif/grive2/pull/242/commits and included already here but not as ipk.

I understood you are not supporting Entware-ng, but I was wondering if it will be new packages there and who else is doing this or if is stopped forever and it would be no more updates even from somebody else.

Thank you so much for entire support!

zyxmon commented 5 years ago

PR 242 is included in test package.

amplatfus commented 5 years ago

Super. Thanks again!

amplatfus commented 5 years ago

Hi, I did opkg update; opkg upgrade 2 times and now I have grive version 0.5.1-dev Sep 8 2018 20:33:38

PR 242 seems to be implemented in this version, but not working. After grive -a --id client_id --secret client_secret (when all is working well) at the next sync with grive command: grive I obtain the error below: Could you please provide some help? Thank you so much!

Failed to refresh auth token: HTTP 401, body: {
  "error": "unauthorized_client",
  "error_description": "Unauthorized"
}
exception: /media/ware/Entware.2018.09/build_dir/target-arm_cortex-a9_glibc-2.23_eabi/grive2-0.5.1-20180819/libgrive/src/protocol/OAuth2.cc(116): Throw in function void gr::OAuth2::Refresh()
Dynamic exception type: boost::exception_detail::clone_impl<gr::OAuth2::AuthFailed>
[gr::expt::BacktraceTag*] = #0 0x9362c grive gr::OAuth2::AuthFailed::AuthFailed()
#1 0x931c4 grive gr::OAuth2::Refresh()
#2 0x933cc grive gr::OAuth2::OAuth2(gr::http::Agent*, std::string const&, std::string const&, std::string const&)
#3 0x4b520 grive Main(int, char**)
#4 0x49924 grive main
#5 0x2b1a6c00 /opt/lib/libc.so.6 __libc_start_main
zyxmon commented 5 years ago

@amplatfus - please contact the author of PR.

zyxmon commented 5 years ago

http://bin.entware.net/armv7sf-k2.6/test/grive2_0.5.1-20180819-3_armv7-2.6.ipk This is test package using @jankatins fork of grive with some Entware patches added. Please try it.

amplatfus commented 5 years ago

http://bin.entware.net/armv7sf-k2.6/test/grive2_0.5.1-20180819-3_armv7-2.6.ipk This is test package using @jankatins fork of grive with some Entware patches added. Please try it. Yes, I did installed now the test version http://bin.entware.net/armv7sf-k2.6/test/grive2_0.5.1-20180819-3_armv7-2.6.ipk and even I did also a restart I have no output at any command with grive entered. Below are the commands I tried after restart and no error/ ouput after them: Could you please advice further? Thank you so much!

user@router:/tmp/mnt/folder/drive# grive
user@router:/tmp/mnt/folder/drive# grive -a
user@router:/tmp/mnt/folder/drive# grive -h
user@router:/tmp/mnt/folder/drive# grive -a --id id --secret secret
user@router:/tmp/mnt/folder/drive# 
zyxmon commented 5 years ago

The version from the repo works for me. It looks like no changes to grive are needed. A am rolling back the last commit.

@amplatfus - just run opkg remove grive2; opkg install grive2 - this will install the old version.

amplatfus commented 5 years ago

Thanks. Please with repo version if you try second sync it works too? All the best!

user@router:/tmp/mnt/folder/drive# opkg remove grive2
Removing package grive2 from root...
user@router:/tmp/mnt/folder/drive# opkg install grive2
Installing grive2 (0.5.1-20180819-1) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/grive2_0.5.1-20180819-1_armv7-2.6.ipk
Configuring grive2.
user@router:/tmp/mnt/folder/drive#
amplatfus commented 5 years ago

I am back again. Below you can find grive -a --id client_id --secret client_secret first sync (worked ok) and the second with grive only (not working) using repo version. Please, in your case is working with grive only, without parameters, at the second sync? I mention that in .grive file from sync folder I can see only refresh_token without id or secret.

Thanks! All the best!

user@router:/tmp/mnt/folder/drive# grive -a --id id.apps.googleusercontent.com --secret secret
-----------------------
Please go to this URL and get an authentication code:
https://accounts.google.com/o/oauth2/auth?codeetc.apps.googleusercontent.com
-----------------------
Please input the authentication code here: 
324343key
Reading local directories
Reading remote server file list
Synchronizing files
sync "./Google Photos/2018/12/MOVIE.mp4" changed in remote. downloading
sync "./.grive-new_v1" created in remote. creating local
sync "./.grive_last_v1" created in remote. creating local
sync "./.grive (another copy)" created in remote. creating local
sync "./.grive (copy)" created in remote. creating local
sync "./.grive_test" created in remote. creating local
sync "./.grive_state (copy)" created in remote. creating local
Finished!
user@router:/tmp/mnt/folder/drive# grive
Failed to refresh auth token: HTTP 401, body: {
  "error": "unauthorized_client",
  "error_description": "Unauthorized"
}
exception: /media/ware/Entware.2018.09/build_dir/target-arm_cortex-a9_glibc-2.23_eabi/grive2-0.5.1-20180819/libgrive/src/protocol/OAuth2.cc(116): Throw in function void gr::OAuth2::Refresh()
Dynamic exception type: boost::exception_detail::clone_impl<gr::OAuth2::AuthFailed>
[gr::expt::BacktraceTag*] = #0 0x9362c grive gr::OAuth2::AuthFailed::AuthFailed()
#1 0x931c4 grive gr::OAuth2::Refresh()
#2 0x933cc grive gr::OAuth2::OAuth2(gr::http::Agent*, std::string const&, std::string const&, std::string const&)
#3 0x4b520 grive Main(int, char**)
#4 0x49924 grive main
#5 0x2b195c00 /opt/lib/libc.so.6 __libc_start_main
user@router:/tmp/mnt/folder/drive# 
zyxmon commented 5 years ago

We will compile the new release of the gdrive when it will updated and checked by the author. Or when there is a working fork. For me it works on an arm router:

~# grive
Reading local directories
Reading remote server file list
Synchronizing files
sync "./.ash_history" changed in local. uploading
sync "./1.sh" changed in local. uploading
Finished!
amplatfus commented 5 years ago

Thank you for support and for confirmation that in your case grive works after creating .grive file. All the best!

amplatfus commented 5 years ago

Hi,

With some help (Source: https://github.com/vitalif/grive2/pull/242#issuecomment-447681785) I found what I was doing wrong: after authorization id and secret are need it every time like this and works on repo version: I entered first: grive -a --id 123-xyz.apps.googleusercontent.com --secret DE6XYZ And after, every time I want to sync: grive --id 123-xyz.apps.googleusercontent.com --secret DE6XYZ And is working. All the best!