[Fusionforge-commits] r14292 - in trunk: . src

Roland Mas lolando at fusionforge.org
Wed Aug 31 19:04:45 CEST 2011


Author: lolando
Date: 2011-08-31 19:04:45 +0200 (Wed, 31 Aug 2011)
New Revision: 14292

Modified:
   trunk/
   trunk/src/fusionforge-install-3-db.php
Log:
Actually, the code to generate a secrets.ini file was there already, only it was called too late

Modified: trunk/src/fusionforge-install-3-db.php
===================================================================
--- trunk/src/fusionforge-install-3-db.php	2011-08-31 16:43:52 UTC (rev 14291)
+++ trunk/src/fusionforge-install-3-db.php	2011-08-31 17:04:45 UTC (rev 14292)
@@ -168,25 +168,37 @@
 	}
 	show(" ...using '$gforge_user'");
 
-	show(' * Storing Database configuration...');
-	require_once ("$fusionforge_src_dir/common/include/utils.php");
-	$p = md5(util_randbytes(10));
-	$k = md5(util_randbytes(10));
+	show(' * Saving database configuration in FForge config file');
+	if (!is_file("$fusionforge_etc_dir/config.ini.d/rpm-install.ini")){
+		if ($fp = fopen("$fusionforge_etc_dir/config.ini.d/rpm-install.ini", "w")) {
+			$config='; This file was generated by the RPM installation system.
+; You can edit the values here or move them to other files.
+[core]
+forge_name=FusionForge
+web_host='.system("hostname -f").'
+';
+			fwrite ($fp, $config);
+			fclose($fp);
+		}
+	}
+	if (!is_file("$fusionforge_etc_dir/config.ini.d/rpm-install-secrets.ini")){
+		if ($fp = fopen("$fusionforge_etc_dir/config.ini.d/rpm-install-secrets.ini", "w")) {
+			$config='; This file was generated by the RPM installation system.
+; You can edit the values here or move them to other files.
+; These values should not go into world-readable files!
 
-	$dbini = fopen("$fusionforge_etc_dir/secrets.ini",'w');
-	fwrite($dbini, "[core]
-database_host = 
-database_name = $gforge_db
-database_user = $gforge_user
-database_port = 
-database_password = $p
+[core]
+database_host=""
+database_name='.$gforge_db.'
+database_user='.$gforge_user.'
+database_port=5432
+; database_password=$pw
+';
+			fwrite ($fp, $config);
+			fclose($fp);
+		}
+	}
 
-session_key = $k
-");
-	fclose($dbini);
-	chmod("$fusionforge_etc_dir/secrets.ini", 0660);
-
-
 	show(" * Modifying DB Access Permissions...");
 	if (!file_exists("$PGHBA.fforge.backup")) {
 		run("cp $PGHBA $PGHBA.fforge.backup", true);
@@ -334,36 +346,6 @@
 		mkdir($fusionforge_etc_dir.'/config.ini.d');
 	}
 
-	show(' * Saving database configuration in FForge config file');
-	if (!is_file("$fusionforge_etc_dir/config.ini.d/rpm-install.ini")){
-		if ($fp = fopen("$fusionforge_etc_dir/config.ini.d/rpm-install.ini", "w")) {
-			$config='; This file was generated by the RPM installation system.
-; You can edit the values here or move them to other files.
-[core]
-forge_name=FusionForge
-web_host='.system("hostname -f").'
-';
-			fwrite ($fp, $config);
-			fclose($fp);
-		}
-	}
-	if (!is_file("$fusionforge_etc_dir/config.ini.d/rpm-install-secrets.ini")){
-		if ($fp = fopen("$fusionforge_etc_dir/config.ini.d/rpm-install-secrets.ini", "w")) {
-			$config='; This file was generated by the RPM installation system.
-; You can edit the values here or move them to other files.
-; These values should not go into world-readable files!
-
-[core]
-database_host=""
-database_name='.$gforge_db.'
-database_user='.$gforge_user.'
-database_port=5432
-; database_password=$pw
-';
-			fwrite ($fp, $config);
-			fclose($fp);
-		}
-	}
 	#$data = file_get_contents("$fusionforge_etc_dir/local.inc");
 	#$lines = explode("\n",$data);
 	#$config = '';




More information about the Fusionforge-commits mailing list