Control: retitle -1 unblock: gitlab/8.13.11+dfsg1-5

correct handling for letsencrypt in config.
diff -Nru gitlab-8.13.11+dfsg1/debian/changelog 
gitlab-8.13.11+dfsg1/debian/changelog
--- gitlab-8.13.11+dfsg1/debian/changelog       2017-04-21 16:02:25.000000000 
+0530
+++ gitlab-8.13.11+dfsg1/debian/changelog       2017-04-27 11:23:43.000000000 
+0530
@@ -1,3 +1,17 @@
+gitlab (8.13.11+dfsg1-5) unstable; urgency=medium
+
+  * Fix letsencrypt email handling in config
+  * Minor update in postrm output
+
+ -- Pirate Praveen <prav...@debian.org>  Thu, 27 Apr 2017 11:23:43 +0530
+
+gitlab (8.13.11+dfsg1-4) unstable; urgency=medium
+
+  * Check if gitlab_data_dir is defined before using it
+  * Ask email address for letsencrypt updates 
+
+ -- Pirate Praveen <prav...@debian.org>  Wed, 26 Apr 2017 21:12:25 +0530
+
 gitlab (8.13.11+dfsg1-3) unstable; urgency=medium
 
   * Quote variable in test -n (Thanks to Benjamin Drung)
diff -Nru gitlab-8.13.11+dfsg1/debian/config gitlab-8.13.11+dfsg1/debian/config
--- gitlab-8.13.11+dfsg1/debian/config  2017-04-21 16:02:25.000000000 +0530
+++ gitlab-8.13.11+dfsg1/debian/config  2017-04-27 11:09:46.000000000 +0530
@@ -18,6 +18,9 @@
       db_set gitlab/user "$gitlab_user"
       db_set gitlab/ssl "${GITLAB_HTTPS:-false}"
       db_set gitlab/letsencrypt "${gitlab_letsencrypt:-false}"
+      if [ -n "$gitlab_letsencrypt_email" ]; then
+        db_set gitlab/letsencrypt_email "${gitlab_letsencrypt_email}"
+      fi
   fi
 
 # What is your fqdn?
@@ -36,6 +39,13 @@
   then
     db_input high gitlab/letsencrypt || true
     db_go
+    db_get gitlab/letsencrypt
+    gitlab_letsencrypt=$RET
+    if [ "$gitlab_letsencrypt" = "true" ]; then
+      # Get email for letsencrypt updates
+      db_input high gitlab/letsencrypt_email || true
+      db_go
+    fi
   fi
 fi
 
diff -Nru gitlab-8.13.11+dfsg1/debian/gitlab.templates 
gitlab-8.13.11+dfsg1/debian/gitlab.templates
--- gitlab-8.13.11+dfsg1/debian/gitlab.templates        2017-04-21 
16:02:25.000000000 +0530
+++ gitlab-8.13.11+dfsg1/debian/gitlab.templates        2017-04-27 
10:58:21.000000000 +0530
@@ -56,7 +56,13 @@
  .
  Note: letsencrypt does not have a usable nginx plugin currently, so
  certificates must be renewed manually after 3 months, when current
- letsencrypt certificate expire.
+ letsencrypt certificate expire. If you choose yes here, you will also be
+ agreeing to letsencrypt terms of service.
+
+Template: gitlab/letsencrypt_email
+Type: string
+_Description: Email address for letsencrypt updates:
+ Please provide a valid email address for letsencrypt updates.
 
 Template: gitlab/purge_data
 Type: boolean
diff -Nru gitlab-8.13.11+dfsg1/debian/postinst 
gitlab-8.13.11+dfsg1/debian/postinst
--- gitlab-8.13.11+dfsg1/debian/postinst        2017-04-21 16:02:25.000000000 
+0530
+++ gitlab-8.13.11+dfsg1/debian/postinst        2017-04-27 10:58:21.000000000 
+0530
@@ -150,6 +150,8 @@
     gl_proto="http"
     db_get gitlab/letsencrypt
     gitlab_letsencrypt=$RET
+    db_get gitlab/letsencrypt_email
+    gitlab_letsencrypt_email=$RET
 
     cp -a -f ${gitlab_debian_conf_private} ${gitlab_debian_conf_private}.tmp
 
