[evolvis-commits] r12187: First try at a configuration with no (well, fewer) explicit IP addresses

mirabilos at evolvis.org mirabilos at evolvis.org
Thu Feb 24 18:44:03 CET 2011


Author: mirabilos
Date: 2011-02-24 18:44:03 +0100 (Thu, 24 Feb 2011)
New Revision: 12187

Added:
   trunk/gforge_base/evolvisforge-5.1/gforge/debian/patches/unix-sockets-for-database.dpatch
Modified:
   trunk/gforge_base/evolvisforge-5.1/gforge/ChangeLog
   trunk/gforge_base/evolvisforge-5.1/gforge/common/include/database-pgsql.php
   trunk/gforge_base/evolvisforge-5.1/gforge/deb-specific/install-db.sh
   trunk/gforge_base/evolvisforge-5.1/gforge/debian/changelog
   trunk/gforge_base/evolvisforge-5.1/gforge/debian/patches/00list
   trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/06maindirhttp
   trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/07maindirhttp.ssl
   trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/11scm00http
   trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/12scm00http.ssl
   trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/15download
   trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/20list
   trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/21list.ssl
   trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/40virtualhost
   trunk/gforge_base/evolvisforge-5.1/gforge/etc/templates/httpd.vhosts
   trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmcvs/etc/httpd.d/30virtualcvs
   trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmcvs/etc/httpd.d/31virtualcvs.ssl
Log:
First try at a configuration with no (well, fewer) explicit IP addresses

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/ChangeLog
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/ChangeLog	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/ChangeLog	2011-02-24 17:44:03 UTC (rev 12187)
@@ -1,3 +1,9 @@
+2007-11-21  Roland Mas  <lolando at debian.org>
+
+	* deb-specific/install-db.sh: Setup database for access through
+	the Unix socket rather than TCP socket (in order to lighten the
+	dependency on IP addresses).
+
 2007-11-20  Roland Mas  <lolando at debian.org>
 
 	* common/include/cron_utils.php: Made the semaphore handling a bit

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/common/include/database-pgsql.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/common/include/database-pgsql.php	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/common/include/database-pgsql.php	2011-02-24 17:44:03 UTC (rev 12187)
@@ -55,9 +55,10 @@
 		$string .= " password=$password";
 	if ($host != "") {
 		$string .= " host=$host";
-		if ($port != "")
-			$string .= " port=$port";
 	}
+	if ($port != "") {
+		$string .= " port=$port";
+	}
 	return $string;
 }
 
@@ -397,4 +398,9 @@
 	}
 }
 
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
 ?>

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/deb-specific/install-db.sh
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/deb-specific/install-db.sh	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/deb-specific/install-db.sh	2011-02-24 17:44:03 UTC (rev 12187)
@@ -54,18 +54,11 @@
     configure-files)
 	# Tell PostgreSQL to let us use the database
 	db_passwd=$(grep ^db_password= /etc/gforge/gforge.conf | cut -d= -f2-)
-	ip_address=$(grep ^ip_address= /etc/gforge/gforge.conf | cut -d= -f2-)
 	db_name=$(grep ^db_name= /etc/gforge/gforge.conf | cut -d= -f2-)
 	db_user=$(grep ^db_user= /etc/gforge/gforge.conf | cut -d= -f2-)
 	db_host=$(grep ^db_host= /etc/gforge/gforge.conf | cut -d= -f2-)
 	pattern=$(basename $0).XXXXXX
 
-	if [ "$db_host" == "127.0.0.1" -o "$db_host" == "localhost" ]
-	then
-	    # Otherwise the line wouldn't be used
-	    # And postgres auth would fail
-	    ip_address=127.0.0.1
-	fi
         # PostgreSQL configuration for versions from 7.3 on
 	cp -a ${pg_hba_dir}/pg_hba.conf ${pg_hba_dir}/pg_hba.conf.gforge-new
 	cur=$(mktemp /tmp/$pattern)
@@ -75,7 +68,7 @@
 		perl -e "open F, \"${pg_hba_dir}/pg_hba.conf.gforge-new\" or die \$!; undef \$/; \$l=<F>; \$l=~ s/^host.*gforge_passwd\$/### BEGIN GFORGE BLOCK -- DO NOT EDIT\n### END GFORGE BLOCK -- DO NOT EDIT/s; print \$l;" > $cur
 		cat $cur > ${pg_hba_dir}/pg_hba.conf.gforge-new
 	    elif grep -q "^### Next line inserted by GForge install" ${pg_hba_dir}/pg_hba.conf.gforge-new ; then
