[DRE-commits] [diaspora-installer] 02/05: fix handling of diaspora.conf

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Wed Jul 27 09:08:42 UTC 2016


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository diaspora-installer.

commit 50bbc5f5d48be5ef5e92fe452706434b71af0a27
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Wed Jul 27 12:17:01 2016 +0530

    fix handling of diaspora.conf
---
 debian/changelog                |  3 ++-
 debian/diaspora-common.postinst | 10 +++++++---
 set-env-diaspora.sh             |  2 +-
 set-env-nginx.sh                |  6 +++---
 4 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1f10adc..e2c597e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 diaspora-installer (0.5.9.1+debian3) UNRELEASED; urgency=medium
 
-  * Run autopkgtest 
+  * Run autopkgtest
+  * Fix handling of diaspora.conf 
 
  -- Pirate Praveen <praveen at debian.org>  Tue, 26 Jul 2016 20:20:45 +0530
 
diff --git a/debian/diaspora-common.postinst b/debian/diaspora-common.postinst
index 869fc66..7e7ea6e 100755
--- a/debian/diaspora-common.postinst
+++ b/debian/diaspora-common.postinst
@@ -30,6 +30,12 @@ case "$1" in
     configure)
         # Source varibales
         . /etc/diaspora/diaspora-common.conf
+
+        # Create private copy of diaspora.conf from example
+        mkdir -p /var/lib/diaspora-common
+	test -f ${diaspora_conf_private} ||\
+	cp ${diaspora_conf_example} ${diaspora_conf_private}
+
         # Check if there is another version installed
         if ! test -z $2
         then
@@ -68,10 +74,8 @@ case "$1" in
                 # Configure pod address.
                 db_get diaspora-common/url
                 echo "SSL disabled, skip nginx configuration for ${RET}..."
-                if ! grep SERVERNAME ${diaspora_conf}
+                if ! grep SERVERNAME ${diaspora_conf_private}
                 then
-		    test -f ${diaspora_conf_private} ||\
-		    cp ${diaspora_conf_example} ${diaspora_conf_private}
                     echo export SERVERNAME=${RET} >> ${diaspora_conf_private}
                     export SERVERNAME=${RET}
                     echo export ENVIRONMENT_URL="http://$SERVERNAME:3000" >> ${diaspora_conf_private}
diff --git a/set-env-diaspora.sh b/set-env-diaspora.sh
index a1e09e2..1efb21c 100755
--- a/set-env-diaspora.sh
+++ b/set-env-diaspora.sh
@@ -2,7 +2,7 @@
 
 # Read configuration from file
 . /etc/diaspora/diaspora-common.conf
-echo "Using ${diaspora_conf}..."
+echo "Using ${diaspora_conf_private}..."
 if ! grep RAILS_ENV ${diaspora_conf_private}
 	then echo export RAILS_ENV=production >> ${diaspora_conf_private}
 fi
diff --git a/set-env-nginx.sh b/set-env-nginx.sh
index 61ae76d..588a39a 100755
--- a/set-env-nginx.sh
+++ b/set-env-nginx.sh
@@ -10,11 +10,11 @@ fi
 
 nginx_conf_example=/usr/share/doc/diaspora-common/nginx.conf.example
  
-if ! grep SERVERNAME ${diaspora_conf}
+if ! grep SERVERNAME ${diaspora_conf_private}
 	then 
-		echo export SERVERNAME=$1 >> ${diaspora_conf}
+		echo export SERVERNAME=$1 >> ${diaspora_conf_private}
 		export SERVERNAME=$1
-		echo export ENVIRONMENT_URL=https://$SERVERNAME >> ${diaspora_conf}
+		echo export ENVIRONMENT_URL=https://$SERVERNAME >> ${diaspora_conf_private}
 		export ENVIRONMENT_URL=https://$SERVERNAME
 		if test -f ${nginx_conf_example}
 		then

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/diaspora-installer.git



More information about the Pkg-ruby-extras-commits mailing list