From 314a21a6c2260308732cfe041634bd56f3679475 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 23 Mar 2016 10:36:22 +0530 Subject: [PATCH 1/4] gitlab-shell: upgrade to v.2.6.11 --- Changelog.md | 3 +++ Dockerfile | 2 +- assets/runtime/config/gitlab-shell/config.yml | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 0b097c12..5ef98475 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,9 @@ This file only reflects the changes that are made in this image. Please refer to the upstream GitLab [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) for the list of changes in GitLab. +**latest** +- gitlab-shell: upgrade to v.2.6.11 + **8.5.8** - gitlab: upgrade to CE v8.5.8 diff --git a/Dockerfile b/Dockerfile index d1bf7601..cf0cacae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM sameersbn/ubuntu:14.04.20160321 MAINTAINER sameer@damagehead.com ENV GITLAB_VERSION=8.5.8 \ - GITLAB_SHELL_VERSION=2.6.10 \ + GITLAB_SHELL_VERSION=2.6.11 \ GITLAB_WORKHORSE_VERSION=0.6.4 \ GOLANG_VERSION=1.5.3 \ GITLAB_USER="git" \ diff --git a/assets/runtime/config/gitlab-shell/config.yml b/assets/runtime/config/gitlab-shell/config.yml index 5cda3467..ce4b4c71 100644 --- a/assets/runtime/config/gitlab-shell/config.yml +++ b/assets/runtime/config/gitlab-shell/config.yml @@ -6,8 +6,8 @@ # GitLab user. git by default user: git -# Url to gitlab instance. Used for api calls. -# Default: http://localhost:8080 +# URL to GitLab instance, used for API calls. Default: http://localhost:8080. +# For relative URL support read http://doc.gitlab.com/ce/install/relative_url.html # You only have to change the default if you have configured Unicorn # to listen on a custom port, or if you have configured Unicorn to # only listen on a Unix domain socket. For Unix domain sockets use @@ -17,6 +17,7 @@ gitlab_url: "http://localhost:8080{{GITLAB_RELATIVE_URL_ROOT}}" # See installation.md#using-https for additional HTTPS configuration details. http_settings: +# read_timeout: 300 # user: someone # password: somepass # ca_file: /etc/ssl/cert.pem From fee7ce6eedf1bb73ecbe8cf1d299e97e5cfbd804 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 23 Mar 2016 10:38:14 +0530 Subject: [PATCH 2/4] gitlab-workhorse: upgrade to v0.7.1 --- Changelog.md | 1 + Dockerfile | 2 +- assets/build/install.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 5ef98475..6f745790 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,7 @@ This file only reflects the changes that are made in this image. Please refer to **latest** - gitlab-shell: upgrade to v.2.6.11 +- gitlab-workhorse: upgrade to v0.7.1 **8.5.8** - gitlab: upgrade to CE v8.5.8 diff --git a/Dockerfile b/Dockerfile index cf0cacae..4e73c526 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ MAINTAINER sameer@damagehead.com ENV GITLAB_VERSION=8.5.8 \ GITLAB_SHELL_VERSION=2.6.11 \ - GITLAB_WORKHORSE_VERSION=0.6.4 \ + GITLAB_WORKHORSE_VERSION=0.7.1 \ GOLANG_VERSION=1.5.3 \ GITLAB_USER="git" \ GITLAB_HOME="/home/git" \ diff --git a/assets/build/install.sh b/assets/build/install.sh index bbbb4301..18470084 100755 --- a/assets/build/install.sh +++ b/assets/build/install.sh @@ -56,7 +56,7 @@ exec_as_git ./bin/install exec_as_git rm -rf ${GITLAB_HOME}/repositories echo "Cloning gitlab-workhorse v.${GITLAB_WORKHORSE_VERSION}..." -exec_as_git git clone -q -b ${GITLAB_WORKHORSE_VERSION} --depth 1 ${GITLAB_WORKHORSE_CLONE_URL} ${GITLAB_WORKHORSE_INSTALL_DIR} +exec_as_git git clone -q -b v${GITLAB_WORKHORSE_VERSION} --depth 1 ${GITLAB_WORKHORSE_CLONE_URL} ${GITLAB_WORKHORSE_INSTALL_DIR} echo "Downloading Go ${GOLANG_VERSION}..." wget -cnv https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-amd64.tar.gz -P ${GITLAB_BUILD_DIR}/ From b5ef682d55c5543104183eb6099ad1777361c9e4 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 23 Mar 2016 10:38:35 +0530 Subject: [PATCH 3/4] gitlab: upgrade to CE v8.6.0 --- Changelog.md | 1 + Dockerfile | 2 +- README.md | 9 +++++---- docker-compose.yml | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Changelog.md b/Changelog.md index 6f745790..d32e599d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -5,6 +5,7 @@ This file only reflects the changes that are made in this image. Please refer to **latest** - gitlab-shell: upgrade to v.2.6.11 - gitlab-workhorse: upgrade to v0.7.1 +- gitlab: upgrade to CE v8.6.0 **8.5.8** - gitlab: upgrade to CE v8.5.8 diff --git a/Dockerfile b/Dockerfile index 4e73c526..8bd3d6da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM sameersbn/ubuntu:14.04.20160321 MAINTAINER sameer@damagehead.com -ENV GITLAB_VERSION=8.5.8 \ +ENV GITLAB_VERSION=8.6.0 \ GITLAB_SHELL_VERSION=2.6.11 \ GITLAB_WORKHORSE_VERSION=0.7.1 \ GOLANG_VERSION=1.5.3 \ diff --git a/README.md b/README.md index 152ee1e7..1544fa01 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,7 @@ Step 1. Launch a postgresql container docker run --name gitlab-postgresql -d \ --env 'DB_NAME=gitlabhq_production' \ --env 'DB_USER=gitlab' --env 'DB_PASS=password' \ + --env 'DB_EXTENSION=pg_trgm' \ --volume /srv/docker/gitlab/postgresql:/var/lib/postgresql \ sameersbn/postgresql:9.4-17 ``` @@ -180,10 +181,7 @@ docker run --name gitlab -d \ __NOTE__: Please allow a couple of minutes for the GitLab application to start. -Point your browser to `http://localhost:10080` and login using the default username and password: - -* username: **root** -* password: **5iveL!fe** +Point your browser to `http://localhost:10080` and set a password for the `root` user account. You should now have the GitLab application up and ready for testing. If you want to use this image in production the please read on. @@ -232,6 +230,8 @@ CREATE DATABASE gitlabhq_production; GRANT ALL PRIVILEGES ON DATABASE gitlabhq_production to gitlab; ``` +Additionally since GitLab `8.6.0` the `pg_trgm` extension should also be loaded for the `gitlabhq_production` database. + We are now ready to start the GitLab application. *Assuming that the PostgreSQL server host is 192.168.1.100* @@ -274,6 +274,7 @@ The run command looks like this. docker run --name gitlab-postgresql -d \ --env 'DB_NAME=gitlabhq_production' \ --env 'DB_USER=gitlab' --env 'DB_PASS=password' \ + --env 'DB_EXTENSION=pg_trgm' \ --volume /srv/docker/gitlab/postgresql:/var/lib/postgresql \ sameersbn/postgresql:9.4-17 ``` diff --git a/docker-compose.yml b/docker-compose.yml index edbb9282..b3653876 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,7 @@ postgresql: - DB_USER=gitlab - DB_PASS=password - DB_NAME=gitlabhq_production + - DB_EXTENSION=pg_trgm volumes: - /srv/docker/gitlab/postgresql:/var/lib/postgresql gitlab: From 6cf973a9fd4144eadc117f855c3f3dc5b29b0405 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 23 Mar 2016 11:27:03 +0530 Subject: [PATCH 4/4] exposed configuration parameters for auth0 OAUTH support --- Changelog.md | 1 + README.md | 9 +++++++++ assets/runtime/config/gitlabhq/gitlab.yml | 5 +++++ assets/runtime/functions | 16 ++++++++++++++++ 4 files changed, 31 insertions(+) diff --git a/Changelog.md b/Changelog.md index d32e599d..f649d22a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,7 @@ This file only reflects the changes that are made in this image. Please refer to - gitlab-shell: upgrade to v.2.6.11 - gitlab-workhorse: upgrade to v0.7.1 - gitlab: upgrade to CE v8.6.0 +- exposed configuration parameters for auth0 OAUTH support **8.5.8** - gitlab: upgrade to CE v8.5.8 diff --git a/README.md b/README.md index 1544fa01..58e5f666 100644 --- a/README.md +++ b/README.md @@ -716,6 +716,12 @@ To enable the Crowd server OAuth2 OmniAuth provider you must register your appli Configure GitLab to enable access the Crowd server by specifying the `OAUTH_CROWD_SERVER_URL`, `OAUTH_CROWD_APP_NAME` and `OAUTH_CROWD_APP_PASSWORD` environment variables. +#### Auth0 + +To enable the Auth0 OmniAuth provider you must register your application with [auth0](https://auth0.com/). + +Configure the following environment variables `OAUTH_AUTH0_CLIENT_ID`, `OAUTH_AUTH0_CLIENT_SECRET` and `OAUTH_AUTH0_DOMAIN` to complete the integration. + #### Microsoft Azure To enable the Microsoft Azure OAuth2 OmniAuth provider you must register your application with Azure. Azure will generate a Client ID, Client secret and Tenant ID for you to use. Please refer to the GitLab [documentation](http://doc.gitlab.com/ce/integration/azure.html) for the procedure. @@ -906,6 +912,9 @@ Below is the complete list of available options that can be used to customize yo - **OAUTH_CROWD_SERVER_URL**: Crowd server url. No defaults. - **OAUTH_CROWD_APP_NAME**: Crowd server application name. No defaults. - **OAUTH_CROWD_APP_PASSWORD**: Crowd server application password. No defaults. +- **OAUTH_AUTH0_CLIENT_ID**: Auth0 Client ID. No defaults. +- **OAUTH_AUTH0_CLIENT_SECRET**: Auth0 Client secret. No defaults. +- **OAUTH_AUTH0_DOMAIN**: Auth0 Domain. No defaults. - **OAUTH_AZURE_API_KEY**: Azure Client ID. No defaults. - **OAUTH_AZURE_API_SECRET**: Azure Client secret. No defaults. - **OAUTH_AZURE_TENANT_ID**: Azure Tenant ID. No defaults. diff --git a/assets/runtime/config/gitlabhq/gitlab.yml b/assets/runtime/config/gitlabhq/gitlab.yml index 8ab3942b..53ea02d7 100644 --- a/assets/runtime/config/gitlabhq/gitlab.yml +++ b/assets/runtime/config/gitlabhq/gitlab.yml @@ -357,6 +357,11 @@ production: &base crowd_server_url: '{{OAUTH_CROWD_SERVER_URL}}', application_name: '{{OAUTH_CROWD_APP_NAME}}', application_password: '{{OAUTH_CROWD_APP_PASSWORD}}' } } + - { name: 'auth0', + args: { + client_id: '{{OAUTH_AUTH0_CLIENT_ID}}', + client_secret: '{{OAUTH_AUTH0_CLIENT_SECRET}}', + namespace: '{{OAUTH_AUTH0_DOMAIN}}' } } - { name: 'azure_oauth2', args: { client_id: '{{OAUTH_AZURE_API_KEY}}', diff --git a/assets/runtime/functions b/assets/runtime/functions index 67fe358d..60dd0f76 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -531,6 +531,21 @@ gitlab_configure_oauth_crowd() { fi } +gitlab_configure_oauth_auth0() { + if [[ -n ${OAUTH_AUTH0_CLIENT_ID} && \ + -n ${OAUTH_AUTH0_CLIENT_SECRET} && \ + -n ${OAUTH_AUTH0_DOMAIN} ]]; then + echo "Configuring gitlab::oauth::auth0..." + OAUTH_ENABLED=${OAUTH_ENABLED:-true} + update_template ${GITLAB_CONFIG} \ + OAUTH_AUTH0_CLIENT_ID \ + OAUTH_AUTH0_CLIENT_SECRET \ + OAUTH_AUTH0_DOMAIN + else + exec_as_git sed -i "/name: 'auth0'/,/{{OAUTH_AUTH0_DOMAIN}}/d" ${GITLAB_CONFIG} + fi +} + gitlab_configure_oauth_azure() { if [[ -n ${OAUTH_AZURE_API_KEY} && \ -n ${OAUTH_AZURE_API_SECRET} && \ @@ -558,6 +573,7 @@ gitlab_configure_oauth() { gitlab_configure_oauth_bitbucket gitlab_configure_oauth_saml gitlab_configure_oauth_crowd + gitlab_configure_oauth_auth0 gitlab_configure_oauth_azure OAUTH_ENABLED=${OAUTH_ENABLED:-false}