-		perl -e "open F, \"${pg_hba_dir}/pg_hba.conf.gforge-new\" or die \$!; undef \$/; \$l=<F>; \$l=~ s/^### Next line inserted by GForge install\nhost $db_name $db_user $ip_address 255.255.255.255 password/### BEGIN GFORGE BLOCK -- DO NOT EDIT\n### END GFORGE BLOCK -- DO NOT EDIT/s; print \$l;" > $cur
+		perl -e "open F, \"${pg_hba_dir}/pg_hba.conf.gforge-new\" or die \$!; undef \$/; \$l=<F>; \$l=~ s/^### Next line inserted by GForge install\nhost $db_name $db_user [0-9. ]+ password/### BEGIN GFORGE BLOCK -- DO NOT EDIT\n### END GFORGE BLOCK -- DO NOT EDIT/s; print \$l;" > $cur
 		cat $cur > ${pg_hba_dir}/pg_hba.conf.gforge-new
 	    else
 		perl -e "open F, \"${pg_hba_dir}/pg_hba.conf.gforge-new\" or die \$!; undef \$/; \$l=<F>; \$l=~ s/^host $db_name $db_user.*password\$/### BEGIN GFORGE BLOCK -- DO NOT EDIT\n### END GFORGE BLOCK -- DO NOT EDIT/s; print \$l;" > $cur
@@ -89,7 +82,7 @@
 	rm -f $cur
 	
 	cur=$(mktemp /tmp/$pattern)
-	perl -e "open F, \"${pg_hba_dir}/pg_hba.conf.gforge-new\" or die \$!; undef \$/; \$l=<F>; \$l=~ s/^### BEGIN GFORGE BLOCK -- DO NOT EDIT.*### END GFORGE BLOCK -- DO NOT EDIT\$/### BEGIN GFORGE BLOCK -- DO NOT EDIT\nhost $db_name $db_user $ip_address 255.255.255.255 password\nhost $db_name gforge_nss $ip_address 255.255.255.255 trust\nhost $db_name gforge_mta $ip_address 255.255.255.255 password\n### END GFORGE BLOCK -- DO NOT EDIT/ms; print \$l;" > $cur
+	perl -e "open F, \"${pg_hba_dir}/pg_hba.conf.gforge-new\" or die \$!; undef \$/; \$l=<F>; \$l=~ s/^### BEGIN GFORGE BLOCK -- DO NOT EDIT.*### END GFORGE BLOCK -- DO NOT EDIT\$/### BEGIN GFORGE BLOCK -- DO NOT EDIT\nlocal $db_name $db_user md5\nlocal $db_name gforge_nss trust\nlocal $db_name gforge_mta md5\n### END GFORGE BLOCK -- DO NOT EDIT/ms; print \$l;" > $cur
 	cat $cur > ${pg_hba_dir}/pg_hba.conf.gforge-new
 	rm -f $cur
 	

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/debian/changelog
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/debian/changelog	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/debian/changelog	2011-02-24 17:44:03 UTC (rev 12187)
@@ -1,3 +1,12 @@
+gforge (4.6.99+svn6206+noip-1) unstable; urgency=low
+
+  * debian/patches/unix-sockets-for-database.dpatch: Use Unix sockets to
+    connect to the PostgreSQL server.
+  * Apache virtual hosts are now available on every IP address, so they'll
+    still work on dual-stack (IPv4 and IPv6) boxes.
+
+ -- Roland Mas <lolando at debian.org>  Wed, 21 Nov 2007 17:07:11 +0100
+
 gforge (4.6.99+svn6206-0+1) unstable; urgency=low
 
   * New SVN snapshot (r6206).  Includes lots of fixes for PHP warnings,

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/debian/patches/00list
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/debian/patches/00list	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/debian/patches/00list	2011-02-24 17:44:03 UTC (rev 12187)
@@ -6,3 +6,4 @@
 ##add-project-before-description-hook
 ##fix-lists-url
 use-snoopy-from-distro
+unix-sockets-for-database

Added: trunk/gforge_base/evolvisforge-5.1/gforge/debian/patches/unix-sockets-for-database.dpatch
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/debian/patches/unix-sockets-for-database.dpatch	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/debian/patches/unix-sockets-for-database.dpatch	2011-02-24 17:44:03 UTC (rev 12187)
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 99-unnamed.dpatch by Christian Bayle <bayle at debian.org> and/or Roland Mas <lolando at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad gforge~/etc/httpd.d/httpd.secrets gforge/etc/httpd.d/httpd.secrets
+--- gforge~/etc/httpd.d/httpd.secrets	2007-11-21 15:13:43.000000000 +0100
++++ gforge/etc/httpd.d/httpd.secrets	2007-11-21 15:15:06.000000000 +0100
+@@ -1,7 +1,7 @@
+ # PLEASE DO NOT REMOVE THIS LINE
+ 
+ SetEnv sys_localinc {sys_localinc}
+-SetEnv sys_gfdbhost {db_host}
++# SetEnv sys_gfdbhost {db_host}
+ SetEnv sys_gfdbport {db_port}
+ SetEnv sys_gfdbname {db_name}
+ SetEnv sys_gfdbuser {db_user}


