Import projects from GitHub and login to your GitSwarm instance with your GitHub account.
To enable the GitHub OmniAuth provider you must register your application with GitHub. GitHub will generate an application ID and secret key for you to use.
Sign in to GitHub.
Navigate to your individual user settings or an organization's settings, depending on how you want the application registered. It does not matter if the application is registered as an individual or an organization - that is entirely up to you.
Select "OAuth applications" in the left menu.
If you already have applications listed, switch to the "Developer applications" tab.
Select "Register new application".
<Organization>'s GitSwarm
or <Your Name>'s GitSwarm
or something else descriptive.Select "Register application".
You should now see a Client ID and Client Secret near the top right of the page (see screenshot). Keep this page open as you continue configuration.
On your GitSwarm server, open the configuration file.
For package installation:
sudo editor /etc/gitswarm/gitswarm.rb
For source installations:
cd /home/git/gitlab
sudo -u git -H editor config/gitlab.yml
See Initial OmniAuth Configuration for initial settings.
Add the provider configuration:
For package installation:
gitlab_rails['omniauth_providers'] = [
{
"name" => "github",
"app_id" => "YOUR_APP_ID",
"app_secret" => "YOUR_APP_SECRET",
"url" => "https://github.com/",
"args" => { "scope" => "user:email" }
}
]
For source installation:
For GitHub.com:
- { name: 'github', app_id: 'YOUR_APP_ID',
app_secret: 'YOUR_APP_SECRET',
args: { scope: 'user:email' } }
For GitHub Enterprise:
- { name: 'github', app_id: 'YOUR_APP_ID',
app_secret: 'YOUR_APP_SECRET',
url: "https://github.example.com/",
args: { scope: 'user:email' } }
Replace https://github.example.com/
with your GitHub URL.
Change 'YOUR_APP_ID' to the client ID from the GitHub application page from step 7.
Change 'YOUR_APP_SECRET' to the client secret from the GitHub application page from step 7.
Save the configuration file.
Restart GitSwarm for the changes to take effect.
On the sign in page there should now be a GitHub icon below the regular sign in form. Click the icon to begin the authentication process. GitHub will ask the user to sign in and authorize the GitSwarm application. If everything goes well the user will be returned to GitSwarm and will be signed in.