boxen / our-boxen

Copy me for your team.
https://github.com/boxen/our-boxen/
MIT License
2.58k stars 882 forks source link

Changing the github username on a boxen install #608

Closed adamnbowen closed 10 years ago

adamnbowen commented 10 years ago

I just set up a new coworker's machine with boxen. To speed things up, I associated it with my own username, assuming I could switch over to his github username once he arrived. However, I can't seen to figure out a way to switch boxen over to his new username—I've edited both /opt/boxen/config/boxen/defaults.json and /opt/boxen/env.d/30_gh_creds.sh and then run source /opt/boxen/env.sh. Running facter inside the /opt/boxen/repo directory at this point shows the new github username, but once I run boxen, it just overwrites the new username with the old one.

Is there any way to change the github username without running ./script/nuke --all --force and then reinstalling boxen?

tarebyte commented 10 years ago

There is a file located in opt/boxen/config/boxen/defaults.json that has your GitHub login name stored.

If you change the login parameter it may work, this is just a guess though.

adamnbowen commented 10 years ago

I edited both that and the /opt/boxen/env.d/30_gh_creds.sh file, and they just get reset when I run boxen to their previous state.

tarebyte commented 10 years ago

hmm... I'm not entirely sure. @dgoodlad @fromonesrc do you guys have any ideas?

ocxo commented 10 years ago

Try revoking the Boxen personal access token from your account and have your friend re-run boxen. Should prompt for re-authentication.

adamnbowen commented 10 years ago

Thanks @fromonesrc—that worked perfectly. I ran BOXEN_GITHUB_LOGIN={name of the user} boxen, and then everything worked perfectly from there (so you don't need to mess with any of the config files). Would this be a good candidate to throw into the FAQs, or at least into the documentation somewhere?

tarebyte commented 10 years ago

I think it's a strange case to have so I'm not entirely sure how I feel about putting it in the docs/faq.

dgoodlad commented 10 years ago

This is definitely a strange case, but I'd be happy to accept a PR with a reasonable change to the docs

ray- commented 9 years ago

@fromonesrc @adamnbowen my username has a '-' in it and repo/shared/boxen/spec/fixtures/modules/boxen/manifests/personal.pp converts '-' to '_' which is causing me issues.

adamnbowen commented 9 years ago

@ray- the README for our-boxen states "Boxen may not play nice with a GitHub username that includes dash(-)"

ray- commented 9 years ago

Hi @adamnbowen .Thanks for the response. I saw that.

Where does boxen store the user name? I've nuked boxen, but it keeps using the same github account. I use multiple github accounts and I'm not sure why it's defaulting to that one.

adamnbowen commented 9 years ago

As I recall, the only way I was able to manage it was removing my SSH key access from GitHub, and then trying to run boxen—it required me to re-authenticate.

ray- commented 9 years ago

@adamnbowen It doesn't work for me because it can't find the github account since the dash was converted to an _

I'll plug away and try to figure it out. personal.pp should probably be changed since underscores are not valid in github names.

PhilAWilks commented 9 years ago

I made the mistake of creating a github username with a dash (-). I edited it to remove the dash, but then found that the boxen script (/tmp/install-boxen) wasn't being provided with the new user - it always contained the original username along with the original token. I couldn't find any way to force the script to pick up the new username, so I did the following in order to get Boxen installed:

1) curl --progress-bar -L 'https://api.github.com/repos/org123/org123-boxen123/tarball/master?access_token=' | tar -xz - --strip-components 1 && touch .snapshot 2) script/boxen --token --login

This worked for my purposes - it's very possible there's a better way of having the updated username and access tokens being automatically pushed to the boxen script... I'm very much a newbie to this world.

bizob2828 commented 8 years ago

We also had this issue where a user had a space in their password