Merge branch 'gitlab-next'

This commit is contained in:
Sameer Naik 2015-03-23 16:23:47 +05:30
commit d85ed24420
6 changed files with 43 additions and 34 deletions

View File

@ -1,5 +1,14 @@
# Changelog
**latest**
- gitlab-shell: upgrade to v.2.6.0
- gitlab: upgrade to CE v.7.9.0
- init: set default value of `UNICORN_WORKERS` to `3`
- init: set default value of `SMTP_OPENSSL_VERIFY_MODE` to `peer`
- init: removed `GITLAB_RESTRICTED_VISIBILITY` configuration option, can be set from the UI
- init: added BitBucket OAuth configuration support
- init: added `GITLAB_EMAIL_DISPLAY_NAME` configuration option
**7.8.4**
- gitlab: upgrade to CE v.7.8.4

View File

@ -12,7 +12,7 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv E1DF1F24 \
&& apt-get update \
&& apt-get install -y supervisor logrotate locales \
nginx openssh-server mysql-client postgresql-client redis-tools \
git-core ruby2.1 python2.7 python-docutils \
git-core ruby2.1 python2.7 python-docutils nodejs \
libmysqlclient18 libpq5 zlib1g libyaml-0-2 libssl1.0.0 \
libgdbm3 libreadline6 libncurses5 libffi6 \
libxml2 libxslt1.1 libcurl3 libicu52 \

View File

@ -719,7 +719,8 @@ Below is the complete list of available options that can be used to customize yo
- **GITLAB_PORT**: The port of the GitLab server. Defaults to `80` for plain http and `443` when https is enabled.
- **GITLAB_TIMEZONE**: Configure the timezone for the gitlab application. This configuration does not effect cron jobs. Defaults to `UTC`.
- **GITLAB_ROOT_PASSWORD**: The password for the root user. Defaults to `5iveL!fe`.
- **GITLAB_EMAIL**: The email address for the GitLab server. Defaults to `example@example.com`.
- **GITLAB_EMAIL**: The email address for the GitLab server. Defaults to `example@example.com`.
- **GITLAB_EMAIL_DISPLAY_NAME**: The name displayed in emails sent out by the GitLab mailer. Defaults to `GitLab`.
- **GITLAB_EMAIL_ENABLED**: Enable or disable gitlab mailer. Defaults to the `SMTP_ENABLED` configuration.
- **GITLAB_USERNAME_CHANGE**: Enable or disable ability for users to change their username. Defaults is `true`.
- **GITLAB_CREATE_GROUP**: Enable or disable ability for users to create groups. Defaults is `true`.
@ -728,7 +729,6 @@ Below is the complete list of available options that can be used to customize yo
- **GITLAB_PROJECTS_WIKI**: Set if *wiki* feature should be enabled by default for new projects. Defaults is `true`.
- **GITLAB_PROJECTS_SNIPPETS**: Set if *snippets* feature should be enabled by default for new projects. Defaults is `false`.
- **GITLAB_PROJECTS_VISIBILITY**: Set default projects visibility level. Possible values `public`, `private` and `internal`. Defaults to `private`.
- **GITLAB_RESTRICTED_VISIBILITY**: Comma separated list of visibility levels to restrict non-admin users to set. Possible visibility options are `public`, `private` and `internal`.
- **GITLAB_WEBHOOK_TIMEOUT**: Sets the timeout for webhooks. Defaults to `10` seconds.
- **GITLAB_BACKUP_DIR**: The backup folder in the container. Defaults to `/home/git/data/backups`
- **GITLAB_BACKUPS**: Setup cron job to automatic backups. Possible values `disable`, `daily`, `weekly` or `monthly`. Disabled by default
@ -751,7 +751,7 @@ Below is the complete list of available options that can be used to customize yo
- **NGINX_X_FORWARDED_PROTO**: Advanced configuration option for the `proxy_set_header X-Forwarded-Proto` setting in the gitlab nginx vHost configuration. Defaults to `https` when `GITLAB_HTTPS` is `true`, else defaults to `$scheme`.
- **REDIS_HOST**: The hostname of the redis server. Defaults to `localhost`
- **REDIS_PORT**: The connection port of the redis server. Defaults to `6379`.
- **UNICORN_WORKERS**: The number of unicorn workers to start. Defaults to `2`.
- **UNICORN_WORKERS**: The number of unicorn workers to start. Defaults to `3`.
- **UNICORN_TIMEOUT**: Sets the timeout of unicorn worker processes. Defaults to `60` seconds.
- **SIDEKIQ_CONCURRENCY**: The number of concurrent sidekiq jobs to run. Defaults to `25`
- **DB_TYPE**: The database type. Possible values: `mysql`, `postgres`. Defaults to `mysql`.
@ -768,7 +768,7 @@ Below is the complete list of available options that can be used to customize yo
- **SMTP_USER**: SMTP username.
- **SMTP_PASS**: SMTP password.
- **SMTP_STARTTLS**: Enable STARTTLS. Defaults to `true`.
- **SMTP_OPENSSL_VERIFY_MODE**: SMTP openssl verification mode. Accepted values are `none`, `peer`, `client_once` and `fail_if_no_peer_cert`. SSL certificate verification is performed by default.
- **SMTP_OPENSSL_VERIFY_MODE**: SMTP openssl verification mode. Accepted values are `none`, `peer`, `client_once` and `fail_if_no_peer_cert`. Defaults to `peer`.
- **SMTP_AUTHENTICATION**: Specify the SMTP authentication method. Defaults to `login` if `SMTP_USER` is set.
- **LDAP_ENABLED**: Enable LDAP. Defaults to `false`
- **LDAP_HOST**: LDAP Host
@ -792,6 +792,8 @@ Below is the complete list of available options that can be used to customize yo
- **OAUTH_GITHUB_APP_SECRET**: GitHub App Client secret. No defaults.
- **OAUTH_GITLAB_API_KEY**: GitLab App Client ID. No defaults.
- **OAUTH_GITLAB_APP_SECRET**: GitLab App Client secret. No defaults.
- **OAUTH_BITBUCKET_API_KEY**: BitBucket App Client ID. No defaults.
- **OAUTH_BITBUCKET_APP_SECRET**: BitBucket App Client secret. No defaults.
- **REDMINE_URL**: Location of the redmine server, e.g. `-e 'REDMINE_URL=https://redmine.example.com'`. No defaults.
- **JIRA_URL**: Location of the jira server, e.g. `-e 'JIRA_URL=https://jira.example.com'`. No defaults.
- **USERMAP_UID**: Sets the uid for user `git` to the specified uid. Defaults to `1000`.

