GitHub
Integrating with GitHub or GitHub Enterprise (EE) allows you to use it as a Git hosting provider and sign in to the workspace with your GitHub profile. The process for adding the integration is the same for both versions of GitHub, unless stated otherwise in the document.
The integration is split into two parts:
- Creating a GitHub App allows you to use GitHub as your Git provider in Buddy.
- Creating an OAuth App in GitHub allows you to use GitHub as an identity provider and sign in to Buddy using your GitHub account.
Success
GitHub App and OAuth App are independent of each other – you can configure only the part you need for your setup.
Integrating GitHub as a Git hosting provider
- Sign in to your Buddy self-hosted instance as admin.
- Add a new project and select GitHub as the provider.
- Click the button to begin configuration:
Image loading...
- Copy the Authorization Callback URL.
- In GitHub, go to Developer settings → GitHub Apps and click New GitHub App.
- Provide the name for the app and paste the callback URL copied from Buddy in step 4. Then provide your page address as the Homepage URL.
Enable these options:
- Expire user authorization tokens
- Request user authorization (OAuth) during installation
- Redirect on update
- Disable the webhook by unchecking the 'Active' checkbox in the Webhook section.
Set the repository permissions:
- Contents: Read-only
- Metadata: Read-only
- Pull requests: Read-only
- Webhooks: Read & Write
- Commit statuses: Read & write
Set account permissions:
- Email adresses: Read-only
- Make the app public: select Any account in the Where can this GitHub App be installed? section.
- Click Create GitHub App.
- Click Generate a new client secret.
- Copy the Client Secret and Client ID from GitHub. Copy the GitHub App name from your browser's address bar. Paste the details into the corresponding fields in Buddy:
Tip
The GitHub App name is the last part of the URL:
https://github.com/settings/apps/{GITHUB_APP_NAME}
Image loading...
- Provide the public URL of your instance.
- Click Save changes and restart Buddy.
- After you restart Buddy, create a new project and select GitHub as your Git hosting provider. In the popup window, click Authorize {GITHUB_APP_NAME}.
Image loading...
Integrating GitHub as an identity provider
- Sign in to your Buddy self-hosted instance as admin.
- Go to Self-Hosted Admin → 3rd-Party Apps and select your version of GitHub:
Image loading...
- Copy the Authorization Callback URL.
- In GitHub, go to Developer settings → OAuth Apps and click
New OAuth App
. - Configure app details: provide the name, URL, and paste the callback URL copied from Buddy.
- Click Register application.
- Click Generate a new client secret.
- Copy the Client Secret and Client ID and paste them into the corresponding fields in Buddy:
Image loading...
- Click Save changes and restart Buddy.
After adding this integration, you can to sign in to Buddy with your GitHub account:
Image loading...
Webhook redirection on non-public-instances
If your instance is not publicly available, follow these instructions to ensure that webhooks from GitHub are successfully reaching Buddy:
- Go to the settings of your GitHub App:
https://$INTERNAL_BUDDY_IP_ADDRESS/settings/apps/GIT_HUB
. - Set the Public URL of this Buddy instance to the public address of your network with a custom port.
- On your router, redirect the public address and port to
$INTERNAL_BUDDY_IP_ADDRESS:80
.
Last modified on Sep 24, 2024