Skip to content
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

[FEATURE] Support for service accounts #122

Open
Akianonymus opened this issue Oct 29, 2020 · 7 comments
Open

[FEATURE] Support for service accounts #122

Akianonymus opened this issue Oct 29, 2020 · 7 comments

Comments

@Akianonymus
Copy link
Collaborator

Akianonymus commented Oct 29, 2020

Reference: https://cloud.google.com/iam/docs/service-accounts

To upload more than 750gb per day.

@Akianonymus Akianonymus self-assigned this Oct 29, 2020
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Oct 30, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Oct 30, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
@Akianonymus
Copy link
Collaborator Author

@renatowow14

I have created a pull request for service accounts: #123

Install ( reinstall ) test_gupload

curl --compressed -Ls https://github.com/Akianonymus/google-drive-upload/raw/wip/install.sh | sh -s -- --uninstall -c test_gupload
curl --compressed -Ls https://github.com/Akianonymus/google-drive-upload/raw/wip/install.sh | sh -s -- -c test_gupload -B wip -r Akianonymus/google-drive-upload

How to generate service accounts: https://github.com/Akianonymus/google-drive-upload/tree/wip#generating-service-account-credentials

How to use it: https://github.com/Akianonymus/google-drive-upload/tree/wip#for-service-accounts

Test and report.

Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Oct 30, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
@Akianonymus Akianonymus linked a pull request Oct 30, 2020 that will close this issue
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Oct 30, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Oct 30, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Oct 30, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Oct 30, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Oct 30, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Oct 30, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Oct 30, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Oct 30, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
@renatowow14
Copy link

@ renatowow14

Eu criei uma solicitação pull para contas de serviço: # 123

Instalar (reinstalar) test_gupload

curl --compressed -Ls https://github.com/Akianonymus/google-drive-upload/raw/wip/install.sh | sh -s -- --uninstall -c test_gupload
curl --compressed -Ls https://github.com/Akianonymus/google-drive-upload/raw/wip/install.sh | sh -s -- -c test_gupload -B wip -r Akianonymus/google-drive-upload

Como gerar contas de serviço: https://github.com/Akianonymus/google-drive-upload/tree/wip#generating-service-account-credentials

Como usar: https://github.com/Akianonymus/google-drive-upload/tree/wip#for-service-accounts

Teste e relatório.

Okay, I'll try and bring the results.

Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Nov 3, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Nov 3, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Nov 3, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Nov 4, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Nov 4, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Nov 4, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Nov 4, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Nov 4, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
@renatowow14
Copy link

renatowow14 commented Nov 5, 2020

@renatowow14

I have created a pull request for service accounts: #123

Install ( reinstall ) test_gupload

curl --compressed -Ls https://github.com/Akianonymus/google-drive-upload/raw/wip/install.sh | sh -s -- --uninstall -c test_gupload
curl --compressed -Ls https://github.com/Akianonymus/google-drive-upload/raw/wip/install.sh | sh -s -- -c test_gupload -B wip -r Akianonymus/google-drive-upload

How to generate service accounts: https://github.com/Akianonymus/google-drive-upload/tree/wip#generating-service-account-credentials

How to use it: https://github.com/Akianonymus/google-drive-upload/tree/wip#for-service-accounts

Test and report.

I set up the service account and generated the key and downloaded the .json file. I am informed of it with the syntax -sa it is correct, right?

-> test_gupload -sa /root/backup_lapig_gdrive_chave_de_acesso.json folder_name

I'm sending the data, but it doesn't appear in my google drive account, I tried to browse the drive but I couldn't find it, when trying to access the link that generates access after going up, he asks to request access to the owner, I'm confused

@renatowow14
Copy link

@ renatowow14
Eu criei uma solicitação pull para contas de serviço: # 123
Instalar (reinstalar) test_gupload

curl --compressed -Ls https://github.com/Akianonymus/google-drive-upload/raw/wip/install.sh | sh -s -- --uninstall -c test_gupload
curl --compressed -Ls https://github.com/Akianonymus/google-drive-upload/raw/wip/install.sh | sh -s -- -c test_gupload -B wip -r Akianonymus/google-drive-upload

Como gerar contas de serviço: https://github.com/Akianonymus/google-drive-upload/tree/wip#generating-service-account-credentials
Como usar: https://github.com/Akianonymus/google-drive-upload/tree/wip#for-service-accounts
Teste e relatório.

Eu configurei a conta de serviço, gerei a chave e baixei o arquivo .json. Fico informado disso com a sintaxe -sa está correto, certo?

-> test_gupload -sa /root/backup_lapig_gdrive_chave_de_acesso.json folder_name

Estou enviando os dados, mas não aparecem na minha conta do google drive, tentei navegar na unidade mas não consegui encontrar, ao tentar acessar o link que gera acesso após subir, ele pede para solicitar acesso ao dono, estou confuso

The crazy thing is that the file went up and generated an access link, but when I access it asks to request access and I can't find it on my drive.

@renatowow14
Copy link

If I go up without using the -sa syntax it appears on my drive and the access link works.

Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Nov 6, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Nov 7, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Nov 7, 2020
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid
@Akianonymus
Copy link
Collaborator Author

So, i did some work on this today.

Almost everything is working now.

About the files not appearing, well it's uploaded in the bot account so not accessible.

For that, use --share flag.

Now, to upload directly in your own account, you have to use the --rootdir option.

  1. Grab the client email from service account json.

  2. Make a folder on your own drive and give write permissions to that email.

Now, just upload using the -sa flag and use --rootdir "root dir id" to upload directly in your account.

One problem here is that the files owner will be the service account.

To change the owner, i will soon introduce a flag.

Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Jan 5, 2021
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid

* add a seperate service account guide on how to affectively use these service accounts properly
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue Jan 5, 2021
* Add guide in readme on how to generate

* Add -sa/--service-account flag

* access tokens created by sa will be saved in config, when the sa is given, then it will try to reuse the access token if valid

* add a seperate service account guide on how to affectively use these service accounts properly
@mystix
Copy link

mystix commented Sep 27, 2022

Was this feature ever merged into master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants