Connecting to your GitHub Enterprise Server allows you to work on your websites locally and have the changes synced to CloudCannon. File changes made on CloudCannon also get synced back to your GitHub Enterprise Server repository.
To connect to a GitHub.com repository instead, follow the instructions listed for GitHub.
Creating a GitHub App#
Before configuring your GitHub Enterprise Server, you need to Create a new GitHub App. You only need to do this once per server. We recommend creating the App under a GitHub Organisation.
-
On your GitHub Enterprise Server instance, navigate to Settings > Developer Settings > GitHub Apps and select New GitHub App.
-
Fill the Register new GitHub App with the following:
- GitHub App name:
CloudCannon
- Homepage URL:
https://app.cloudcannon.com
- Callback URL:
https://app.cloudcannon.com/github_enterprise_server/authorize
- Setup URL:
https://app.cloudcannon.com/github_enterprise_server/install
- Redirect on update:
true
- Webhook URL:
https://app.cloudcannon.com/hooks/github_enterprise_server/{organization_id}
(The organization specific URL can be found on CloudCannon / Organization / Settings / GitHub Enterprise Server) - Webhook secret: A random string with high entropy
- GitHub App name:
-
Set the Permissions as follows:
- Repository permissions
- Commit statuses:
Read and Write
- Contents:
Read and Write
- Metadata:
Read-only
- Pull requests:
Read and Write
- Commit statuses:
- User permissions
- Email addresses:
Read-only
- Email addresses:
- Repository permissions
-
Under Subscribe to events select the following events:
- Meta
- Push
-
Choose the best option for your team on the Where can this GitHub App be installed? option.
Generate client secret and private key#
After creating your GitHub App, you will be able to generate a client secret and a Private Key. Those keys along with other details will be used to authenticate CloudCannon requests on your GitHub Enterprise Server.
- Under General settings select Generate a new client secret. Make sure you copy the generated secret to be used later.
- Under General settings select Generate a private key. This will generate a PEM file and will be automatically downloaded. Keep this in a safe place to be used later.
Configuring your GitHub Enterprise Server#
Before syncing with a repository in your GitHub Enterprise Server, you need to configure your instance on CloudCannon. You only need to do this once per account. To connect to your GitHub Enterprise Server instance:
- Go to Settings / GitHub Enterprise Server
- Enter the details for your GitHub Enterprise Server instance:
- Endpoint: The URL where your instance can be accessed.
https://HOSTNAME
- Authorize URL:
https://HOSTNAME/login/oauth/authorize
- Token URL:
https://HOSTNAME/login/oauth/access_token
- GitHub App ID: Values assigned by GitHub.
- GitHub App Name:
CloudCannon
(The same name used when creating the App in the Creating a GitHub App step) - Client ID: Values assigned by GitHub.
- Client Secret: Previously generated
- WebHook Secret: The random string with high entropy previously generated.
- Private Key: Contents of the PEM file previously generated.
- Endpoint: The URL where your instance can be accessed.
- Click Configure GitHub Enterprise Server
Syncing with a repository#
To connect a GitHub Enterprise Server repository and start syncing files, follow these instructions:
- Go to Site Settings / Source Syncing
- Select GitHub Enterprise Server repository
- Click Authenticate
From there you can follow the same instructions as configuring a GitHub.com repository.