[Fusionforge-commits] r11007 - in trunk/src: deb-specific debian/dsf-in etc/templates

Roland Mas lolando at libremir.placard.fr.eu.org
Fri Oct 15 14:26:36 CEST 2010


Author: lolando
Date: 2010-10-15 14:26:36 +0200 (Fri, 15 Oct 2010)
New Revision: 11007

Modified:
   trunk/src/deb-specific/db-upgrade.pl
   trunk/src/deb-specific/install-db.sh
   trunk/src/debian/dsf-in/db-postgresql.postinst.dsfh-in
   trunk/src/etc/templates/local.pl
Log:
Fix the empty admin password problem on fresh installations

Modified: trunk/src/deb-specific/db-upgrade.pl
===================================================================
--- trunk/src/deb-specific/db-upgrade.pl	2010-10-15 11:02:27 UTC (rev 11006)
+++ trunk/src/deb-specific/db-upgrade.pl	2010-10-15 12:26:36 UTC (rev 11007)
@@ -153,13 +153,10 @@
 
 	      do "/etc/gforge/local.pl" or die "Cannot read /etc/gforge/local.pl" ;
 
-	      my ($login, $pwd, $md5pwd, $email, $noreplymail, $date) ;
+	      my ($login, $md5pwd, $email, $noreplymail, $date) ;
 
 	      $login = $admin_login ;
-	      $pwd = $admin_password ;
-	      $md5pwd=qx/echo -n $pwd | md5sum/ ;
-	      chomp $md5pwd ;
-	      $md5pwd =~ s/(.{32}) .*/$1/ ;
+	      $md5pwd = 'INVALID' ;
 	      $email = $server_admin ;
 	      $noreplymail="noreply\@$domain_name" ;
 	      $date = time () ;

Modified: trunk/src/deb-specific/install-db.sh
===================================================================
--- trunk/src/deb-specific/install-db.sh	2010-10-15 11:02:27 UTC (rev 11006)
+++ trunk/src/deb-specific/install-db.sh	2010-10-15 12:26:36 UTC (rev 11007)
@@ -198,6 +198,7 @@
   	    	    # Creation OK 
 	    	    echo -n ""
 	    	    rm -f $tmp1 $tmp2
+		    need_admin_pw=true
 		else
 	    	    echo "Cannot create PostgreSQL database...  This shouldn't have happened."
 	    	    echo "Maybe a problem in your PostgreSQL configuration?"
@@ -256,6 +257,10 @@
 	if [ $p != 0 ] ; then
 	    exit $p
 	fi
+
+	if [ "$need_admin_pw" = "true" ] ; then
+	    exit 100
+	fi
 	;;
     purge-files)
 	cp -a ${pg_hba_dir}/pg_hba.conf ${pg_hba_dir}/pg_hba.conf.gforge-new

Modified: trunk/src/debian/dsf-in/db-postgresql.postinst.dsfh-in
===================================================================
--- trunk/src/debian/dsf-in/db-postgresql.postinst.dsfh-in	2010-10-15 11:02:27 UTC (rev 11006)
+++ trunk/src/debian/dsf-in/db-postgresql.postinst.dsfh-in	2010-10-15 12:26:36 UTC (rev 11007)
@@ -78,7 +78,17 @@
 	fi
 
         # Setup our DB
-	/usr/share/@OLDPACKAGE@/bin/install-db.sh configure
+	v=0
+	/usr/share/@OLDPACKAGE@/bin/install-db.sh configure || v=$?
+	if test x"$v" = x"100"; then
+	    db_get @OLDPACKAGE@/shared/admin_login || true
+	    admin_login="$RET"
+	    db_get @OLDPACKAGE@/shared/admin_password || true
+	    /usr/share/gforge/bin/forge_set_password "$admin_login" "$RET"
+	elif test x"$v" != x"0"; then
+	    exit $v
+	fi
+
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)

Modified: trunk/src/etc/templates/local.pl
===================================================================
--- trunk/src/etc/templates/local.pl	2010-10-15 11:02:27 UTC (rev 11006)
+++ trunk/src/etc/templates/local.pl	2010-10-15 12:26:36 UTC (rev 11007)
@@ -30,8 +30,7 @@
 chomp $sys_ldap_host ;
 $skill_list = '{skill_list}' ;
 $admin_login = '{admin_login}' ;
-$admin_password = '{admin_password}' ;
-$server_admin = '{server_admin}' ;
+$server_admin = qx!$fgcpath/forge_get_config admin_email!;
 $peerrating_groupid = qx!$fgcpath/forge_get_config peer_rating_group!;
 chomp $peerrating_groupid ;
 $noreply_to_bitbucket = '{noreply_to_bitbucket}' ;




More information about the Fusionforge-commits mailing list