[DRE-commits] [diaspora-installer] 02/08: split env setup and nginx conf to separate file

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Sun Jan 11 12:56:22 UTC 2015


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

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

commit 337fd7250eefa6f2246b36c1b33858fbb13804ff
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Thu Jan 8 20:51:49 2015 +0530

    split env setup and nginx conf to separate file
---
 debian/config                  | 11 ++---------
 debian/diaspora-common.install |  1 +
 set-env-nginx.sh               | 28 ++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/debian/config b/debian/config
index 418f8e8..85b22e9 100644
--- a/debian/config
+++ b/debian/config
@@ -22,15 +22,8 @@ db_go
 
 # Configure pod address.
 db_get diaspora-installer/url
-if ! test -f /etc/diaspora.conf
-	then 
-		echo export SERVERNAME=$RET >> /etc/diaspora.conf
-		export SERVERNAME=$RET
-		echo export ENVIRONMENT_URL=https://$SERVERNAME >> /etc/diaspora.conf
-		export ENVIRONMENT_URL=https://$SERVERNAME
-		sed -e "s/SERVERNAME_FIXME/$RET/" -e "s/DIASPORA_SSL_PATH_FIXME/\\/etc\\/diaspora/" -e "s/DIASPORA_ROOT_FIXME/\\/usr\\/share\\/diaspora/" /usr/share/doc/diaspora-installer/nginx.conf.example >/etc/nginx/sites-available/$RET
-		ln -fs /etc/nginx/sites-available/$RET /etc/nginx/sites-enabled/
-fi
+
+/usr/lib/diaspora-common/scripts/set-env-nginx.sh $RET
 
 if [ "$RET" = "false" ]; then
     db_go
diff --git a/debian/diaspora-common.install b/debian/diaspora-common.install
index 570fc85..9dee7f3 100644
--- a/debian/diaspora-common.install
+++ b/debian/diaspora-common.install
@@ -1,2 +1,3 @@
 adduser.sh usr/lib/diaspora-common/scripts
 grantpriv.sh usr/lib/diaspora-common/scripts
+set-env-nginx.sh usr/lib/diaspora-common/scripts
diff --git a/set-env-nginx.sh b/set-env-nginx.sh
new file mode 100755
index 0000000..90c773b
--- /dev/null
+++ b/set-env-nginx.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+if [ "x"$1 = "x" ]
+then
+	echo "usage: $0 <domain name>"
+	exit 1
+fi
+
+nginx_conf_example=/usr/share/doc/diaspora-common/nginx.conf.example
+ 
+if ! test -f /etc/diaspora.conf
+	then 
+		echo export SERVERNAME=$1 >> /etc/diaspora.conf
+		export SERVERNAME=$1
+		echo export ENVIRONMENT_URL=https://$SERVERNAME >> /etc/diaspora.conf
+		export ENVIRONMENT_URL=https://$SERVERNAME
+		if test -f ${nginx_conf_example}
+		then
+			sed -e "s/SERVERNAME_FIXME/$1/"\
+			 -e "s/DIASPORA_SSL_PATH_FIXME/\\/etc\\/diaspora/"\
+			 -e "s/DIASPORA_ROOT_FIXME/\\/usr\\/share\\/diaspora/"\
+			 ${nginx_conf_example} >/etc/nginx/sites-available/$1
+			ln -fs /etc/nginx/sites-available/$1 /etc/nginx/sites-enabled/
+		else
+			echo "nginx.conf.example not found"
+			exit 1
+		fi
+fi
+

-- 
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