先安裝doceker與gitlab套件
螢幕快照 2018-03-08 下午2.58.19

容器>synology_gitlab>詳細資訊>終端機>新增bash
螢幕快照 2018-03-08 下午2.57.31

 

vi /home/git/gitlab/config/gitlab.yml     修改這份設定將LDAP開啟與設定參數
假設LDAP主機IP=192.168.1.66  (這邊也是用synology的Directory Server套件做LDAP)
====================================================
ldap:
enabled:true
servers:
label: ‘LDAP’
port:  339
uid: ‘uid’
method:’plain’
bind_dn: ‘CN=root,DC=192,DC=168,DC=1,DC=66′
password: ‘root也是admin的密碼’
allow_username_or_email_login:true
block_auto_created_users:false
base:’DC=192,DC=168,DC=1,DC=66′
user_filter:"
====================================================
儲存後要重開gitlab
sudo /etc/init.d/gitlab restart

完成就可以看到Gitlab自己跑出LDAP登入畫面

螢幕快照 2018-03-08 下午2.55.52

 

 

#過程中一直遇到無法登入Gitlab報錯:Could not authenticate you from Ldapmain because “Invalid credentials".
原因就是/home/git/gitlab/config/gitlab.yml  這邊設定錯誤,多試試就ok了.

最後感謝網路上教學文章:
http://snickerjp.blogspot.tw/2013/05/gitlab-activedirectory-ldap.html

這簡單的東西搞了我6個小時啊…

 

#2018-11-17 更新

更新之後,port變成389,多了一個host填入ip就可以,其他設定不變。