搭建GitLab
???????目前公司內(nèi)網(wǎng)使用的是SVN,之前搭建時項目和開發(fā)人員并不多,所以也沒走LDAP認證;現(xiàn)在人員增加茫多,加上新來的開發(fā)人員比較習(xí)慣用GitHub,由于公司業(yè)務(wù)比較敏感邓萨,所幸搭建一套內(nèi)網(wǎng)GitLab地梨,配置LDAP認證。
1.用bitnami上的封裝包部署
https://bitnami.com/redirect/to/90913/bitnami-gitlab-8.4.2-0-linux-x64-installer.run
2.下載完成后缔恳,直接在服務(wù)器上執(zhí)行即可
./bitnami-gitlab-8.2.3-4-linux-x64-installer.run
Error: There has been an error.
The installation has detected that the current umask is set to permissions of
0027, the installation is now exiting. You should modify your umask to at least
0022 before launching the installer. After the installation has completed, reset
the umask permissions to your original values.
Press [Enter] to continue:
這里發(fā)現(xiàn)報錯宝剖,按照提示將umask值設(shè)置為0022即可.
Welcome to the Bitnami Gitlab Stack Setup Wizard.
----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.
PhpPgAdmin [Y/n] :
*這里選擇Y*
GitLab : Y (Cannot be edited)
Is the selection above correct? [Y/n]: y
*確認上述配置*
----------------------------------------------------------------------------
Installation folder
Please, choose a folder to install Bitnami Gitlab Stack
Select a folder [/opt/gitlab-8.2.3-4]:
*填寫安裝Gitlab的目錄*
----------------------------------------------------------------------------
Create Admin account
Bitnami Gitlab Stack admin user creation
Email Address [user@example.com]: ***git@XXX.com.cn***
*配置管理員郵件地址*
Login [root]:
Password :
Please confirm your password :
*配置管理員賬戶和密碼*
Hostname that will be used to create internal URLs. If this value is incorrect,
you may be unable to access your Gitlab installation from other computers. It is
advisable to use a Domain instead of an IP address for compatibility with
different browsers.
Domain [XXX.XXX.XX.XX]: XXX.XXX.XXX.XXX
Do you want to configure mail support? [y/N]: y
*配置訪問地址*
----------------------------------------------------------------------------
Configure SMTP Settings
This is required so your application can send notifications via email.
Default email provider:
[1] GMail
[2] Custom
Please choose an option [1] : 2
*選擇郵箱類型*
----------------------------------------------------------------------------
Configure SMTP Settings
This data is stored in the application configuration files and may be visible to
others. For this reason, it is recommended that you do not use your personal
account credentials.
Username []: git@XXX.com.cn
Password :
Re-enter :
SMTP Host []: smtp.exmail.qq.com
SMTP Port [587]:
Secure connection
[1] None
[2] SSL
[3] TLS
Please choose an option [3] :
*配置郵箱*
----------------------------------------------------------------------------
Setup is now ready to begin installing Bitnami Gitlab Stack on your computer.
Do you want to continue? [Y/n]: y
----------------------------------------------------------------------------
Please wait while Setup installs Bitnami Gitlab Stack on your computer.
Installing
0% ______________ 50% ______________ 100%
#########################################
----------------------------------------------------------------------------
Setup has finished installing Bitnami Gitlab Stack on your computer.
Info: To access the Bitnami Gitlab Stack, go to
http://10.12.3.21:80 from your browser.
Press [Enter] to continue:
*安裝完成*
3.訪問GitLab網(wǎng)頁
-
登錄界面
- 登錄成功
[圖片上傳失敗...(image-a211b6-1530496467610)]
4.配置LDAP庫
- 修改配置文件,開啟LDAP驗證:
vim ./config/gitlab.yml
ldap: enabled: true #默認是false label: 'LDAP' host: 'XXX.XXX.XXX.XXX' #填寫LDAP服務(wù)器ip port: 389 #LDAP服務(wù)器端口歉甚,默認是389万细;如加密,則為636 uid: 'sAMAccountName' method: 'plain' #LDAP認證模式纸泄,plain是簡單認證,加密認證有ssl和tls bind_dn: '$LDAPUSER' #連接LDAP的帳號 password: '$LDAPPASSWD' #連接LDAP的密碼 base: 'OU=XXX,DC=corp,DC=XXXX,DC=com,DC=cn' #組織架構(gòu)赖钞,因為用的是總部的LDAP,這里精確到OU
-
配置完成后重啟Git
/opt/gitlab-8.2.3-4/ctlscript.sh restart
5.訪問gitlab頁面
- 顯示LDAP登錄頁聘裁,到這里GitLab搭建完成
[圖片上傳失敗...(image-310ad8-1530496467610)]