「GitLab」:修訂間差異
跳至導覽
跳至搜尋
本頁面具有訪問限制。如果您看見此訊息,這代表您沒有訪問本頁面的權限。
(→安裝) |
(→移除) |
||
(未顯示同一使用者於中間所作的 11 次修訂) | |||
第1行: | 第1行: | ||
'''GitLab'''是一套以[[Git]]為中心而發展出來的軟體。 | '''GitLab'''是一套以[[Git]]為中心而發展出來的軟體。 | ||
== 簡介 == | |||
GitLab算是目前功能性與社群數量都比較成熟的方案。 | |||
== 安裝 == | == 安裝 == | ||
官方說明記憶體最少4 GB(在這種情況下需要外加4 GB的Swap) | 官方說明記憶體 一般建議為8 GB, 最少4 GB(在這種情況下需要外加4 GB的Swap)<ref>{{Cite web |url=https://docs.gitlab.com/ee/install/requirements.html |title=Requirements |accessdate=2019-12-10}}</ref> 。實際測試發現剛裝完大約吃1.5 GB的記憶體,一個人自己用之後會到2.5 GB左右,對於只有自己在使用的服務可以考慮2 GB的機器加上1 GB的Swap 。 | ||
這邊介紹的是[[Ubuntu]]下的安裝過程<ref>{{Cite web |url=https://about.gitlab.com/install/?version=ce#ubuntu |title=GitLab Installation |accessdate=2019-12-10}}</ref>: | 這邊介紹的是[[Ubuntu]]下的安裝過程<ref>{{Cite web |url=https://about.gitlab.com/install/?version=ce#ubuntu |title=GitLab Installation |accessdate=2019-12-10}}</ref>: | ||
第10行: | 第14行: | ||
sudo apt install -y ca-certificates curl openssh-server postfix | sudo apt install -y ca-certificates curl openssh-server postfix | ||
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash | curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash | ||
sudo EXTERNAL_URL="https://gitlab.example.com" apt install gitlab- | sudo EXTERNAL_URL="https://gitlab.example.com" apt install gitlab-ce | ||
</syntaxhighlight> | </syntaxhighlight> | ||
最近的版本可能會需要處理安裝時[[Let's Encrypt]]憑證申請失敗的相關的問題<ref>{{Cite web |url=https://gitlab.com/gitlab-org/gitlab/issues/38255 |title=Unable to renew letsencrypt certificate anymore |accessdate=2019-12-18}}</ref>。 | |||
== 移除 == | == 移除 == | ||
第18行: | 第24行: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo gitlab-ctl uninstall | sudo gitlab-ctl uninstall; sudo gitlab-ctl cleanse; sudo gitlab-ctl remove-accounts; sudo apt purge -y gitlab-ce; sudo rm -rf /etc/gitlab /opt/gitlab /var/log/gitlab /var/opt/gitlab | ||
sudo gitlab-ctl cleanse | </syntaxhighlight> | ||
sudo gitlab-ctl remove-accounts | |||
sudo apt purge -y gitlab-ce | == 設定 == | ||
sudo rm -rf /etc/gitlab /opt/gitlab /var/log/gitlab /var/opt/gitlab | |||
* 安裝完後馬上透過網頁連,可以設定密碼。設定完後可以用預設帳號root與剛剛所設定的密碼登入。 | |||
* 通常會關閉註冊(在網頁界面上就可以關閉)。 | |||
* 使用LDAP認證的設定需要透過<code>/etc/gitlab/gitlab.rb</code>修改,使用LDAPS的需要改設定使用<code>port: 636</code>與<code>encryption: 'simple_tls'</code>: | |||
<syntaxhighlight lang="ruby"> | |||
gitlab_rails['ldap_enabled'] = true | |||
gitlab_rails['prevent_ldap_sign_in'] = false | |||
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS' | |||
main: | |||
label: 'LDAP' | |||
host: 'ldap.example.com' | |||
port: 389 | |||
uid: 'uid' | |||
bind_dn: '' | |||
password: '' | |||
encryption: 'plain' | |||
verify_certificates: true | |||
smartcard_auth: false | |||
active_directory: false | |||
allow_username_or_email_login: true | |||
lowercase_usernames: true | |||
block_auto_created_users: false | |||
base: 'ou=People,dc=example,dc=com' | |||
user_filter: '' | |||
attributes: | |||
email: ['mail', 'email', 'userPrincipalName'] | |||
EOS | |||
</syntaxhighlight> | </syntaxhighlight> | ||
第28行: | 第61行: | ||
* sudo gitlab-ctl reconfigure | * sudo gitlab-ctl reconfigure | ||
* sudo gitlab-ctl renew-le-certs | |||
* sudo gitlab-ctl restart | * sudo gitlab-ctl restart | ||
於 2020年1月3日 (五) 23:14 的修訂
GitLab是一套以Git為中心而發展出來的軟件。
簡介
GitLab算是目前功能性與社群數量都比較成熟的方案。
安裝
官方說明記憶體一般建議為8 GB,最少4 GB(在這種情況下需要外加4 GB的Swap)[1]。實際測試發現剛裝完大約吃1.5 GB的記憶體,一個人自己用之後會到2.5 GB左右,對於只有自己在使用的服務可以考慮2 GB的機器加上1 GB的Swap。
sudo apt install -y ca-certificates curl openssh-server postfix
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo EXTERNAL_URL="https://gitlab.example.com" apt install gitlab-ce
最近的版本可能會需要處理安裝時Let's Encrypt憑證申請失敗的相關的問題[3]。
移除
移除需要多個步驟[4]:
sudo gitlab-ctl uninstall; sudo gitlab-ctl cleanse; sudo gitlab-ctl remove-accounts; sudo apt purge -y gitlab-ce; sudo rm -rf /etc/gitlab /opt/gitlab /var/log/gitlab /var/opt/gitlab
設定
- 安裝完後馬上透過網頁連,可以設定密碼。設定完後可以用預設帳號root與剛剛所設定的密碼登入。
- 通常會關閉註冊(在網頁界面上就可以關閉)。
- 使用LDAP認證的設定需要透過
/etc/gitlab/gitlab.rb
修改,使用LDAPS的需要改設定使用port: 636
與encryption: 'simple_tls'
:
gitlab_rails['ldap_enabled'] = true
gitlab_rails['prevent_ldap_sign_in'] = false
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
main:
label: 'LDAP'
host: 'ldap.example.com'
port: 389
uid: 'uid'
bind_dn: ''
password: ''
encryption: 'plain'
verify_certificates: true
smartcard_auth: false
active_directory: false
allow_username_or_email_login: true
lowercase_usernames: true
block_auto_created_users: false
base: 'ou=People,dc=example,dc=com'
user_filter: ''
attributes:
email: ['mail', 'email', 'userPrincipalName']
EOS
常用指令
- sudo gitlab-ctl reconfigure
- sudo gitlab-ctl renew-le-certs
- sudo gitlab-ctl restart
參考資料
- ↑ Requirements. [2019-12-10].
- ↑ GitLab Installation. [2019-12-10].
- ↑ Unable to renew letsencrypt certificate anymore. [2019-12-18].
- ↑ Is it fine to remove the /opt/gitlab/ directory manually after removing the gitlab package from the system?. 2016-09-14 [2019-12-10].
外部連結
- 官方網站 (英文)