Giter VIP home page Giter VIP logo

Comments (12)

mtdeguzis avatar mtdeguzis commented on July 23, 2024 1

I started adding some logging info to debug this, turns out the request returns back an empty list, []. Turns out -u is required, but not checked for. Which then prompts for a password, which it should not if I issued to prefer ssh

bin/github-backup -u user <NAME>--prefer-ssh --private --organization --output-directory ~/gitbak --all
Backing up user <NAME> to /home/user/gitbak
Retrieving repositories
Password:

If -u is left out, getpasswd should be used to obtain the current user.

from python-github-backup.

mtdeguzis avatar mtdeguzis commented on July 23, 2024

Ok works with a token, all of which these things should be checked for at runtime. Is there no other way?

from python-github-backup.

josegonzalez avatar josegonzalez commented on July 23, 2024

@mtdeguzis If you set --user, you probably also want to set --password (its for basic auth). The alternative is to use a token, as you found. getpasswd isnt a good alternative here because your local username probably does not match your github username (mine doesn't).

I suppose if we set the --private flag, we should also check for auth. Mind making a pull request for that?

from python-github-backup.

mtdeguzis avatar mtdeguzis commented on July 23, 2024

I could probably take a look at add the check. I'll look at submitting a PR.

from python-github-backup.

mtdeguzis avatar mtdeguzis commented on July 23, 2024

Actually, this checks for the pw, so nothing to do here:

github-backup ORG -u mtdeguzis --prefer-ssh --private --organization --output-directory ~/gitbak --all

We actually need to check for user. If that is left out, the program kicks of as if nothing is wrong. But I get what you mean, get_auth can be issued if --private is used.

from python-github-backup.

mtdeguzis avatar mtdeguzis commented on July 23, 2024

How about..

350 def retrieve_data(args, template, query_args=None, single_request=False):
351     auth = get_auth(args)
352     if not auth and args.private:
353         sys.exit("Authentication is required for private repositories")
354     query_args = get_query_args(query_args)
355     per_page = 100
356     page = 0
357     data = []

... when a user attempts to retrieve data from a private repository?

Backing up user ORG to /home/mtdeguzis/gitbak
Retrieving repositories
Authentication is required for private repositories (token or password)

from python-github-backup.

breezzz avatar breezzz commented on July 23, 2024

Hello! It would be nice to add authentication by the ssh key (without password)

from python-github-backup.

josegonzalez avatar josegonzalez commented on July 23, 2024

@breezzz pull request welcome.

from python-github-backup.

whwright avatar whwright commented on July 23, 2024

This looks done with #74?

from python-github-backup.

josegonzalez avatar josegonzalez commented on July 23, 2024

That was never merged.

from python-github-backup.

whwright avatar whwright commented on July 23, 2024

Derp, somehow missed that. Should this be implemented as a failure or a warning? I am thinking similar to this:

log_warning('Authenticated user is different from user being backed up, thus private repositories cannot be accessed')

from python-github-backup.

josegonzalez avatar josegonzalez commented on July 23, 2024

warning is fine.

from python-github-backup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.