Property changes on: trunk/gforge_base/evolvisforge-5.1/gforge/debian/patches/unix-sockets-for-database.dpatch
___________________________________________________________________
Added: svn:executable
   + *

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/06maindirhttp
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/06maindirhttp	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/06maindirhttp	2011-02-24 17:44:03 UTC (rev 12187)
@@ -1,5 +1,5 @@
 # HTTP
-<VirtualHost {ip_address}:80>
+<VirtualHost *:80>
 	ServerName {domain_name}
 	ServerAlias www.{domain_name}
 	ServerAdmin {server_admin}

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/07maindirhttp.ssl
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/07maindirhttp.ssl	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/07maindirhttp.ssl	2011-02-24 17:44:03 UTC (rev 12187)
@@ -1,5 +1,5 @@
 # HTTPS
-<VirtualHost {ip_address}:443>
+<VirtualHost *:443>
 	ServerName {domain_name}
 	ServerAlias www.{domain_name}
 	ServerAdmin {server_admin}

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/11scm00http
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/11scm00http	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/11scm00http	2011-02-24 17:44:03 UTC (rev 12187)
@@ -1,4 +1,4 @@
 # SCM HTTP vhost
-<VirtualHost {ip_address}:80>
+<VirtualHost *:80>
   ServerName {scm_host}
   DocumentRoot {usr_share_gforge}/scm

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/12scm00http.ssl
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/12scm00http.ssl	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/12scm00http.ssl	2011-02-24 17:44:03 UTC (rev 12187)
@@ -1,4 +1,4 @@
 # SCM HTTP SSL vhost
-<VirtualHost {ip_address}:443>
+<VirtualHost *:443>
   ServerName {scm_host}
   DocumentRoot {usr_share_gforge}/scm

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/15download
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/15download	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/15download	2011-02-24 17:44:03 UTC (rev 12187)
@@ -1,7 +1,7 @@
 #
 # Download host
 #
-<VirtualHost {ip_address}:80>
+<VirtualHost *:80>
   ServerName {download_host}
   DocumentRoot {var_lib_gforge}/download
   LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" gforge

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/20list
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/20list	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/20list	2011-02-24 17:44:03 UTC (rev 12187)
@@ -2,7 +2,7 @@
 # List host
 #
 # HTTP
-<VirtualHost {ip_address}:80>
+<VirtualHost *:80>
   ServerName {lists_host}
   AddHandler cgi-script .cgi
 

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/21list.ssl
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/21list.ssl	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/21list.ssl	2011-02-24 17:44:03 UTC (rev 12187)
@@ -2,7 +2,7 @@
 # List host
 #
 # HTTPS
-<VirtualHost {ip_address}:443>
+<VirtualHost *:443>
   ServerName {lists_host}
   AddHandler cgi-script .cgi
 

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/40virtualhost
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/40virtualhost	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/etc/httpd.d/40virtualhost	2011-02-24 17:44:03 UTC (rev 12187)
@@ -1,7 +1,7 @@
 #
 # * hosts
 #
-<VirtualHost {ip_address}:80>
+<VirtualHost *:80>
 	ServerName {domain_name}
 	ServerAlias *.{domain_name}
 	VirtualDocumentRoot {gforge_chroot}{groupdir}/%1/htdocs

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/etc/templates/httpd.vhosts
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/etc/templates/httpd.vhosts	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/etc/templates/httpd.vhosts	2011-02-24 17:44:03 UTC (rev 12187)
@@ -1,4 +1,4 @@
-<VirtualHost {ip_address}:80>
+<VirtualHost *:80>
 	ServerName {vhost_name}
 	VirtualDocumentRoot {docdir}
         VirtualScriptAlias {cgidir}

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmcvs/etc/httpd.d/30virtualcvs
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmcvs/etc/httpd.d/30virtualcvs	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmcvs/etc/httpd.d/30virtualcvs	2011-02-24 17:44:03 UTC (rev 12187)
@@ -3,7 +3,7 @@
 #
 # This example is so beautiful that I keep it
 # And can be used in a better way e.g. creating a cvs directory by group
-<VirtualHost {ip_address}:80>
+<VirtualHost *:80>
 	ServerName cvs.{domain_name}
 	ServerAlias cvs.*.{domain_name}
 	DocumentRoot {gforge_chroot}{groupdir}/

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmcvs/etc/httpd.d/31virtualcvs.ssl
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmcvs/etc/httpd.d/31virtualcvs.ssl	2011-02-24 17:44:00 UTC (rev 12186)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmcvs/etc/httpd.d/31virtualcvs.ssl	2011-02-24 17:44:03 UTC (rev 12187)
@@ -1,5 +1,5 @@
 # CVS HTTP SSL vhosts
-<VirtualHost {ip_address}:443>
+<VirtualHost *:443>
 	ServerName cvs.{domain_name}
   	ServerAlias cvs.*.{domain_name}
 	DocumentRoot {gforge_chroot}{groupdir}/



More information about the evolvis-commits mailing list