[evolvis-commits] r7057: Re-enact the forge patch

mirabilos at evolvis.org mirabilos at evolvis.org
Wed Nov 3 16:39:28 CET 2010


Author: mirabilos
Date: 2010-11-03 16:39:28 +0100 (Wed, 03 Nov 2010)
New Revision: 7057

Modified:
   trunk/gforge_base/evolvisforge/gforge/www/scm/viewvc/bin/cgi/viewvc.cgi
Log:
Re-enact the forge patch

Modified: trunk/gforge_base/evolvisforge/gforge/www/scm/viewvc/bin/cgi/viewvc.cgi
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/www/scm/viewvc/bin/cgi/viewvc.cgi	2010-11-03 15:39:26 UTC (rev 7056)
+++ trunk/gforge_base/evolvisforge/gforge/www/scm/viewvc/bin/cgi/viewvc.cgi	2010-11-03 15:39:28 UTC (rev 7057)
@@ -21,6 +21,9 @@
 # -----------------------------------------------------------------------
 #
 
+# THIS CONFIGURATION FILE HAS BEEN MODIFIED WITH THE PURPOSE OF
+# INTEGRATING VIEWVC WITH GFORGE.
+
 #########################################################################
 #
 # INSTALL-TIME CONFIGURATION
@@ -58,4 +61,21 @@
 
 server = sapi.CgiServer()
 cfg = viewvc.load_config(CONF_PATHNAME, server)
+
+# BEGIN OF GForge customization
+
+# Read the repository root dir from the environment.
+# This way, we will only have ONE repository configured (the one we're browsing). This 
+# is more secure than having one (CVS|SVN) root configured with all the repositories inside
+
+if os.environ["REPOSITORY_TYPE"] == 'cvs':
+  cfg.general.cvs_roots[os.environ["REPOSITORY_NAME"]] = os.environ["REPOSITORY_ROOT"]
+elif os.environ["REPOSITORY_TYPE"] == 'svn':
+  cfg.general.svn_roots[os.environ["REPOSITORY_NAME"]] = os.environ["REPOSITORY_ROOT"]
+
+cfg.general.address = "<a href='mailto:root@"+os.environ["HTTP_HOST"]+"'>root@" + os.environ["HTTP_HOST"]+ "</a>"
+cfg.options.docroot = os.environ["DOCROOT"]
+
+# END OF GForge customization
+
 viewvc.main(server, cfg)



More information about the evolvis-commits mailing list