Skip to content

Commit 2d1dc88

Browse files
authored
Merge pull request #788 from mcnesium/docs/gitlab
Add documentation for setting up authentication with a self-hosted GitLab
2 parents 5d57a4b + 18d2bbb commit 2d1dc88

4 files changed

Lines changed: 29 additions & 0 deletions

File tree

docs/guides/auth.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,32 @@ The basic procedure is the same as the case of OneLogin which is mentioned above
210210
````
211211
212212
213+
### GitLab (self-hosted)
214+
215+
1. Sign in to your GitLab
216+
2. Navigate to the application management page at `https://your.gitlab.domain/admin/applications` (admin permissions required)
217+
3. Click **New application** to create a new application and fill out the registration form:
218+
219+
![New GitLab application](images/auth/gitlab-new-application.png)
220+
221+
4. Click **Submit**
222+
5. In the list of applications select **HackMD**. Leave that site open to copy the application ID and secret in the next step.
223+
224+
![Application: HackMD](images/auth/gitlab-application-details.png)
225+
226+
227+
6. In the `docker-compose.yml` add the following environment variables to `app:` `environment:`
228+
229+
```
230+
- HMD_DOMAIN=your.hackmd.domain
231+
- HMD_URL_ADDPORT=443
232+
- HMD_PROTOCOL_USESSL=true
233+
- HMD_GITLAB_BASEURL=https://your.gitlab.domain
234+
- HMD_GITLAB_CLIENTID=23462a34example99fid0943c3fde97310fb7db47fab1112
235+
- HMD_GITLAB_CLIENTSECRET=5532e9dexample70432secret0c37dd20ce077e6073ea9f1d6
236+
```
237+
238+
7. Run `docker-compose up -d` to apply your settings.
239+
8. Sign in to your HackMD using your GitLab ID:
240+
241+
![Sign in via GitLab](images/auth/gitlab-sign-in.png)
29.7 KB
Loading
44.4 KB
Loading
5.46 KB
Loading

0 commit comments

Comments
 (0)