On വെള്ളി 24 ഫെബ്രുവരി 2017 08:19 വൈകു, Balasankar C wrote: > Should I share the source debdiff of both these uploads to this issue or is a > separate issue necessary for gitlab-shell (The change is exactly the one > mentioned for gitlab. Not using /usr/share/gitlab-shell/doc ) ? > Attaching the source debdiffs.
diff -Nru gitlab-8.13.11+dfsg/debian/changelog gitlab-8.13.11+dfsg/debian/changelog --- gitlab-8.13.11+dfsg/debian/changelog 2017-02-16 17:35:29.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/changelog 2017-02-24 17:06:52.000000000 +0530 @@ -1,3 +1,18 @@ +gitlab (8.13.11+dfsg-4) unstable; urgency=medium + + [ Balasankar C ] + * Update description to specify that the package is non-omnibus, unlike the + official one from GitLab. + * Remove database on purge only if necessary commands are available + (Closes: #855579) + + [ Pirate Praveen ] + * Use /usr/lib/gitlab/templates for config file templates used in postinst + (See 854658#34) + * Add more checks in postrm to avoid failures which can be ignored + + -- Balasankar C <balasank...@autistici.org> Fri, 24 Feb 2017 17:06:52 +0530 + gitlab (8.13.11+dfsg-3) unstable; urgency=medium * Allow choosing gitlab user (Closes: #854617) diff -Nru gitlab-8.13.11+dfsg/debian/conf/gitlab-debian.conf.example gitlab-8.13.11+dfsg/debian/conf/gitlab-debian.conf.example --- gitlab-8.13.11+dfsg/debian/conf/gitlab-debian.conf.example 2017-02-16 17:35:29.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/conf/gitlab-debian.conf.example 2017-02-20 18:08:33.000000000 +0530 @@ -4,13 +4,13 @@ gitlab_data_dir=/var/lib/gitlab gitlab_cache_path=/var/cache/gitlab gitlab_scripts=/usr/lib/gitlab/scripts -gitlab_yml_example=/usr/share/doc/gitlab/gitlab.yml.example +gitlab_yml_example=/usr/lib/gitlab/templates/gitlab.yml.example gitlab_yml_private=/var/lib/gitlab/gitlab.yml gitlab_yml=/etc/gitlab/gitlab.yml -gitlab_debian_conf_example=/usr/share/doc/gitlab/gitlab-debian.conf.example +gitlab_debian_conf_example=/usr/lib/gitlab/templates/gitlab-debian.conf.example gitlab_debian_conf_private=/var/lib/gitlab/gitlab-debian.conf gitlab_debian_conf=/etc/gitlab/gitlab-debian.conf -gitlab_shell_config_example=/usr/share/doc/gitlab-shell/config.yml.example +gitlab_shell_config_example=/usr/lib/gitlab-shell/config.yml.example gitlab_shell_config_private=/var/lib/gitlab/gitlab-shell-config.yml gitlab_shell_config=/etc/gitlab-shell/config.yml gitlab_nginx_log=/var/log/gitlab @@ -19,10 +19,10 @@ gitlab_shell_log=/var/log/gitlab-shell gitlab_log_dir=/var/log/gitlab gitlab_pid_path=/run/gitlab -gitlab_tmpfiles_example=/usr/share/doc/gitlab/tmpfiles.d/gitlab.conf.example +gitlab_tmpfiles_example=/usr/lib/gitlab/templates/tmpfiles.d/gitlab.conf.example gitlab_tmpfiles_private=/var/lib/gitlab/tmpfiles.d-gitlab.conf gitlab_tmpfiles=/usr/lib/tmpfiles.d/gitlab.conf nginx_user=www-data -nginx_conf_example=/usr/share/doc/gitlab/nginx.conf.example -nginx_ssl_conf_example_gz=/usr/share/doc/gitlab/nginx.ssl.conf.example.gz +nginx_conf_example=/usr/lib/gitlab/templates/nginx.conf.example +nginx_ssl_conf_example=/usr/lib/gitlab/templates/nginx.ssl.conf.example nginx_site_private=/var/lib/gitlab/nginx.conf diff -Nru gitlab-8.13.11+dfsg/debian/control gitlab-8.13.11+dfsg/debian/control --- gitlab-8.13.11+dfsg/debian/control 2017-02-16 17:35:29.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/control 2017-02-20 19:54:52.000000000 +0530 @@ -31,7 +31,7 @@ postfix | exim4 | mail-transport-agent, openssh-client, ucf, - gitlab-shell (>= 3.6.6-3~), + gitlab-shell (>= 3.6.6-4~), gitlab-workhorse (>= 0.8.5~), ruby-rails (>= 2:4.2.7~), ruby-rails (<< 2:5), @@ -241,8 +241,11 @@ libjs-graphael, libjs-fuzzaldrin-plus (>= 0.3.1+git.20161008.da2cb58+dfsg-4~) Recommends: certbot -Description: git powered software platform to collaborate on code +Description: git powered software platform to collaborate on code (non-omnibus) gitlab provides web based interface to host source code and track issues. It allows anyone for fork a repository and send merge requests. Code review is possible using merge request workflow. Using groups and roles project access can be controlled. + . + Unlike the official package from GitLab Inc., this package does not use + omnibus. diff -Nru gitlab-8.13.11+dfsg/debian/gitlab.docs gitlab-8.13.11+dfsg/debian/gitlab.docs --- gitlab-8.13.11+dfsg/debian/gitlab.docs 2017-02-16 17:35:29.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/gitlab.docs 2017-02-20 16:56:50.000000000 +0530 @@ -1,4 +1,2 @@ README.md debian/README.Debian -debian/conf/nginx.conf.example -debian/conf/nginx.ssl.conf.example diff -Nru gitlab-8.13.11+dfsg/debian/install gitlab-8.13.11+dfsg/debian/install --- gitlab-8.13.11+dfsg/debian/install 2017-02-16 17:35:29.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/install 2017-02-20 16:56:47.000000000 +0530 @@ -1,12 +1,14 @@ debian/conf/gitlab etc/default debian/conf/unicorn.rb etc/gitlab debian/conf/database.yml etc/gitlab -debian/conf/gitlab.yml.example usr/share/doc/gitlab +debian/conf/gitlab.yml.example usr/lib/gitlab/templates debian/conf/resque.yml etc/gitlab -debian/conf/gitlab-debian.conf.example usr/share/doc/gitlab +debian/conf/gitlab-debian.conf.example usr/lib/gitlab/templates debian/conf/*.target lib/systemd/system debian/conf/smtp_settings.rb etc/gitlab/initializers -debian/conf/tmpfiles.d/gitlab.conf.example usr/share/doc/gitlab/tmpfiles.d +debian/conf/tmpfiles.d/gitlab.conf.example usr/lib/gitlab/templates/tmpfiles.d +debian/conf/nginx.conf.example usr/lib/gitlab/templates +debian/conf/nginx.ssl.conf.example usr/lib/gitlab/templates debian/adduser.sh usr/lib/gitlab/scripts debian/grantpriv.sh usr/lib/gitlab/scripts debian/rake-tasks.sh usr/lib/gitlab/scripts diff -Nru gitlab-8.13.11+dfsg/debian/postinst gitlab-8.13.11+dfsg/debian/postinst --- gitlab-8.13.11+dfsg/debian/postinst 2017-02-16 17:35:29.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/postinst 2017-02-20 18:47:40.000000000 +0530 @@ -34,7 +34,7 @@ ####################################################################### # Bootstrap config file - first try -gitlab_debian_conf_example=/usr/share/doc/gitlab/gitlab-debian.conf.example +gitlab_debian_conf_example=/usr/lib/gitlab/templates/gitlab-debian.conf.example export $(cat ${gitlab_debian_conf_example}) # second try test -f ${gitlab_debian_conf_private} || \ @@ -139,7 +139,7 @@ # Copy example configurations test -f ${gitlab_yml_private} || \ - zcat ${gitlab_yml_example} > ${gitlab_yml_private} + cp ${gitlab_yml_example} ${gitlab_yml_private} test -f ${gitlab_shell_config_private} || \ cp ${gitlab_shell_config_example} ${gitlab_shell_config_private} @@ -162,12 +162,7 @@ fi mkdir -p /etc/gitlab/ssl - if [ -f "${nginx_ssl_conf_example_gz}" ]; then - # undo dh_installdocs auto compress - export nginx_conf_example_tmp=$(mktemp) - zcat ${nginx_ssl_conf_example_gz} > ${nginx_conf_example_tmp} - export nginx_conf_example=${nginx_conf_example_tmp} - fi + nginx_conf_example=${nginx_ssl_conf_example} # Check if letsencrypt option is selected db_get gitlab/letsencrypt diff -Nru gitlab-8.13.11+dfsg/debian/postrm gitlab-8.13.11+dfsg/debian/postrm --- gitlab-8.13.11+dfsg/debian/postrm 2017-02-16 17:35:29.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/postrm 2017-02-24 14:46:30.000000000 +0530 @@ -53,9 +53,21 @@ rm -rf ${gitlab_log_dir} rm -rf ${gitlab_cache_path} rm -rf ${gitlab_pid_path} - userdel -r ${gitlab_user} rm -rf ${gitlab_data_dir} - su postgres -c "dropdb gitlab_production" + if [ ! -z "${gitlab_user}" ]; then + # Do only if gitlab_user is set + if [ -x /usr/bin/dropdb ]; then + echo "Removing Database: gitlab_production" + su ${gitlab_user} -c 'psql gitlab_production -c ""' && su postgres -c "dropdb gitlab_production" + else + echo "dropdb command not found. Hence not removing database." + fi + echo "Removing user: ${gitlab_user}" + id -u ${gitlab_user} && userdel -r ${gitlab_user} + else + echo "gitlab_user not set. Hence not removing user." + fi + rm -rf ${gitlab_ssl_path} fi # Remove my changes to the db.
diff -Nru gitlab-8.13.11+dfsg/debian/adduser.sh gitlab-8.13.11+dfsg/debian/adduser.sh --- gitlab-8.13.11+dfsg/debian/adduser.sh 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/adduser.sh 2017-02-16 16:19:54.000000000 +0530 @@ -8,9 +8,9 @@ # Create gitlab user with home in /var/lib echo "Creating/updating ${gitlab_user} user account..." -adduser --system --home /var/lib/${gitlab_user} --gecos "${gitlab_user} user" --shell /bin/sh \ +adduser --system --home ${gitlab_data_dir} --gecos "${gitlab_user} user" --shell /bin/sh \ --quiet --disabled-password --group ${gitlab_user} || { echo "Proceeding with existing ${gitlab_user} user..." } -echo "Making ${gitlab_user} owner of /var/lib/${gitlab_user}..." -chown -R ${gitlab_user} /var/lib/${gitlab_user} +echo "Making ${gitlab_user} owner of ${gitlab_data_dir}..." +chown -R ${gitlab_user} ${gitlab_data_dir} diff -Nru gitlab-8.13.11+dfsg/debian/changelog gitlab-8.13.11+dfsg/debian/changelog --- gitlab-8.13.11+dfsg/debian/changelog 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/changelog 2017-02-24 17:06:52.000000000 +0530 @@ -1,3 +1,29 @@ +gitlab (8.13.11+dfsg-4) unstable; urgency=medium + + [ Balasankar C ] + * Update description to specify that the package is non-omnibus, unlike the + official one from GitLab. + * Remove database on purge only if necessary commands are available + (Closes: #855579) + + [ Pirate Praveen ] + * Use /usr/lib/gitlab/templates for config file templates used in postinst + (See 854658#34) + * Add more checks in postrm to avoid failures which can be ignored + + -- Balasankar C <balasank...@autistici.org> Fri, 24 Feb 2017 17:06:52 +0530 + +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) + + -- Pirate Praveen <prav...@debian.org> Thu, 16 Feb 2017 17:35:29 +0530 + gitlab (8.13.11+dfsg-2) unstable; urgency=medium * Use upstream patch for git 2.11 support (Closes: #853251) diff -Nru gitlab-8.13.11+dfsg/debian/conf/gitlab-debian.conf.example gitlab-8.13.11+dfsg/debian/conf/gitlab-debian.conf.example --- gitlab-8.13.11+dfsg/debian/conf/gitlab-debian.conf.example 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/conf/gitlab-debian.conf.example 2017-02-20 18:08:33.000000000 +0530 @@ -1,17 +1,16 @@ RAILS_ENV=production DB=postgres -gitlab_user=gitlab gitlab_app_root=/usr/share/gitlab gitlab_data_dir=/var/lib/gitlab gitlab_cache_path=/var/cache/gitlab gitlab_scripts=/usr/lib/gitlab/scripts -gitlab_yml_example=/usr/share/doc/gitlab/gitlab.yml.example +gitlab_yml_example=/usr/lib/gitlab/templates/gitlab.yml.example gitlab_yml_private=/var/lib/gitlab/gitlab.yml gitlab_yml=/etc/gitlab/gitlab.yml -gitlab_debian_conf_example=/usr/share/doc/gitlab/gitlab-debian.conf.example +gitlab_debian_conf_example=/usr/lib/gitlab/templates/gitlab-debian.conf.example gitlab_debian_conf_private=/var/lib/gitlab/gitlab-debian.conf gitlab_debian_conf=/etc/gitlab/gitlab-debian.conf -gitlab_shell_config_example=/usr/share/doc/gitlab-shell/config.yml.example +gitlab_shell_config_example=/usr/lib/gitlab-shell/config.yml.example gitlab_shell_config_private=/var/lib/gitlab/gitlab-shell-config.yml gitlab_shell_config=/etc/gitlab-shell/config.yml gitlab_nginx_log=/var/log/gitlab @@ -20,7 +19,10 @@ gitlab_shell_log=/var/log/gitlab-shell gitlab_log_dir=/var/log/gitlab gitlab_pid_path=/run/gitlab +gitlab_tmpfiles_example=/usr/lib/gitlab/templates/tmpfiles.d/gitlab.conf.example +gitlab_tmpfiles_private=/var/lib/gitlab/tmpfiles.d-gitlab.conf +gitlab_tmpfiles=/usr/lib/tmpfiles.d/gitlab.conf nginx_user=www-data -nginx_conf_example=/usr/share/doc/gitlab/nginx.conf.example -nginx_ssl_conf_example_gz=/usr/share/doc/gitlab/nginx.ssl.conf.example.gz +nginx_conf_example=/usr/lib/gitlab/templates/nginx.conf.example +nginx_ssl_conf_example=/usr/lib/gitlab/templates/nginx.ssl.conf.example nginx_site_private=/var/lib/gitlab/nginx.conf diff -Nru gitlab-8.13.11+dfsg/debian/conf/gitlab.yml.example gitlab-8.13.11+dfsg/debian/conf/gitlab.yml.example --- gitlab-8.13.11+dfsg/debian/conf/gitlab.yml.example 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/conf/gitlab.yml.example 2017-02-16 17:13:37.000000000 +0530 @@ -46,7 +46,7 @@ # relative_url_root: /gitlab # Uncomment and customize if you can't use the default user to run GitLab (default: 'git') - user: gitlab + user: GITLAB_USER user_home: /var/lib/gitlab ## Date & Time settings diff -Nru gitlab-8.13.11+dfsg/debian/conf/tmpfiles.d/gitlab.conf gitlab-8.13.11+dfsg/debian/conf/tmpfiles.d/gitlab.conf --- gitlab-8.13.11+dfsg/debian/conf/tmpfiles.d/gitlab.conf 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/conf/tmpfiles.d/gitlab.conf 1970-01-01 05:30:00.000000000 +0530 @@ -1,2 +0,0 @@ -d /run/gitlab 2750 gitlab www-data - -L /run/gitlab/cache - - - - /var/cache/gitlab diff -Nru gitlab-8.13.11+dfsg/debian/conf/tmpfiles.d/gitlab.conf.example gitlab-8.13.11+dfsg/debian/conf/tmpfiles.d/gitlab.conf.example --- gitlab-8.13.11+dfsg/debian/conf/tmpfiles.d/gitlab.conf.example 1970-01-01 05:30:00.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/conf/tmpfiles.d/gitlab.conf.example 2017-02-15 12:28:38.000000000 +0530 @@ -0,0 +1,2 @@ +d /run/gitlab 2750 GITLAB_USER www-data - +L /run/gitlab/cache - - - - /var/cache/gitlab diff -Nru gitlab-8.13.11+dfsg/debian/config gitlab-8.13.11+dfsg/debian/config --- gitlab-8.13.11+dfsg/debian/config 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/config 2017-02-15 11:49:50.000000000 +0530 @@ -24,3 +24,7 @@ db_go fi fi + +# Do you want to change gitlab user? +db_input high gitlab/user || true +db_go diff -Nru gitlab-8.13.11+dfsg/debian/control gitlab-8.13.11+dfsg/debian/control --- gitlab-8.13.11+dfsg/debian/control 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/control 2017-02-20 19:54:52.000000000 +0530 @@ -31,7 +31,7 @@ postfix | exim4 | mail-transport-agent, openssh-client, ucf, - gitlab-shell (>= 3.6.6-3~), + gitlab-shell (>= 3.6.6-4~), gitlab-workhorse (>= 0.8.5~), ruby-rails (>= 2:4.2.7~), ruby-rails (<< 2:5), @@ -241,8 +241,11 @@ libjs-graphael, libjs-fuzzaldrin-plus (>= 0.3.1+git.20161008.da2cb58+dfsg-4~) Recommends: certbot -Description: git powered software platform to collaborate on code +Description: git powered software platform to collaborate on code (non-omnibus) gitlab provides web based interface to host source code and track issues. It allows anyone for fork a repository and send merge requests. Code review is possible using merge request workflow. Using groups and roles project access can be controlled. + . + Unlike the official package from GitLab Inc., this package does not use + omnibus. diff -Nru gitlab-8.13.11+dfsg/debian/gitlab.docs gitlab-8.13.11+dfsg/debian/gitlab.docs --- gitlab-8.13.11+dfsg/debian/gitlab.docs 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/gitlab.docs 2017-02-20 16:56:50.000000000 +0530 @@ -1,4 +1,2 @@ README.md debian/README.Debian -debian/conf/nginx.conf.example -debian/conf/nginx.ssl.conf.example diff -Nru gitlab-8.13.11+dfsg/debian/gitlab.gitlab-mailroom.service gitlab-8.13.11+dfsg/debian/gitlab.gitlab-mailroom.service --- gitlab-8.13.11+dfsg/debian/gitlab.gitlab-mailroom.service 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/gitlab.gitlab-mailroom.service 2017-02-16 16:58:58.000000000 +0530 @@ -9,7 +9,6 @@ [Service] Type=simple -User=gitlab WorkingDirectory=/usr/share/gitlab EnvironmentFile=/etc/gitlab/gitlab-debian.conf SyslogIdentifier=gitlab-mailroom diff -Nru gitlab-8.13.11+dfsg/debian/gitlab.gitlab-sidekiq.service gitlab-8.13.11+dfsg/debian/gitlab.gitlab-sidekiq.service --- gitlab-8.13.11+dfsg/debian/gitlab.gitlab-sidekiq.service 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/gitlab.gitlab-sidekiq.service 2017-02-16 16:59:10.000000000 +0530 @@ -9,7 +9,6 @@ [Service] Type=simple -User=gitlab WorkingDirectory=/usr/share/gitlab EnvironmentFile=/etc/gitlab/gitlab-debian.conf SyslogIdentifier=gitlab-sidekiq diff -Nru gitlab-8.13.11+dfsg/debian/gitlab.gitlab-unicorn.service gitlab-8.13.11+dfsg/debian/gitlab.gitlab-unicorn.service --- gitlab-8.13.11+dfsg/debian/gitlab.gitlab-unicorn.service 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/gitlab.gitlab-unicorn.service 2017-02-16 16:59:23.000000000 +0530 @@ -9,7 +9,6 @@ [Service] Type=simple -User=gitlab WorkingDirectory=/usr/share/gitlab EnvironmentFile=/etc/gitlab/gitlab-debian.conf EnvironmentFile=-/etc/default/gitlab diff -Nru gitlab-8.13.11+dfsg/debian/gitlab.gitlab-workhorse.service gitlab-8.13.11+dfsg/debian/gitlab.gitlab-workhorse.service --- gitlab-8.13.11+dfsg/debian/gitlab.gitlab-workhorse.service 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/gitlab.gitlab-workhorse.service 2017-02-16 16:59:50.000000000 +0530 @@ -9,7 +9,6 @@ [Service] Type=simple -User=gitlab WorkingDirectory=/usr/share/gitlab EnvironmentFile=/etc/gitlab/gitlab-debian.conf SyslogIdentifier=gitlab-workhorse diff -Nru gitlab-8.13.11+dfsg/debian/gitlab.templates gitlab-8.13.11+dfsg/debian/gitlab.templates --- gitlab-8.13.11+dfsg/debian/gitlab.templates 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/gitlab.templates 2017-02-16 17:51:06.000000000 +0530 @@ -11,6 +11,15 @@ If a reverse proxy is used, give the hostname that the proxy server responds to. +Template: gitlab/user +Type: string +Default: gitlab +_Description: Operating System user for this instance of Gitlab: + Please choose the username of the user used to run this instance of Gitlab. + . + This username will also be used in SSH urls of projects hosted with this + instance of Gitlab. For example, g...@git.example.com:foo/bar.git + Template: gitlab/ssl Type: boolean Default: false @@ -48,3 +57,10 @@ Note: letsencrypt does not have a usable nginx plugin currently, so certificates must be renewed manually after 3 months, when current letsencrypt certificate expire. + +Template: gitlab/purge +Type: boolean +Default: true +_Description: Remove all data? + This will permanently remove all data of this Gitlab instance such as database, + repositories, uploaded files, SSH public keys etc. diff -Nru gitlab-8.13.11+dfsg/debian/grantpriv.sh gitlab-8.13.11+dfsg/debian/grantpriv.sh --- gitlab-8.13.11+dfsg/debian/grantpriv.sh 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/grantpriv.sh 2017-02-15 18:04:25.000000000 +0530 @@ -1,30 +1,25 @@ #!/bin/sh +set -e -user=gitlab dbname=gitlab_production +# Take gitlab_user from envornment variable or use gitlab +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;\"" || { - exit 1 - } + echo "Create ${gitlab_user} user with create database privillege..." + su postgres -c "psql -c \"CREATE USER ${gitlab_user} CREATEDB;\"" 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;\"" || { - exit 1 - } - -echo "Grant all privileges to $user user..." -su postgres -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE template1 to $user;\"" || { - exit 1 - } +echo "Make ${gitlab_user} user owner of $dbname database..." +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};\"" # 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;\"" diff -Nru gitlab-8.13.11+dfsg/debian/install gitlab-8.13.11+dfsg/debian/install --- gitlab-8.13.11+dfsg/debian/install 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/install 2017-02-20 16:56:47.000000000 +0530 @@ -1,12 +1,14 @@ debian/conf/gitlab etc/default debian/conf/unicorn.rb etc/gitlab debian/conf/database.yml etc/gitlab -debian/conf/gitlab.yml.example usr/share/doc/gitlab +debian/conf/gitlab.yml.example usr/lib/gitlab/templates debian/conf/resque.yml etc/gitlab -debian/conf/gitlab-debian.conf.example usr/share/doc/gitlab +debian/conf/gitlab-debian.conf.example usr/lib/gitlab/templates debian/conf/*.target lib/systemd/system debian/conf/smtp_settings.rb etc/gitlab/initializers -debian/conf/tmpfiles.d/gitlab.conf usr/lib/tmpfiles.d +debian/conf/tmpfiles.d/gitlab.conf.example usr/lib/gitlab/templates/tmpfiles.d +debian/conf/nginx.conf.example usr/lib/gitlab/templates +debian/conf/nginx.ssl.conf.example usr/lib/gitlab/templates debian/adduser.sh usr/lib/gitlab/scripts debian/grantpriv.sh usr/lib/gitlab/scripts debian/rake-tasks.sh usr/lib/gitlab/scripts diff -Nru gitlab-8.13.11+dfsg/debian/postinst gitlab-8.13.11+dfsg/debian/postinst --- gitlab-8.13.11+dfsg/debian/postinst 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/postinst 2017-02-20 18:47:40.000000000 +0530 @@ -34,7 +34,7 @@ ####################################################################### # Bootstrap config file - first try -gitlab_debian_conf_example=/usr/share/doc/gitlab/gitlab-debian.conf.example +gitlab_debian_conf_example=/usr/lib/gitlab/templates/gitlab-debian.conf.example export $(cat ${gitlab_debian_conf_example}) # second try test -f ${gitlab_debian_conf_private} || \ @@ -44,6 +44,14 @@ # If /etc/gitlab/gitlab-debian.conf is already present, use it test -f ${gitlab_debian_conf} && export $(cat ${gitlab_debian_conf}) +# Read gitlab_user from debconf db +db_get gitlab/user +gitlab_user=${RET:-gitlab} >/dev/null + +if ! grep gitlab_user ${gitlab_debian_conf_private}; then + echo "gitlab_user=${gitlab_user}" >> ${gitlab_debian_conf_private} +fi + # Create gitlab user . /usr/lib/gitlab/scripts/adduser.sh @@ -131,10 +139,12 @@ # Copy example configurations test -f ${gitlab_yml_private} || \ - zcat ${gitlab_yml_example} > ${gitlab_yml_private} + cp ${gitlab_yml_example} ${gitlab_yml_private} test -f ${gitlab_shell_config_private} || \ cp ${gitlab_shell_config_example} ${gitlab_shell_config_private} + sed -i "s/GITLAB_USER/${gitlab_user}/" ${gitlab_yml_private} + if [ "${RET}" = "true" ]; then echo "Configuring nginx with HTTPS..." if ! grep GITLAB_HTTPS ${gitlab_debian_conf_private}; then @@ -152,12 +162,7 @@ fi mkdir -p /etc/gitlab/ssl - if [ -f "${nginx_ssl_conf_example_gz}" ]; then - # undo dh_installdocs auto compress - export nginx_conf_example_tmp=$(mktemp) - zcat ${nginx_ssl_conf_example_gz} > ${nginx_conf_example_tmp} - export nginx_conf_example=${nginx_conf_example_tmp} - fi + nginx_conf_example=${nginx_ssl_conf_example} # Check if letsencrypt option is selected db_get gitlab/letsencrypt @@ -186,7 +191,22 @@ fi fi fi - + + # Manage tmpfiles.d/gitlab.conf via ucf + test -f ${gitlab_tmpfiles_private} || \ + cp ${gitlab_tmpfiles_example} ${gitlab_tmpfiles_private} + sed -i "s/GITLAB_USER/${gitlab_user}/" ${gitlab_tmpfiles_private} + echo "Registering ${gitlab_tmpfiles} via ucf" + ucf --debconf-ok --three-way ${gitlab_tmpfiles_private} ${gitlab_tmpfiles} + ucfr gitlab ${gitlab_tmpfiles} + + # Override User for systemd services + for service in mailroom unicorn sidekiq workhorse; do + path=/etc/systemd/system/gitlab-${service}.service.d + mkdir -p $path + printf "[Service]\nUser=${gitlab_user}\n" > $path/override.conf + done + # Manage gitlab-shell's config.yml via ucf mkdir -p /etc/gitlab-shell echo "Registering ${gitlab_shell_config} via ucf" diff -Nru gitlab-8.13.11+dfsg/debian/postrm gitlab-8.13.11+dfsg/debian/postrm --- gitlab-8.13.11+dfsg/debian/postrm 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/postrm 2017-02-24 14:46:30.000000000 +0530 @@ -14,7 +14,9 @@ # Ensure the menu system is updated # Read and export debian specific configuration -# Only exported variables will be passed on to gitlab app +gitlab_debian_conf=/etc/gitlab/gitlab-debian.conf +test -f ${gitlab_debian_conf} && export $(cat ${gitlab_debian_conf}) + case "$1" in remove) # This package is being removed, but its configuration has not yet @@ -34,13 +36,44 @@ if [ -e /usr/share/debconf/confmodule ]; then # Source debconf library. . /usr/share/debconf/confmodule + + # Do you want to remove all data? + db_input high gitlab/purge || true + db_go + + # Check if we should remove data? + db_get gitlab/purge + if [ "${RET}" = "true" ]; then + rm -rf ${gitlab_data_dir}/shared + rm -rf ${gitlab_data_dir}/public + rm -rf ${gitlab_data_dir}/db + rm -rf ${gitlab_data_dir}/repositories + rm -rf ${gitlab_data_dir}/secrets.yml + rm -rf ${gitlab_data_dir}/Gemfile.lock + rm -rf ${gitlab_log_dir} + rm -rf ${gitlab_cache_path} + rm -rf ${gitlab_pid_path} + rm -rf ${gitlab_data_dir} + if [ ! -z "${gitlab_user}" ]; then + # Do only if gitlab_user is set + if [ -x /usr/bin/dropdb ]; then + echo "Removing Database: gitlab_production" + su ${gitlab_user} -c 'psql gitlab_production -c ""' && su postgres -c "dropdb gitlab_production" + else + echo "dropdb command not found. Hence not removing database." + fi + echo "Removing user: ${gitlab_user}" + id -u ${gitlab_user} && userdel -r ${gitlab_user} + else + echo "gitlab_user not set. Hence not removing user." + fi + rm -rf ${gitlab_ssl_path} + fi + # Remove my changes to the db. db_purge fi - echo "Reading gitlab-debian.conf..." - gitlab_debian_conf=/etc/gitlab/gitlab-debian.conf - test -f ${gitlab_debian_conf} && export $(cat ${gitlab_debian_conf}) nginx_site="/etc/nginx/sites-available/${GITLAB_HOST}" test -f ${nginx_site} && echo "Found nginx site configuration at ${nginx_site}..." @@ -53,29 +86,49 @@ rm -f ${nginx_site}$ext rm -f ${gitlab_debian_conf}$ext rm -f ${gitlab_yml}$ext + rm -f ${gitlab_tmpfiles}$ext + rm -f ${gitlab_shell_config}$ext done # remove the configuration file itself test -f ${nginx_site} && rm -f ${nginx_site} test -f ${gitlab_debian_conf} && rm -f ${gitlab_debian_conf} test -f ${gitlab_yml} && rm -f ${gitlab_yml} + test -f ${gitlab_tmpfiles} && rm -f ${gitlab_tmpfiles} + test -f ${gitlab_shell_config} && rm -f ${gitlab_shell_config} # and finally clear it out from the ucf database if which ucf >/dev/null; then test -n "${nginx_site}" && ucf --purge ${nginx_site} test -n "${gitlab_debian_conf}" && ucf --purge ${gitlab_debian_conf} test -n "${gitlab_yml}" && ucf --purge ${gitlab_yml} - test -n "${gitlab_shell_config}" && ucf -purge ${gitlab_shell_config} - fi + test -n "${gitlab_tmpfiles}" && ucf --purge ${gitlab_tmpfiles} + test -n "${gitlab_shell_config}" && ucf -purge ${gitlab_shell_config} + fi + if which ucfr >/dev/null; then test -n "${nginx_site}" && ucfr --purge gitlab ${nginx_site} test -n "${gitlab_debian_conf}" && ucfr --purge gitlab ${gitlab_debian_conf} test -n "${gitlab_yml}" && ucfr --purge gitlab ${gitlab_yml} + test -n "${gitlab_tmpfiles}" && ucfr --purge gitlab ${gitlab_tmpfiles} test -n "${gitlab_shell_config}" && ucfr -purge gitlab ${gitlab_shell_config} fi # remove generated assets - rm -rf /var/lib/gitlab/public/assets + rm -rf ${gitlab_data_dir}/public/assets + + # Remove private copies of configuration files + rm -f ${nginx_site_private} + rm -f ${gitlab_debian_conf_private} + rm -f ${gitlab_yml_private} + rm -f ${gitlab_tmpfiles_private} + rm -f ${gitlab_shell_config_private} + + # Remove systemd service overrides + for service in mailroom unicorn sidekiq workhorse; do + path=/etc/systemd/system/gitlab-${service}.service.d + rm -rf $path + done # cleanup complete exit 0 diff -Nru gitlab-8.13.11+dfsg/debian/README.Debian gitlab-8.13.11+dfsg/debian/README.Debian --- gitlab-8.13.11+dfsg/debian/README.Debian 2017-02-07 11:24:36.000000000 +0530 +++ gitlab-8.13.11+dfsg/debian/README.Debian 2017-02-15 11:31:40.000000000 +0530 @@ -64,10 +64,7 @@ directory /usr/share/gitlab and with the environment variables from /etc/gitlab/gitlab-debian.conf set. So above command could be run like: - # su gitlab - $ cd /usr/share/gitlab - $ export $(cat /etc/gitlab/gitlab-debian.conf) - $ rake XXX RAILS_ENV=production + $ runuser -u gitlab -- sh -c 'cd /usr/share/gitlab && export $(cat /etc/gitlab/gitlab-debian.conf) && rake XXX RAILS_ENV=production' One useful command to run in this environment is: @@ -80,7 +77,7 @@ To see service status with systemd, you can use: - $ systemctl status gitlab.target + $ systemctl status gitlab.service -l $ systemctl status gitlab-unicorn.service -l $ systemctl status gitlab-sidekiq.service -l $ systemctl status gitlab-workhorse.service -l @@ -96,29 +93,46 @@ - the repositories/ directory - the public/uploads/ directory - your .ssh/authorized_keys - 1. Rename your old database to gitlab_production and set the user gitlab as + 1. Remove the init script for your old gitlab installation, like: + $ rm /etc/init.d/gitlab + 2. Install Debian gitlab: + $ apt-get install gitlab + 3. Stop gitlab services: + $ systemctl stop gitlab.service + 4. Rename your old database to gitlab_production and set the user gitlab as its owner and the owner of all its tables, sequences and views - 2. Copy your old repository directory to /var/lib/gitlab/repositories/ - 3. Copy your old public/uploads/ directory to /var/lib/gitlab/public/uploads/ - 4. Copy your old .ssh/authorized_keys to /var/lib/gitlab/.ssh/authorized_keys - 5. Start gitlab using `systemctl start gitlab.target` - 6. Check the status of your installation using gitlab:check (see section - above). The output of that command will tell you the necessary remaining - fixes. You might be told to run: - - $ sudo chmod -R ug+rwX,o-rwx /var/lib/gitlab/repositories/ - $ sudo -u gitlab -H /usr/share/gitlab-shell/bin/create-hooks - $ sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production - - See the last section of how to execute the db:migrate command. + $ su - postgres + $ psql + # drop database gitlab_production; + # alter database gitlabhq_production rename to gitlab_production; + # alter database gitlab_production owner to gitlab; + # \q + $ for tbl in `psql -qAt -c "select tablename from pg_tables where schemaname = 'public';" gitlab_production` ; do psql -c "alter table \"$tbl\" owner to gitlab" gitlab_production ; done + $ for tbl in `psql -qAt -c "select sequence_name from information_schema.sequences where sequence_schema = 'public';" gitlab_production` ; do psql -c "alter table \"$tbl\" owner to gitlab" gitlab_production ; done + 5. Copy your old repository directory to /var/lib/gitlab/repositories/ + 6. Copy your old public/uploads/ directory to /var/lib/gitlab/public/uploads/ + 7. Copy your old .ssh/authorized_keys to /var/lib/gitlab/.ssh/authorized_keys + 8. Fix your /var/lib/gitlab/.ssh/authorized_keys to contain the right path to gitlab-shell like: + $ sed -i 's/^command="[^ ]\+gitlab-shell /command="\/usr\/share\/gitlab-shell\/bin\/gitlab-shell /' /usr/share/gitlab/.ssh/authorized_keys + 9. Fix permission: + $ chown -R gitlab:gitlab /var/lib/gitlab/repositories/ /var/lib/gitlab/public/uploads/ /var/lib/gitlab/.ssh/authorized_keys + $ chmod -R ug+rwX,o-rwx /var/lib/gitlab/repositories/ + $ find /var/lib/gitlab/public/uploads -type f -exec chmod 0644 {} \; + $ find /var/lib/gitlab/public/uploads -type d -not -path /var/lib/gitlab/public/uploads -exec chmod 0700 {} \; + 10. Migrate the database: + $ runuser -u gitlab -- sh -c 'cd /usr/share/gitlab && export $(cat /etc/gitlab/gitlab-debian.conf) && rake db:migrate RAILS_ENV=production' + 11. Fix hooks: + # su gitlab + $ /usr/share/gitlab-shell/bin/create-hooks + 12. Start gitlab: + $ systemctl start gitlab.service + 13. Check the installation: + $ runuser -u gitlab -- sh -c 'cd /usr/share/gitlab && export $(cat /etc/gitlab/gitlab-debian.conf) && rake gitlab:check RAILS_ENV=production' Resetting admin password without web interface ============================================== - # su gitlab - $ cd /usr/share/gitlab - $ export $(cat /etc/gitlab/gitlab-debian.conf) - $ rails console production + $ runuser -u gitlab -- sh -c 'cd /usr/share/gitlab && export $(cat /etc/gitlab/gitlab-debian.conf) && rails console production' irb(main):001:0> user = User.where(admin: true).first irb(main):002:0> user.password = 'secret_pass' irb(main):003:0> user.password_confirmation = 'secret_pass'
diff -Nru gitlab-shell-3.6.6/debian/changelog gitlab-shell-3.6.6/debian/changelog --- gitlab-shell-3.6.6/debian/changelog 2017-02-07 21:06:26.000000000 +0530 +++ gitlab-shell-3.6.6/debian/changelog 2017-02-24 16:57:29.000000000 +0530 @@ -1,3 +1,10 @@ +gitlab-shell (3.6.6-4) unstable; urgency=medium + + [ Pirate Praveen ] + * Install config.yml.example in /usr/lib + + -- Balasankar C <balasank...@autistici.org> Fri, 24 Feb 2017 16:57:29 +0530 + gitlab-shell (3.6.6-3) unstable; urgency=medium * Fix typo in git 2.11 support patch (Closes: #854262) diff -Nru gitlab-shell-3.6.6/debian/install gitlab-shell-3.6.6/debian/install --- gitlab-shell-3.6.6/debian/install 2017-02-07 21:06:26.000000000 +0530 +++ gitlab-shell-3.6.6/debian/install 2017-02-20 18:24:30.000000000 +0530 @@ -1,3 +1,3 @@ VERSION usr/share/gitlab-shell -debian/config.yml.example usr/share/doc/gitlab-shell +debian/config.yml.example usr/lib/gitlab-shell hooks usr/share/gitlab-shell
signature.asc
Description: OpenPGP digital signature