[Fusionforge-commits] r14605 - trunk/src/install

Christian Bayle cbayle at fusionforge.org
Tue Oct 11 23:13:15 CEST 2011


Author: cbayle
Date: 2011-10-11 23:13:15 +0200 (Tue, 11 Oct 2011)
New Revision: 14605

Modified:
   trunk/src/install/install5_post
Log:
Add support for debian


Modified: trunk/src/install/install5_post
===================================================================
--- trunk/src/install/install5_post	2011-10-11 11:17:09 UTC (rev 14604)
+++ trunk/src/install/install5_post	2011-10-11 21:13:15 UTC (rev 14605)
@@ -50,12 +50,34 @@
 
 install5_post_debian()
 {
-	echo "TODO"
+        if [ ! -e /etc/gforge/ssl-cert.pem ] || [ ! -e /etc/gforge/ssl-cert.key ] ; then
+            # Uh-oh, no SSL cert, let's make sure at least a dummy one exists.
+            if [ ! -e /etc/ssl/certs/ssl-cert-snakeoil.pem ] || [ ! -e /etc/ssl/private/ssl-cert-snakeoil.key ] ; then
+                # What, not even the snakeoil cert is there?  Let's generate it
+                make-ssl-cert generate-default-snakeoil
+            fi
+            # Right.  At this point, it should be safe to set the symlinks.
+            ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/gforge/ssl-cert.pem
+            ln -s /etc/ssl/private/ssl-cert-snakeoil.key /etc/gforge/ssl-cert.key
+        fi
+
+        for i in secrets.inc vhost-list.inc vhost-main.inc vhost-projects.inc ; do
+            if [ ! -e /etc/gforge/httpd.conf.d/$i ] ; then
+                cp /opt/gforge/src/etc/httpd.conf.d-opt/$i /etc/gforge/httpd.conf.d/$i
+                if [ $i = "secrets.inc" ] ; then
+                    chmod 700 /etc/gforge/httpd.conf.d/$i
+                fi
+                PATH=/opt/gforge/src/utils:$PATH manage-apache-config.sh install
+                mv /etc/gforge/httpd.conf.d/$i.generated /etc/gforge/httpd.conf.d/$i
+            fi
+        done
+	a2dissite default
+	service apache2 restart
 }
 
 install5_post_ubuntu()
 {
-	echo "TODO"
+	install5_post_debian
 }
 
 install5_post_unknown()




More information about the Fusionforge-commits mailing list