Comments (13)
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.
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?
from python-github-backup.
Sorry it took so long, I just added support for backing up organizations.
from python-github-backup.
oh, wow! Thanks, I hadn't had a chance to get back to you with (redacted) example data :p
from python-github-backup.
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.
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.
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.
It's a personal access token. I gave it access to everything.
from python-github-backup.
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.
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.
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.
I do, but it is only setup for my heroku account. Any other settings you can think of?
from python-github-backup.
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)
- Feature request: read personal access token (PAT) from stdin HOT 1
- The release script is broken HOT 1
- Personal Access Token (PAT) - Which scopes are need to backup an organiziation? HOT 1
- Add a --quiet option HOT 1
- Download watchers, forks, and stargazers of a repo
- A way to include the actual commits of backupped PRs?
- Add option to disable --prune when updating repository
- how to correctly update local backup? HOT 7
- Backup images and attachments in the issues
- Github-backup in 140 repository org backups nothing HOT 3
- Exclude specific repositories from backup HOT 1
- Add support for fine-grained tokens HOT 2
- Proposal to use API repository `pushed_at` instead of `update_at` field for `last_updated`
- something awry in --releases HOT 1
- When the `--lfs` option is used, after first clone non-lfs content is no longer fetched HOT 1
- Feature: offer docs how to run in docker HOT 4
- ERROR: 'gaierror' object is not iterable
- Automate releases HOT 5
- `--all-starred` does not backup anything HOT 7
- Backing up releases using fine-grained token ends with an error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-github-backup.