Skip to content

Backup of private organization does nothing, no errors #72

Closed

Description

@asdf1234-deleted
github-backup <NAME> --private --organization --output-directory ~/gitbak --all

Retrieving repositories
Filtering repositories
Backing up repositories
Retrieving <NAME> starred repositories
Writing 0 starred repositories to disk
Retrieving <NAME> watched repositories
Writing 0 watched repositories to disk

$ tree ~/gitbak/
/home/user/gitbak/
└── account
    ├── starred.json
    └── watched.json

1 directory, 2 files

I would also be nice to have a --debug option for additional output of what is going on. I can clone our repos via ssh just fine. leaving out the ssh option did not make a difference.

Activity

  1. asdf1234-deleted commented on Nov 27, 2017

    @asdf1234-deleted
    Author

    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.

  2. asdf1234-deleted commented on Nov 27, 2017

    @asdf1234-deleted
    Author

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

  3. josegonzalez commented on Nov 27, 2017

    @josegonzalez
    Owner

    @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?

  4. asdf1234-deleted commented on Nov 28, 2017

    @asdf1234-deleted
    Author

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

  5. asdf1234-deleted commented on Nov 28, 2017

    @asdf1234-deleted
    Author

    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.

  6. asdf1234-deleted commented on Nov 28, 2017

    @asdf1234-deleted
    Author

    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)
    
  7. breezzz commented on Feb 12, 2018

    @breezzz

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

  8. josegonzalez commented on Feb 12, 2018

    @josegonzalez
    Owner

    @breezzz pull request welcome.

  9. whwright commented on Dec 27, 2018

    @whwright
    Contributor

    This looks done with #74?

  10. josegonzalez commented on Dec 27, 2018

    @josegonzalez
    Owner

    That was never merged.

  11. whwright commented on Dec 27, 2018

    @whwright
    Contributor

    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')

  12. josegonzalez commented on Dec 28, 2018

    @josegonzalez
    Owner

    warning is fine.

  13. Iamrodos commented on Dec 7, 2025

    @Iamrodos
    Contributor

    @josegonzalez this can be closed. Addressed by aba048a in PR #461

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions