From 68c59ebf41b81d299e44b49d12c1e5d0a05d4353 Mon Sep 17 00:00:00 2001 From: Thom Wiggers Date: Sun, 2 Apr 2017 13:31:04 +0200 Subject: [PATCH 3/3] Update gitlab to 9.0.2 --- gitlab/trunk/PKGBUILD | 13 ++++++------- gitlab/trunk/gitlab.install | 19 +++++++++++++++++++ gitlab/trunk/nginx-ssl.conf.example | 14 +++++++++++++- gitlab/trunk/nginx.conf.example | 10 +++++++++- 4 files changed, 47 insertions(+), 9 deletions(-) diff --git a/gitlab/trunk/PKGBUILD b/gitlab/trunk/PKGBUILD index df910b56ac6..f2885789fe6 100644 --- a/gitlab/trunk/PKGBUILD +++ b/gitlab/trunk/PKGBUILD @@ -7,14 +7,14 @@ # Contributor: Caleb Maclennan pkgname=gitlab -pkgver=8.17.4 +pkgver=9.0.2 pkgrel=1 pkgdesc="Project management and code hosting application" arch=('i686' 'x86_64') url="https://gitlab.com/gitlab-org/gitlab-ce/tree/master#README" license=('MIT') depends=('ruby2.3' 'git' 'ruby2.3-bundler' 'gitlab-workhorse' 'openssh' 'redis' 'libxslt' 'icu' 'nodejs') -makedepends=('cmake' 'postgresql' 'mariadb' 'npm') +makedepends=('cmake' 'postgresql' 'mariadb' 'npm' 'yarn') optdepends=('postgresql: database backend' 'mysql: database backend' 'python2-docutils: reStructuredText markup language support' @@ -41,7 +41,7 @@ source=("$pkgname-$pkgver.tar.gz::https://gitlab.com/gitlab-org/gitlab-ce/reposi nginx-ssl.conf.example lighttpd.conf.example) install='gitlab.install' -sha512sums=('d76f2ae679b6e80a0383df0cc2d3ceb7318e7fe3b5435eaf1e69539ecca8f7c0fe838809264d46ea9a352b724da70208aedae775ebe039dfc4d5a5f53774ddd9' +sha512sums=('fcb2d1374641d62d80b31c01e47072f3105936c8f59e4840d7890d466708d4212e098f78afdf66fd28ddfdae3c45b329b97c0fc0cc0377668c46e6103867c808' '56cce150645ef74fa42a6100c8bc7689c4012579e1f3ba237c06c367b121246b39e968044615fa21c4757bc8e9d06f37f8ac8d39aa8b808c758e716857553f66' '52651e4a5dd2d632e31b7275283f9b8ab2c32c4d56b63d17bd843f300e273e382e339e5aed66222b1b2279273357cbb73aa38119f04784fe380d1550346f1ff3' '79cfb8ee740ab30f970c3113659b8349128abeae5e32cc81bb905f89a6db9941b7778040a094b884262daf020f66a1aee49a12d34fbb94efce6ade946bb4625b' @@ -54,8 +54,8 @@ sha512sums=('d76f2ae679b6e80a0383df0cc2d3ceb7318e7fe3b5435eaf1e69539ecca8f7c0fe8 '99f31439d348e21f764875b6207db8663b47f3224ad6a9f35b89c8a2ed29a9e831a974aa6b9429a3882fb74c1c9d42ed5c38b2d16ae122b5d55d5873a0c57cd3' '624eb1f13e0265522290faa8c22b4150e6081ca2580391c9dfd871f1ee1b9c1c745c95d3d8f7fdbf85038990060141b844c3d8097c577ab68e5506bfa2d2dddb' '248d47b44fa5ed65e2a940f2b60d0482c481b3a438357ca510848221370367ffbc0d83ce046d688bebbbc75d4e321b140f6a5ce1a9d7ec0b034fafcf92dee107' - '53a9d6d6f87874b29e48a8fb2e207094ebc1a80af478562ec4b591926d59e135a3166c20966704aa948ca7063ba63c1ec4ac290a343832fa18025ec3d85081ba' - '6d3006da591acefcc534c6e3f1da8e812d0b3b21fc416bfaa8678b8e2d922be6b17d1c92b0d7164de3b8ad864139253707107ca082f78e823d23f3b65fcb5914' + 'd5d49f6e612c29afd73de065f92413373d19fabfb0d7752c9e53480f123714c3aed201851f5b446422e54070c1c3290592092605a323192ee9eb93d174e87029' + '6217194d3b7dd3adf745b54ea0b1e5a317372e20e45c8929837dfe7eb9ff3291221d5966b3b960666a3fc3b340a6997c96b523ef4dfa16746157ce80d49f7754' 'c78b6f46abcf603d8db6e38cf50868e14145928422ddfe17c88e2f006b5b910dddf456ec5d6d724b250994530643963809688a98f7e12ebd5b5dabf7f96f0e06') _datadir="/usr/share/webapps/${pkgname}" @@ -120,8 +120,7 @@ build() { cp config/resque.yml.example config/resque.yml sed -i 's/url.*/nope.sock/g' config/resque.yml - npm install --production - bundle-2.3 exec rake gitlab:assets:clean gitlab:assets:compile cache:clear RAILS_ENV=production --trace + bundle-2.3 exec rake yarn:install gitlab:assets:clean gitlab:assets:compile cache:clear RAILS_ENV=production NODE_ENV=production --trace # bundle-2.3 exec rake webpack:compile RAILS_ENV=production --trace # After building assets, clean this up again diff --git a/gitlab/trunk/gitlab.install b/gitlab/trunk/gitlab.install index ae15be812cc..8a99ab8ca86 100644 --- a/gitlab/trunk/gitlab.install +++ b/gitlab/trunk/gitlab.install @@ -1,5 +1,14 @@ +_setup_gitconfig() { + # https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/8.17-to-9.0.md#git-configuration + su - gitlab -s /bin/sh -c "git config --global repack.writeBitmaps true" + # https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md#configure-it + su - gitlab -s /bin/sh -c "git config --global core.autocrlf input" + su - gitlab -s /bin/sh -c "git config --global gc.auto 0" +} + post_install() { systemd-tmpfiles --create gitlab.conf + _setup_gitconfig echo "Configure your /etc/webapps/gitlab/gitlab.yml" echo "Set up your redis to run on /var/run/redis/redis.sock or configure gitlab to use redis TCP" @@ -11,9 +20,19 @@ post_install() { echo "Finally run the following commands to check your installation:" echo "# su - gitlab -s /bin/sh -c \"cd '/usr/share/webapps/gitlab'; bundle-2.3 exec rake gitlab:env:info RAILS_ENV=production\"" echo "# su - gitlab -s /bin/sh -c \"cd '/usr/share/webapps/gitlab'; bundle-2.3 exec rake gitlab:check RAILS_ENV=production\"" + } post_upgrade() { + _setup_gitconfig + + # Configuration changes for updates to 9.0.0 + if [[ $(vercmp "9.0.0" $2) == "1" ]]; then + echo "You need to update the storage settings in your configuration files:" + echo "Review https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/8.17-to-9.0.md#configuration-changes-for-repository-storages" + echo "If you're using SMTP to send email, review https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/8.17-to-9.0.md#smtp-configuration" + fi + echo "You should upgrade your database:" echo "# su - gitlab -s /bin/sh -c \"cd '/usr/share/webapps/gitlab'; bundle-2.3 exec rake db:migrate RAILS_ENV=production\"" echo "Afterwards, restart gitlab-related services:" diff --git a/gitlab/trunk/nginx-ssl.conf.example b/gitlab/trunk/nginx-ssl.conf.example index 5fcf081ba79..1340dbe3f28 100644 --- a/gitlab/trunk/nginx-ssl.conf.example +++ b/gitlab/trunk/nginx-ssl.conf.example @@ -24,6 +24,11 @@ upstream gitlab-workhorse { server unix:/run/gitlab/gitlab-workhorse.socket fail_timeout=0; } +map $http_upgrade $connection_upgrade_gitlab_ssl { + default upgrade; + '' close; +} + ## Redirects all HTTP traffic to the HTTPS host server { ## Either remove "default_server" from the listen line below, @@ -77,6 +82,9 @@ server { ## # ssl_dhparam /etc/ssl/certs/dhparam.pem; + ## [Optional] Enable HTTP Strict Transport Security + # add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; + ## Individual nginx logs for this GitLab vhost access_log /var/log/nginx/gitlab_access.log; error_log /var/log/nginx/gitlab_error.log; @@ -98,6 +106,9 @@ server { proxy_set_header X-Forwarded-Ssl on; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade_gitlab_ssl; + proxy_pass http://gitlab-workhorse; } @@ -105,7 +116,8 @@ server { error_page 422 /422.html; error_page 500 /500.html; error_page 502 /502.html; - location ~ ^/(404|422|500|502)\.html$ { + error_page 503 /503.html; + location ~ ^/(404|422|500|502|503)\.html$ { root /usr/share/webapps/gitlab/public; internal; } diff --git a/gitlab/trunk/nginx.conf.example b/gitlab/trunk/nginx.conf.example index 26d9ae321c5..be60f0d89a8 100644 --- a/gitlab/trunk/nginx.conf.example +++ b/gitlab/trunk/nginx.conf.example @@ -20,6 +20,11 @@ upstream gitlab-workhorse { server unix:/run/gitlab/gitlab-workhorse.socket fail_timeout=0; } +map $http_upgrade $connection_upgrade_gitlab { + default upgrade; + '' close; +} + ## Normal HTTP host server { ## Either remove "default_server" from the listen line below, @@ -53,6 +58,8 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade_gitlab; proxy_pass http://gitlab-workhorse; } @@ -61,7 +68,8 @@ server { error_page 422 /422.html; error_page 500 /500.html; error_page 502 /502.html; - location ~ ^/(404|422|500|502)\.html$ { + error_page 503 /503.html; + location ~ ^/(404|422|500|502|503)\.html$ { root /usr/share/webapps/gitlab/public; internal; } -- 2.12.1