Your message dated Sat, 18 Feb 2017 17:33:36 +0000
with message-id <[email protected]>
and subject line Bug#854617: fixed in gitlab 8.13.11+dfsg-3
has caused the Debian Bug report #854617,
regarding gitlab: Package installation/upgrade fails when gitlab_user is changed
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
854617: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=854617
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: gitlab
Version: 8.13.11+dfsg-2
Severity: important
Tags: patch
Hi,
I want to use the gitlab package as replacement for our gitlab source
installation, which uses the user 'git' (instead of 'gitlab'). Thus I
changed gitlab_user in /etc/gitlab/gitlab-debian.conf for 'gitlab' to
'git'. I had to adjust the tmpfiles configuration:
sed 's/gitlab www-data/git www-data/' /usr/lib/tmpfiles.d/gitlab.conf >
/etc/tmpfiles.d/gitlab.conf
and the service files:
for service in mailroom unicorn sidekiq workhorse; do
path=/etc/systemd/system/gitlab-${service}.service.d
mkdir -p $path
printf "[Service]\nUser=git\n" > $path/override.conf
done
gitlab is running with these changes, but package upgrades will fail,
because grantpriv.sh hard-codes the gitlab user. Please apply the
attached patches for it. Thanks.
--
Benjamin Drung
System Developer
Debian & Ubuntu Developer
ProfitBricks GmbH
Greifswalder Str. 207
D - 10405 Berlin
Email: [email protected]
URL: http://www.profitbricks.com
Sitz der Gesellschaft: Berlin.
Registergericht: Amtsgericht Charlottenburg, HRB 125506B.
Geschäftsführer: Andreas Gauger, Achim Weiss.
>From adeb934e082afa39daa6fbe4364902b3e9ab7b26 Mon Sep 17 00:00:00 2001
From: Benjamin Drung <[email protected]>
Date: Wed, 8 Feb 2017 18:17:40 +0100
Subject: [PATCH 1/2] Honor gitlab_user setting in grantpriv.sh
If the sysadmin changes the gitlab user in
/etc/gitlab/gitlab-debian.conf, the package installation or upgrade will
fail, because grantpriv.sh will always grant privileges to the gitlab
user. Thus adapt grantpriv.sh to honor the gitlab_user setting.
---
debian/grantpriv.sh | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/debian/grantpriv.sh b/debian/grantpriv.sh
index f64d957..848fe3c 100755
--- a/debian/grantpriv.sh
+++ b/debian/grantpriv.sh
@@ -1,26 +1,28 @@
#!/bin/sh
-user=gitlab
dbname=gitlab_production
+# Take gitlab_user from envornment variable or use gitlab
+test -n "${gitlab_user:-}" || gitlab_user="gitlab"
+
# If gitlab user cannot access gitlab_production,
# then it means the gitlab role does not exist
-if ! su gitlab -c 'psql gitlab_production -c ""'
+if ! su ${gitlab_user} -c 'psql gitlab_production -c ""'
then
- echo "Create $user user with create database privillege..."
- su postgres -c "psql -c \"CREATE USER $user CREATEDB;\"" || {
+ echo "Create ${gitlab_user} user with create database privillege..."
+ su postgres -c "psql -c \"CREATE USER ${gitlab_user} CREATEDB;\"" || {
exit 1
}
fi
# By default the gitlab_prodcution is not owned by gitlab user
-echo "Make $user user owner of $dbname database..."
-su postgres -c "psql -c \"ALTER DATABASE $dbname OWNER to $user;\"" || {
+echo "Make ${gitlab_user} user owner of $dbname database..."
+su postgres -c "psql -c \"ALTER DATABASE $dbname OWNER to ${gitlab_user};\"" || {
exit 1
}
-echo "Grant all privileges to $user user..."
-su postgres -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE template1 to $user;\"" || {
+echo "Grant all privileges to ${gitlab_user} user..."
+su postgres -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE template1 to ${gitlab_user};\"" || {
exit 1
}
--
2.9.3
>From 994a6c48f2f850f77326d5a22b8ab348990e01e0 Mon Sep 17 00:00:00 2001
From: Benjamin Drung <[email protected]>
Date: Wed, 8 Feb 2017 18:25:53 +0100
Subject: [PATCH 2/2] grantpriv.sh: Use 'set -e' to make code more readable
Use 'set -e' to let the script fail when any command fails. This allows
us to remove the "command || exit 1" constructs.
---
debian/grantpriv.sh | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/debian/grantpriv.sh b/debian/grantpriv.sh
index 848fe3c..354a44c 100755
--- a/debian/grantpriv.sh
+++ b/debian/grantpriv.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+set -e
dbname=gitlab_production
@@ -10,23 +11,15 @@ test -n "${gitlab_user:-}" || gitlab_user="gitlab"
if ! su ${gitlab_user} -c 'psql gitlab_production -c ""'
then
echo "Create ${gitlab_user} user with create database privillege..."
- su postgres -c "psql -c \"CREATE USER ${gitlab_user} CREATEDB;\"" || {
- exit 1
- }
+ su postgres -c "psql -c \"CREATE USER ${gitlab_user} CREATEDB;\""
fi
# By default the gitlab_prodcution is not owned by gitlab user
echo "Make ${gitlab_user} user owner of $dbname database..."
-su postgres -c "psql -c \"ALTER DATABASE $dbname OWNER to ${gitlab_user};\"" || {
- exit 1
- }
+su postgres -c "psql -c \"ALTER DATABASE $dbname OWNER to ${gitlab_user};\""
echo "Grant all privileges to ${gitlab_user} user..."
-su postgres -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE template1 to ${gitlab_user};\"" || {
- exit 1
- }
+su postgres -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE template1 to ${gitlab_user};\""
# enable the pg_trgm extension
-su postgres -c "psql -d $dbname -c \"CREATE EXTENSION IF NOT EXISTS pg_trgm;\"" || {
- exit 1
- }
+su postgres -c "psql -d $dbname -c \"CREATE EXTENSION IF NOT EXISTS pg_trgm;\""
--
2.9.3
--- End Message ---
--- Begin Message ---
Source: gitlab
Source-Version: 8.13.11+dfsg-3
We believe that the bug you reported is fixed in the latest version of
gitlab, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Pirate Praveen <[email protected]> (supplier of updated gitlab package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Thu, 16 Feb 2017 17:35:29 +0530
Source: gitlab
Binary: gitlab
Architecture: source
Version: 8.13.11+dfsg-3
Distribution: unstable
Urgency: medium
Maintainer: Debian Ruby Extras Maintainers
<[email protected]>
Changed-By: Pirate Praveen <[email protected]>
Description:
gitlab - git powered software platform to collaborate on code
Closes: 821087 823743 839929 854617
Changes:
gitlab (8.13.11+dfsg-3) unstable; urgency=medium
.
* Allow choosing gitlab user (Closes: #854617)
* Optionally remove all data on purge (Closes: #821087, #839929)
.
[ Johannes Schauer ]
* Amend the README.Debian with instructions of how to upgrade from
non-Debian installations (Closes: #823743)
Checksums-Sha1:
3a978bf1a31b0596a687341665383e9a4db5c9c8 2534 gitlab_8.13.11+dfsg-3.dsc
142742b87cf7b213b3cb480f218eb9c7d51ca2ac 49412
gitlab_8.13.11+dfsg-3.debian.tar.xz
Checksums-Sha256:
e9b9b632ac7f923a66cc9e0ea1ff7dac45238d9c985ea99b9806c6e99664f04c 2534
gitlab_8.13.11+dfsg-3.dsc
c9e4a5a9135f7a5dcc5c35ce84e9158d518d76f5f14a25935fb11637c99a2879 49412
gitlab_8.13.11+dfsg-3.debian.tar.xz
Files:
4890b86b2a3f7f86354ebbcac48fed89 2534 ruby optional gitlab_8.13.11+dfsg-3.dsc
78d2956c6138dc078f6ba04cc802dc13 49412 ruby optional
gitlab_8.13.11+dfsg-3.debian.tar.xz
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEKnl0ri/BUtd4Z9pKzh+cZ0USwioFAlioghIACgkQzh+cZ0US
wiqtfQ//aSznXERhAQBVNTVjb0xEiX3MlbqgO3Ywj7f7hWAVYOHbngpZT745woMV
4FhqZul4scWWcuz6MIx8LVsP3uOgTxTXuLhchUuHtcuHkOllF5g2k9ueoF564gdI
S84j1Ho89oC/DD2pxeCWu1Jdu5/D6LRme/+EVhRAbkaGEt4uVwpT2D/qt+RO6XJM
V3LeXFXcVKcrbjTfwab+bqWx5cX5PA4h6mEEqccl0TOTU2Oj+8+PUs/S6oLeMxno
ZEdiB0zxPPVHLbeCVoEhRDZxR6KykaqZQ7U30AmT3yooO5HhHlCZAs7cwhWEDC0T
BwyKwtydpedRSUbaTuLuv0R9IQI+qdyhn++ljA0vBIGukuX7FLoCVzjCZZdsXVrh
aRpYfcasmr/hwHkcTFGeAleTLnQWZ+uNLMV5Fp8nkU90EDL1eJjpniLcWwPRxDyI
B6X/NCtSBpTcgJvZrt6L4IwH7+Wpo66ZmFEAjNh3iU0tOADIOoqnor2bZfCO9OB/
mYznVadcmle7xFVX8B4eBD4sY9K6knaSsAtQOxDvg9W5JMxdyBzvzntErGRjAu09
tExm5UGuuw44SKTjDBQLuE8caWNSKNrBTv5vuQoxRjjiXpHoFuutfotsUQSJY0kO
+09fDa3vQ/pysHCOjFzvM2756plmyyf8m+xVcpMfHv0UpjLpoM0=
=J6qe
-----END PGP SIGNATURE-----
--- End Message ---