Netlify CMS with self-hosted Gitlab
Asked Answered
W

2

8

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?

Wetzel answered 24/8, 2018 at 11:29 Comment(0)
A
17

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.

Armageddon answered 24/8, 2018 at 14:29 Comment(1)
I've made an update to this answer for those looking to use Auth for Gitlab with Netlify CMS. PKCE is going to be a more secure solution.Armageddon
S
0

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

Singlehanded answered 30/12, 2018 at 2:31 Comment(1)
The OP wants to use Netlify CMS, not Netlify (which is a different thing, it's a hosting service) Netlify CLI works only with Netlify.Tella

© 2022 - 2024 — McMap. All rights reserved.