Giter VIP home page Giter VIP logo

Comments (13)

josegonzalez avatar josegonzalez commented on July 23, 2024

Interesting, I definitely tried this against my company's organization. I'll take a look really quickly.

As far as bitbucket, I think not. I don't use bitbucket and honestly have no desire to figure out their api (if they have one) to pull down information.

from python-github-backup.

mike503 avatar mike503 commented on July 23, 2024

Yeah, I actually found a small shell script [1] that does the majority of Bitbucket backups (kinda like your script here, definitely not as elegant)

Maybe there just needs to be quick documentation/steps on how to use this in an authorized manner against a private organization account + repos?

  1. https://bitbucket.org/bibsonomy/bitbucket-backup-script

from python-github-backup.

josegonzalez avatar josegonzalez commented on July 23, 2024

Sorry it took so long, I just added support for backing up organizations.

from python-github-backup.

mike503 avatar mike503 commented on July 23, 2024

oh, wow! Thanks, I hadn't had a chance to get back to you with (redacted) example data :p

from python-github-backup.

mike503 avatar mike503 commented on July 23, 2024

Quick question - what do I use to be able to access an organization?

My personal GitHub account that has full access to the organization account? So far that doesn't seem to work. Using basic auth, or token auth.

I do not have a username/password for the organization account itself. I don't see any option for generating tokens or resetting a password for it either. Only generating OAuth application tokens for an application that the organization account owns (not just uses)

I am trying:
bin/github-backup --all -t {my Personal access token with EVERYTHING checked} -O org-name

Personal access token generated from https://github.com/settings/applications

from python-github-backup.

josegonzalez avatar josegonzalez commented on July 23, 2024

Here is what I did:

github-backup seatgeek -P -u josegonzalez -p SOME_KEY -O --repositories

And it seemed to work fine for me. Can you gist your output? Also, did you upgrade?

from python-github-backup.

mike503 avatar mike503 commented on July 23, 2024

It's the latest master, and I see your changes for -O - it looks like it does work now except it prompts me for basic auth.

The -p SOME_KEY - is that your password, or your personal access token? No matter what combination I use, for each repo it encounters it prompts me for basic auth.

-u mike503 -p PASSWORD
-u mike503 -p PERSONAL_TOKEN
-u mike503 -t PERSONAL_TOKEN
-u mike503 -p PASSWORD -t PERSONAL_TOKEN
-t PERSONAL_TOKEN

for example:
./github-backup ORG_REPO_NAME -P -u mike503 -p MY_PASSWORD -O --repositories
Backing up user foo to /home/mike/path
Retrieving repositories
Filtering repositories
Backing up repositories
Cloning foo/foo repository
Username for 'https://github.com': mike503
Password for 'https://[email protected]':

Note: it says "backing up user" when this is really an organization. Minor word change might be nice to add in. :)

It looks like it's working, but it still prompts me for basic auth. The token I have generated has this access:

repo, user:email, user:follow, notifications, read:org, read:public_key, read:repo_hook, public_repo, repo_status, repo_deployment

Which seems like everything it should need.

from python-github-backup.

josegonzalez avatar josegonzalez commented on July 23, 2024

It's a personal access token. I gave it access to everything.

from python-github-backup.

mike503 avatar mike503 commented on July 23, 2024

Okay, I have a personal access token, have given it access to everything. Even write/admin stuff.

When I run this:
./github-backup group-repo -P -u mike503 -p TOKEN -O --all

I still get prompted for basic auth. It works once I enter the right username/password, but I need this to run without interaction. I'm sure that's your goal too, I just don't know why I keep getting prompted but you don't.

I even made sure that my pub key was correct. I can git clone the org repo directly without a problem. Just in case part of your script was first using the API over the web and then using normal git commands in the shell.

from python-github-backup.

josegonzalez avatar josegonzalez commented on July 23, 2024

I just created a new key with the following permissions:

  • repo
  • write:org
  • read:org
  • user
  • gist

And then ran:

github-backup seatgeek -P -u josegonzalez -p MY_GENERATED_TOKEN -O --all

And it appears to be running fine.

Do you have 2-factor authentication enabled, by any chance?

from python-github-backup.

mike503 avatar mike503 commented on July 23, 2024

no two factor.

just generated the fresh key, same privileges as you.

./github-backup ORGNAME -P -u mike503 -p TOKEN -O --all

Backing up user ORGNAME to /home/mike/nobackup/python-github-backup/bin
Retrieving repositories
Filtering repositories
Backing up repositories
Updating ORGNAME/repo1 repository
Username for 'https://github.com':

:( do you have a ~/.netrc setup for github? That's the only way I know of to save http credentials.

from python-github-backup.

josegonzalez avatar josegonzalez commented on July 23, 2024

I do, but it is only setup for my heroku account. Any other settings you can think of?

from python-github-backup.

mike503 avatar mike503 commented on July 23, 2024

I got it to work, if I setup .netrc

Looks like you shell out a git command to do the git work, and it is leveraging https transport. I wonder if passing it https://user:[email protected] would work and your program can provide that?

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.