add support for the DARCSWEB_CONFPATH env var
Mon Mar 24 17:31:17 UTC 2008 Miklos Vajna <vmiklos@frugalware.org>
* add support for the DARCSWEB_CONFPATH env var
- useful when hosting multiple darcsweb sites via vhost
diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi
--- old-darcsweb/darcsweb.cgi 2013-07-18 20:19:27.000000000 +0000
+++ new-darcsweb/darcsweb.cgi 2013-07-18 20:19:27.000000000 +0000
@@ -31,6 +31,13 @@
# clashing if there's a config.py in the standard path.
sys.path.insert(1, '/etc/darcsweb')
+# Similarly, when hosting multiple darcsweb instrances on the same
+# server, you can just 'SetEnv DARCSWEB_CONFPATH' in the httpd config,
+# and this will have a bigger priority than the system-wide
+# configuration file.
+if 'DARCSWEB_CONFPATH' in os.environ:
+ sys.path.insert(1, os.environ['DARCSWEB_CONFPATH'])
+
# empty configuration class, we will fill it in later depending on the repo
class config:
pass