@@ -169,6 +171,8 @@
         echo "GITLAB_HTTPS=" >> ${gitlab_debian_conf_private}
     test -z "$gitlab_letsencrypt" || grep -Eq '^ *gitlab_letsencrypt=' 
${gitlab_debian_conf_private} || \
         echo "gitlab_letsencrypt=" >> ${gitlab_debian_conf_private}
+    test -z "$gitlab_letsencrypt_email" || grep -Eq '^ 
*gitlab_letsencrypt_email=' ${gitlab_debian_conf_private} || \
+        echo "gitlab_letsencrypt_email=" >> ${gitlab_debian_conf_private}
     sed -e "s/^ *GITLAB_HOST=.*/GITLAB_HOST=\"$GITLAB_HOST\"/" \
         -e "s/^ 
*GITLAB_EMAIL_FROM=.*/GITLAB_EMAIL_FROM=\"$GITLAB_EMAIL_FROM\"/" \
         -e "s/^ 
*GITLAB_EMAIL_DISPLAY_NAME=.*/GITLAB_EMAIL_DISPLAY_NAME=\"$GITLAB_EMAIL_DISPLAY_NAME\"/"
 \
@@ -176,6 +180,7 @@
         -e "s/^ *gitlab_user=.*/gitlab_user=\"$gitlab_user\"/" \
         -e "s/^ *GITLAB_HTTPS=.*/GITLAB_HTTPS=\"$GITLAB_HTTPS\"/" \
         -e "s/^ 
*gitlab_letsencrypt=.*/gitlab_letsencrypt=\"$gitlab_letsencrypt\"/" \
+        -e "s/^ 
*gitlab_letsencrypt_email=.*/gitlab_letsencrypt_email=\"$gitlab_letsencrypt_email\"/"
 \
             < ${gitlab_debian_conf_private} > ${gitlab_debian_conf_private}.tmp
         mv -f ${gitlab_debian_conf_private}.tmp ${gitlab_debian_conf_private}
 
@@ -222,11 +227,13 @@
            echo "Stopping nginx for letsencrypt..."
            invoke-rc.d nginx stop
          fi
-
-         letsencrypt --standalone -d ${GITLAB_HOST} certonly || {
+          db_get gitlab/letsencrypt_email
+          gitlab_letsencrypt_email=$RET
+          LETSENCRYPT_CMD="letsencrypt --standalone --agree-tos -m 
$gitlab_letsencrypt_email -d ${GITLAB_HOST} certonly"
+          $LETSENCRYPT_CMD || {
            echo "letsencrypt auto configuration failed..."
            echo "Stop your webserver and try running letsencrypt manually..."
-           echo "letsencrypt -d ${GITLAB_HOST} certonly" 
+           echo "$LETSENCRYPT_CMD"
          }
         fi 
       fi
diff -Nru gitlab-8.13.11+dfsg1/debian/postrm gitlab-8.13.11+dfsg1/debian/postrm
--- gitlab-8.13.11+dfsg1/debian/postrm  2017-04-21 16:02:25.000000000 +0530
+++ gitlab-8.13.11+dfsg1/debian/postrm  2017-04-27 11:17:30.000000000 +0530
@@ -25,7 +25,7 @@
   CANDIDATE_DIR=$1
   if [ -n "${CANDIDATE_DIR}" ];then
     if [ -e ${CANDIDATE_DIR} ]; then
-      echo "Removing $i..."
+      echo "Removing: $i"
       rm -rf ${CANDIDATE_DIR}
     fi
   fi
@@ -58,9 +58,11 @@
       # Check if we should remove data?
       db_get gitlab/purge_data
       if [ "${RET}" = "true" ]; then
-        if [ -d ${gitlab_data_dir} ]; then
+        if [ -n "${gitlab_data_dir}" ] && [ -d ${gitlab_data_dir} ]; then
           for i in shared public db repositories secrets.yml Gemfile.lock; do
-            if [ -e ${gitlab_data_dir}/$i ]; then rm -rf 
${gitlab_data_dir}/$i; fi
+            if [ -e ${gitlab_data_dir}/$i ]; then
+              echo "Removing: ${gitlab_data_dir}/$i"
+              rm -rf ${gitlab_data_dir}/$i; fi
           done
         fi
        for i in ${gitlab_log_dir} ${gitlab_cache_path} ${gitlab_pid_path} \

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to