Connecting to your self-hosted GitLab allows you to work on your websites locally and have the changes sync to CloudCannon. File changes made on CloudCannon also get synced back to your self-hosted GitLab repository.
To connect to a GitLab.com repository instead, follow the instructions listed for GitLab.
Connecting to an instance#
Before syncing with a repository in your self-hosted GitLab, you need to connect CloudCannon to your self-hosted instance. You only need to do this once per account.
To connect to your self-hosted GitLab instance:
- Go to Settings / Self Hosted GitLab
- Enter the details for your self-hosted instance of GitLab
- Click Configure Self Hosted GitLab

The details for this page come from the GitLab server under User Settings / Applications.

The Redirect URI is https://app.cloudcannon.com/self_hosted_gitlab/authorize/ The minimal scopes required are:
- api
- read_user
- read_repository
- write_repository
- openid
Once completed, the key and secret will be available for use in CloudCannon. The URLs should match the form placeholders.
Syncing with a repository#
To connect a self-hosted GitLab repository and start syncing files, follow these instructions:
- Go to Site Settings / Source Syncing
- Select Self Hosted GitLab repository
- Click Authenticate

This redirects you to your self-hosted GitLab repository. Log in and authorize CloudCannon access to your self-hosted GitLab account. You'll be redirected back to CloudCannon to pick a repository to connect. If you don't have one for this website, create a new one in your self-hosted GitLab and refresh this page.

Any existing files on your website will be replaced with the contents of the selected repository. Click Backup and Sync to continue, or exit the page to cancel the process.
Your self-hosted GitLab is now connected. Changes you push to the Git repository are pulled in by CloudCannon. Any changes made on CloudCannon are automatically committed and pushed.
Configuring your GitLab connection#
Once you've connected your GitLab server, you can configure CloudCannon to support your particular infrastructure. You can find these configuration options under the Server tab of your Self Hosted GitLab settings. The options you have for configuring CloudCannon are:
- Minimum Access Level,
- Custom Headers, and
- Custom CA Certificate.

The Minimum Access Level setting allows you to change the minimum access CloudCannon requires to a GitLab repo to connect to it. By default CloudCannon requires Maintainer access to a repo before syncing to it. Self Hosted GitLab allows custom access level permissions so a lower access level may be sufficient, depending on your setup.
The Custom Headers setting allows you to configure additional headers
for CloudCannon to use when connecting to your GitLab server. Custom
headers are passed using Git's http.extraHeader
configuration option and in the
form key:value
.
The Custom CA Certificate allows you to upload a PEM encoded
certificate or certificate chain for CloudCannon to trust during Git
operations. The certificate is passed using Git's http.sslCAInfo
configuration option.