前回の記事(GitHubクローンのGitLabを5分でインストールした) ã
æãã®ã»ããã¯ãããã¦ãã¾ã£ãã®ã§è£è¶³è¨äºãæ¸ããã¨ã«ãã¾ããã
ã¤ã³ã¹ãã¼ã«ããå¾ã«è¨å®ããã»ããè¯ãé
ç®ã¨ããã«ã¦ã§ã¢ç«¶åæ¤è¨¼ã
ãã®ä»Tipsãªã©æ¸ãã¦ã¿ã¾ããã
å ¬å¼ããã¥ã¡ã³ã
以ä¸ãè¨äºã§æ¸ãã¦ãããã¨ã¯ã»ã¼ãã¹ã¦ããã¥ã¡ã³ãã«ãæ¸ãã¦ããã¾ãã
ãåç
§ä¸ããã
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#configuration
コンフィグファイル準備
äºåã« /etc/gitlab/gitlab.rb ãç¨æãã¦ããã¾ãã
ãã®ãã¡ã¤ã«ã¯GitLabãã¤ã³ã¹ãã¼ã«ããåã«æåã§ä½ã£ã¦ãã¾ã£ã¦æ§ãã¾ããã*1
sudo mkdir -p /etc/gitlab sudo touch /etc/gitlab/gitlab.rb sudo chmod 600 /etc/gitlab/gitlab.rb
ããã¦ãã³ã³ãã£ã°è¨å®å¾ã«
sudo gitlab-ctl reconfigure
ããã¨ãGitLabã«åæ ããããã§ãã
è¨å®ãã¹ãã³ã³ãã£ã°å¤
GitLab URL
ãã¡ãã¨ãµã¤ãã®URLã¨åããã¦ããã¾ãããã
external_url "http://gitlab.example.com/"
SMTP
ã¡ã¼ã«éç¥ãªã©ã«ä½¿ãã¾ãã
gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.server" gitlab_rails['smtp_port'] = 456 gitlab_rails['smtp_user_name'] = "smtp user" gitlab_rails['smtp_password'] = "smtp password" gitlab_rails['smtp_domain'] = "example.com" gitlab_rails['smtp_authentication'] = "login" gitlab_rails['smtp_enable_starttls_auto'] = true
ãã®ä»ã³ã³ãã£ã°å¤
HTTPS設定
URLã®HTTPSåï¼è¨¼ææ¸ãã¹ãªã©ã追è¨ãã¾ãã
external_url "https://gitlab.example.com" nginx['redirect_http_to_https'] = true nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.crt" nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.key"
Google, Twitter, GitHub login設定
Omniauthè¨å®ãè¡ããã¨ã«ãããå¤é¨èªè¨¼ãããã¨ãå¯è½ã§ãã
gitlab_rails['omniauth_enabled'] = true gitlab_rails['omniauth_providers'] = [ { "name" => "google_oauth2", "app_id" => "YOUR APP ID", "app_secret" => "YOUR APP SECRET", "args" => { "access_type" => "offline", "approval_prompt" => "" } } ]
ã¡ãªã¿ã«å¼ç¤¾ã§ã¯ãRedmine Omniauthã§
Redmineã¢ã«ã¦ã³ãã§ãã°ã¤ã³åºæ¥ãããã«ãã¦ãã¾ãã
ããã«ã¦ã§ã¢æ··å¨ç°å¢ã§ã®æ¤è¨¼çµæ
â» 2014/10/10追è¨åï¼æ¢åã®ããã«ã¦ã§ã¢ãå©ç¨ããæ¹æ³
ãããããomnibus-installã§ããã«ã¦ã§ã¢ãã¤ã³ã¹ãã¼ã«ããã«ã
æ¢åã®ç°å¢ã使ãã¾ãããã¨ãåºæ¥ãããã§ãã
ãã¨ãã°ãNginxãæ¢ã«ã¤ã³ã¹ãã¼ã«æ¸ã¿ã§ããã°
omnibus-installã§ã¯ã¤ã³ã¹ãã¼ã«ããã«
æ¢åã®Nginxã³ã³ãã£ã°ã追å ããã ãã§åãããã¨ãåºæ¥ã¾ãã
ex) æ¢ã«ã¤ã³ã¹ãã¼ã«æ¸ã¿ã®Postgresqlãå©ç¨ããå ´å
1. /etc/gitlab/gitlab.rb ã«ä»¥ä¸ã追è¨ãã¾ãã
# postgresã¤ã³ã¹ãã¼ã«ãç¡å¹ã«ãã postgresql['enable'] = false # ä»ã®ããã«ã¦ã§ã¢ãã¤ã³ã¹ãã¼ã«åé¿ããæã¯ãããªæã #nginx['enable'] = false #redis['enable'] = false #postgresql['enable'] = false # postgresã®æ å ±ãå ¥å gitlab_rails['db_adapter'] = 'postgresql' gitlab_rails['db_encoding'] = 'unicode' gitlab_rails['db_database'] = 'gitlabhq_production' gitlab_rails['db_host'] = '127.0.0.1' gitlab_rails['db_port'] = '5432' gitlab_rails['db_username'] = 'git' # Database owner. gitlab_rails['db_password'] = 'git' # Database owner's password.
2. sudo gitlab-ctl reconfigure ãå®è¡ãã¦gitlabã«åæ
3. sudo gitlab-rake gitlab:setup ãå®è¡ãã¦ãåæãã¼ã¿ãæå
¥
ããã§ãæ¢åã®ç°å¢ã«gitlabã®DBç°å¢ã®è¨å®ãå®äºã§ãã*2
ãã¼ã競åãåé¿ããæ¹æ³
ååã®è¨äºã§ã触ãã¾ããããGitLabãRPMã¤ã³ã¹ãã¼ã«ããã¨
NginxããRedisãããä¸ç·ã«å梱ããã¾ãã
ãã±ã¼ã·ã§ã³ã¯å¥*3ã«ãªãã®ã§åé¡ãªãã®ã§ãããã¼ãã¯ç«¶åãã¦ãã¾ãã¾ãã
ãã ãããããåé¿ããè¨å®ãã³ã³ãã£ã°ã«è¿½è¨ããã°å¤§ä¸å¤«ããã§ãã
以ä¸ã«ãµã³ãã«ãç¨æãã¾ããã
nginx(88)ï¼postgresql(15432)/redis(16379)/unicorn(18080) ã®ãã¼ããæå®ãã¦ãã¾ãã
redis['port'] = 16379 postgresql['port'] = 15432 unicorn['port'] = 18080 external_url "http://gitlab.example.com:88/"
å®éã«æ¤è¨¼ãã¦ã¿ã¾ãããã
å
ããã¤ã³ã¹ãã¼ã«ããã¦ããããã«ã¦ã§ã¢ã«å½±é¿ãããã«
GitLabãèµ·åãããã¨ãåºæ¥ã¾ããã
ã¾ã¨ã
åãæ¥ãã§ãããååã®è£è¶³è¨äºã§ããã
ã³ã³ãã£ã°ã«æå®ãã¦ãããã¼ã¯
このattributesãå¤æ´ãã¦ãããããªã®ã§
ãã®ãã¡ã¤ã«ãè¦ã¦ãã¼ã確èªããã°å¥½ãã«ã«ã¹ã¿ãã¤ãºã§ãããã§ããã
ã§ã¯è¯ãGitLabã©ã¤ããï¼
*1:ã¨ããã reconfigure ããåã«ã¯ä½ã£ã¦ããã¾ããã
*2:åèï¼ http://stackoverflow.com/questions/23580268/gitlab-omnibus-configuration-for-postgres
*3:/opt/gitlab/é ä¸