View File

@ -43,6 +43,7 @@ production: &base
email_enabled: {{GITLAB_EMAIL_ENABLED}}
# Email address used in the "From" field in mails sent by GitLab
email_from: "{{GITLAB_EMAIL}}"
email_display_name: "{{GITLAB_EMAIL_DISPLAY_NAME}}"
# Email server smtp settings are in config/initializers/smtp_settings.rb.sample
@ -56,10 +57,6 @@ production: &base
## COLOR = 5
# default_theme: 2 # default: 2
# Restrict setting visibility levels for non-admin users.
# The default is to allow all levels.
restricted_visibility_levels: [ {{GITLAB_RESTRICTED_VISIBILITY}} ]
## Automatic issue closing
# If a commit message matches this regular expression, all issues referenced from the matched text will be closed.
# This happens when the commit is pushed or merged into the default branch of a project.
@ -223,7 +220,9 @@ production: &base
args: { scope: '{{OAUTH_GITHUB_SCOPE}}' } }
- { name: 'gitlab', app_id: '{{OAUTH_GITLAB_API_KEY}}',
app_secret: '{{OAUTH_GITLAB_APP_SECRET}}',
args: { scope: '{{OAUTH_GITLAB_SCOPE}}' } }
args: { scope: '{{OAUTH_GITLAB_SCOPE}}' } },
- { name: 'bitbucket', app_id: '{{OAUTH_BITBUCKET_API_KEY}}',
app_secret: '{{OAUTH_BITBUCKET_APP_SECRET}}'}

View File

