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

Roland Mas lolando at fusionforge.org
Wed Aug 31 18:43:52 CEST 2011


Author: lolando
Date: 2011-08-31 18:43:52 +0200 (Wed, 31 Aug 2011)
New Revision: 14291

Modified:
   trunk/
   trunk/src/fusionforge-install-3-db.php
Log:
Generate a secrets.ini file on installation

Modified: trunk/src/fusionforge-install-3-db.php
===================================================================
--- trunk/src/fusionforge-install-3-db.php	2011-08-31 15:41:05 UTC (rev 14290)
+++ trunk/src/fusionforge-install-3-db.php	2011-08-31 16:43:52 UTC (rev 14291)
@@ -168,6 +168,25 @@
 	}
 	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));
+
+	$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
+
+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);




More information about the Fusionforge-commits mailing list