Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netlify CMS with self-hosted Gitlab

I have a Gatsby static site that is currently deployed via Zeit Now from a self-hosted Gitlab account.

I would like to add Netlify CMS, but it only seems to integrate with a Gitlab.com account.

Is it possible to use Netlify CMS with a self-hosted Gitlab account?

like image 476
Undistraction Avatar asked Aug 24 '18 11:08

Undistraction


2 Answers

You will be able to use Netlify CMS with a self-hosted Gitlab server using Implicit Grant

As the docs show, your options are below for the backend in the config.yml file:

backend:
  name: gitlab
  repo: owner-name/repo-name # Path to your GitLab repository
  auth_type: implicit # Required for implicit grant
  app_id: your-app-id # Application ID from your GitLab settings
  api_root: https://my-hosted-gitlab-instance.com/api/v4
  base_url: https://my-hosted-gitlab-instance.com
  auth_endpoint: oauth/authorize

On Gitlab: Setup an application on Gitlab to get the app_id and to set the Redirect URI, enter the address where you access Netlify CMS, for example, https://www.example.com/admin/. For scope, select api

Update: It is recommended to use client-side PKCE Authorization now for Gitlab rather than Implicit Grant.

like image 88
talves Avatar answered Oct 21 '22 21:10

talves


By using Netlify CLI you set it up to auto-deploy from Self-hosted/managed GitLab.

You'll need to configure SSH key and webhook integration. Here is a detailed guide: Auto Deploy to Netlify from Self-hosted GitLab

like image 29
Gijo Varghese Avatar answered Oct 21 '22 20:10

Gijo Varghese