@ -19,6 +19,7 @@ GITLAB_SSH_PORT=${GITLAB_SSH_PORT:-$GITLAB_SHELL_SSH_PORT} # for backwards compa
GITLAB_SSH_PORT=${GITLAB_SSH_PORT:-22}
GITLAB_HTTPS=${GITLAB_HTTPS:-false}
GITLAB_EMAIL=${GITLAB_EMAIL:-example@example.com}
GITLAB_EMAIL_DISPLAY_NAME=${GITLAB_EMAIL_DISPLAY_NAME:-GitLab}
GITLAB_TIMEZONE=${GITLAB_TIMEZONE:-UTC}
GITLAB_USERNAME_CHANGE=${GITLAB_USERNAME_CHANGE:-true}
GITLAB_CREATE_GROUP=${GITLAB_CREATE_GROUP:-true}
@ -28,7 +29,6 @@ GITLAB_PROJECTS_WIKI=${GITLAB_PROJECTS_WIKI:-true}
GITLAB_PROJECTS_SNIPPETS=${GITLAB_PROJECTS_SNIPPETS:-false}
GITLAB_PROJECTS_VISIBILITY=${GITLAB_PROJECTS_VISIBILITY:-private}
GITLAB_RELATIVE_URL_ROOT=${GITLAB_RELATIVE_URL_ROOT:-}
GITLAB_RESTRICTED_VISIBILITY=${GITLAB_RESTRICTED_VISIBILITY:-}
GITLAB_WEBHOOK_TIMEOUT=${GITLAB_WEBHOOK_TIMEOUT:-10}
SSL_SELF_SIGNED=${SSL_SELF_SIGNED:-false}
@ -55,7 +55,7 @@ esac
REDIS_HOST=${REDIS_HOST:-}
REDIS_PORT=${REDIS_PORT:-}
UNICORN_WORKERS=${UNICORN_WORKERS:-2}
UNICORN_WORKERS=${UNICORN_WORKERS:-3}
UNICORN_TIMEOUT=${UNICORN_TIMEOUT:-60}
SIDEKIQ_CONCURRENCY=${SIDEKIQ_CONCURRENCY:-25}
@ -72,7 +72,7 @@ SMTP_HOST=${SMTP_HOST:-smtp.gmail.com}
SMTP_PORT=${SMTP_PORT:-587}
SMTP_USER=${SMTP_USER:-}
SMTP_PASS=${SMTP_PASS:-}
SMTP_OPENSSL_VERIFY_MODE=${SMTP_OPENSSL_VERIFY_MODE:-}
SMTP_OPENSSL_VERIFY_MODE=${SMTP_OPENSSL_VERIFY_MODE:-peer}
SMTP_STARTTLS=${SMTP_STARTTLS:-true}
if [ -n "${SMTP_USER}" ]; then
SMTP_ENABLED=${SMTP_ENABLED:-true}
@ -115,6 +115,9 @@ OAUTH_GITHUB_APP_SECRET=${OAUTH_GITHUB_APP_SECRET:-}
OAUTH_GITLAB_API_KEY=${OAUTH_GITLAB_API_KEY:-}
OAUTH_GITLAB_APP_SECRET=${OAUTH_GITLAB_APP_SECRET:-}
OAUTH_BITBUCKET_API_KEY=${OAUTH_BITBUCKET_API_KEY:-}
OAUTH_BITBUCKET_APP_SECRET=${OAUTH_BITBUCKET_APP_SECRET:-}
GOOGLE_ANALYTICS_ID=${GOOGLE_ANALYTICS_ID:-}
PIWIK_URL=${PIWIK_URL:-}
@ -380,6 +383,7 @@ sudo -u git -H sed 's/{{GITLAB_HOST}}/'"${GITLAB_HOST}"'/' -i config/gitlab.yml
sudo -u git -H sed 's/{{GITLAB_PORT}}/'"${GITLAB_PORT}"'/' -i config/gitlab.yml
sudo -u git -H sed 's/{{GITLAB_HTTPS}}/'"${GITLAB_HTTPS}"'/' -i config/gitlab.yml
sudo -u git -H sed 's/{{GITLAB_EMAIL}}/'"${GITLAB_EMAIL}"'/' -i config/gitlab.yml
sudo -u git -H sed 's/{{GITLAB_EMAIL_DISPLAY_NAME}}/'"${GITLAB_EMAIL_DISPLAY_NAME}"'/' -i config/gitlab.yml
sudo -u git -H sed 's/{{GITLAB_BACKUP_EXPIRY}}/'"${GITLAB_BACKUP_EXPIRY}"'/' -i config/gitlab.yml
sudo -u git -H sed 's/{{GITLAB_MAX_SIZE}}/'"${GITLAB_MAX_SIZE}"'/' -i config/gitlab.yml
sudo -u git -H sed 's/{{GITLAB_SSH_HOST}}/'"${GITLAB_SSH_HOST}"'/' -i config/gitlab.yml
@ -409,9 +413,6 @@ sudo -u git -H sed 's/{{GITLAB_PROJECTS_SNIPPETS}}/'"${GITLAB_PROJECTS_SNIPPETS}
# configure gitlab default project feature: visibility_level
sudo -u git -H sed 's/{{GITLAB_PROJECTS_VISIBILITY}}/'"${GITLAB_PROJECTS_VISIBILITY}"'/' -i config/gitlab.yml
# configure gitlab restricted_visibility_levels
sudo -u git -H sed 's/{{GITLAB_RESTRICTED_VISIBILITY}}/'"${GITLAB_RESTRICTED_VISIBILITY}"'/' -i config/gitlab.yml
# configure gitlab webhook timeout
sudo -u git -H sed 's/{{GITLAB_WEBHOOK_TIMEOUT}}/'"${GITLAB_WEBHOOK_TIMEOUT}"'/' -i config/gitlab.yml
@ -476,12 +477,7 @@ if [ "${SMTP_ENABLED}" == "true" ]; then
sudo -u git -H sed 's/{{SMTP_DOMAIN}}/'"${SMTP_DOMAIN}"'/' -i config/initializers/smtp_settings.rb
sudo -u git -H sed 's/{{SMTP_STARTTLS}}/'"${SMTP_STARTTLS}"'/' -i config/initializers/smtp_settings.rb
if [ -n "${SMTP_OPENSSL_VERIFY_MODE}" ]; then
sudo -u git -H sed 's/{{SMTP_OPENSSL_VERIFY_MODE}}/'"${SMTP_OPENSSL_VERIFY_MODE}"'/' -i config/initializers/smtp_settings.rb
else
sudo -u git -H sed '/{{SMTP_OPENSSL_VERIFY_MODE}}/d' -i config/initializers/smtp_settings.rb
fi
sudo -u git -H sed 's/{{SMTP_OPENSSL_VERIFY_MODE}}/'"${SMTP_OPENSSL_VERIFY_MODE}"'/' -i config/initializers/smtp_settings.rb
case "${SMTP_AUTHENTICATION}" in
"") sudo -u git -H sed '/{{SMTP_AUTHENTICATION}}/d' -i config/initializers/smtp_settings.rb ;;
@ -588,6 +584,16 @@ else
sudo -u git -H sed '/{{OAUTH_GITLAB_SCOPE}}/d' -i config/gitlab.yml
fi
# bitbucket
if [ -n "${OAUTH_BITBUCKET_API_KEY}" -a -n "${OAUTH_BITBUCKET_APP_SECRET}" ]; then
OAUTH_ENABLED=true
sudo -u git -H sed 's/{{OAUTH_BITBUCKET_API_KEY}}/'"${OAUTH_BITBUCKET_API_KEY}"'/' -i config/gitlab.yml
sudo -u git -H sed 's/{{OAUTH_BITBUCKET_APP_SECRET}}/'"${OAUTH_BITBUCKET_APP_SECRET}"'/' -i config/gitlab.yml
else
sudo -u git -H sed '/{{OAUTH_BITBUCKET_API_KEY}}/d' -i config/gitlab.yml
sudo -u git -H sed '/{{OAUTH_BITBUCKET_APP_SECRET}}/d' -i config/gitlab.yml
fi
# google analytics
if [ -n "${GOOGLE_ANALYTICS_ID}" ]; then
sudo -u git -H sed 's/{{GOOGLE_ANALYTICS_ID}}/'"${GOOGLE_ANALYTICS_ID}"'/' -i config/gitlab.yml

