logo       
Google Custom Search
    AddThis Social Bookmark Button

[PATCH] allow viewvc to get config file from ENV VAR: msg#00009

Subject: [PATCH] allow viewvc to get config file from ENV VAR
Hi,

I am managing a cvs/svn/darcs server at work and I add deal a special request 
from my users:

- some want everybody can see their code,
- some want the viewvc be protected by login/password.

Setting up a login/password in httpd configuration is easy, but I can't apply 
same restriction to everybody.

The solution I found is to setup viewvc in different location using different 
configuration to setup only protected repos in each location.

But it is impossible to use same viewvc code and using different configuration 
file as the configuration path is hardcode in script.

So I patched the original script to pass configuration location using an 
envirronement variable and so allowing such thing in httpd.conf:

ScriptAlias /forge-viewvc /var/www/cgi-bin/viewvcf.cgi

<LocationMatch "/forge-viewvc">
        SetEnv VIEWVC_CONF /etc/viewvc/viewvc.conf
</LocationMatch>

The patch is very small:

--- viewvc.cgi  2006-05-02 06:46:31.000000000 +0200
+++ viewvcf.cgi 2006-11-10 22:43:22.000000000 +0100
@@ -40,6 +40,9 @@
 import sys
 import os

+if os.environ.get('VIEWVC_CONF'):
+  CONF_PATHNAME = os.environ.get('VIEWVC_CONF')
+
 if LIBRARY_DIR:
   sys.path.insert(0, LIBRARY_DIR)
 else:

Any chance to have it included ?

Regards.

Attachment: pgpYojhxOUFIA.pgp
Description: PGP signature


Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>