View File

@ -1,8 +1,8 @@
#!/bin/bash
set -e
GITLAB_VERSION=7.8.4
GITLAB_SHELL_VERSION=2.5.4
GITLAB_VERSION=7.9.0
GITLAB_SHELL_VERSION=2.6.0
GITLAB_HOME="/home/git"
GITLAB_INSTALL_DIR="${GITLAB_HOME}/gitlab"
@ -37,16 +37,6 @@ sudo -u git -H ln -s ${GITLAB_DATA_DIR}/.ssh /home/git/.ssh
# create the data store
sudo -u git -H mkdir -p ${GITLAB_DATA_DIR}
# install gitlab-shell, use local copy if available
echo "Cloning gitlab-shell v.${GITLAB_SHELL_VERSION}..."
sudo -u git -H git clone -q -b v${GITLAB_SHELL_VERSION} --depth 1 \
https://github.com/gitlabhq/gitlab-shell.git ${GITLAB_SHELL_INSTALL_DIR}
cd ${GITLAB_SHELL_INSTALL_DIR}
sudo -u git -H cp -a config.yml.example config.yml
sudo -u git -H ./bin/install
# shallow clone gitlab-ce
echo "Cloning gitlab-ce v.${GITLAB_VERSION}..."
sudo -u git -H git clone -q -b v${GITLAB_VERSION} --depth 1 \
@ -93,6 +83,9 @@ if [ -d "${GEM_CACHE_DIR}" ]; then
fi
sudo -u git -H bundle install --deployment --without development test aws
# install gitlab-shell
sudo -u git -H bundle exec rake gitlab:shell:install[v${GITLAB_SHELL_VERSION}] REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production
# make sure everything in /home/git is owned by the git user
chown -R git:git /home/git/