[viewvc-dev] Re: [viewvc-users] svnauthz

Tom Throckmorton <[email protected]> Mon, 29 Sep 2008 15:52:10 -0400
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Message-ID <20080929195208.GA26811__37801.450622692$1222718873$gmane$org@gmail.com>
On Aug 27 12:41, C. Michael Pilato wrote:
> Chris Rodgers wrote:
> > Hi,
> > 
> > I am using svnauthz from the trunk version of ViewVC.
> > 
> > Is it possible to configure different authz files for the different
> > subversion repositories on my system? (Or do I need to reinstall viewvc
> > for each repository?)
> 
> Hey, Chris.  Currently, there is no per-root configuration.  (This is
> probably the single biggest annoyance preventing me from releasing 1.1-beta
> right now.)  So you either have to put all our authz configury into one
> authz file, or use the vhost support, or hack the ViewVC code.

Hi,

Part-time listener, first time caller ;-)  Came across this message, and
thought I'd share...

Back in mid-December I started using rev 1744 of the vcauth-reorg branch, in
order to get the svnauthz functionality.  I wanted to be able to use multiple
authz files, and found that I could achieve this by _not_ specifying an
authzfile in the [authz-svnauthz] section, and by creating per-repo stanzas
that used root-{reponame}, which look like:

> [root-repo1/options]
> authorizer = svnauthz
> [root-repo1/authz-svnauthz]
> authzfile = /path/to/svn/repo1/conf/authz
>
> [root-repo2/options]
> authorizer = svnauthz
> [root-repo2/authz-svnauthz]
> authzfile = /other/path/svn/repo2/conf/authz


...and figured this would work, based on what's defined in lib/config.py

170     params = {}
171     authz_section = 'authz-%s' % (authorizer)
172     if rootname:
173       root_authz_section = 'root-%s/authz-%s' % (rootname, authorizer)
174     for section in self.parser.sections():
175       if section == authz_section \
176          or (rootname and section == root_authz_section):
177         params.update(self.parser.items(section))
178     return params

...which I presumed was there precisely for this purpose, and appeared to do
the Right Thing, i.e., I can define and use multiple authz files, one per repo.
And as I understand it, this is similar to, but not the same as the vhost
configuration.

I tried this again just now against head (2015), and it still appears to be
working as in the earlier release (so far, at least).  So, what am I doing
incorrectly to make this work? :-D
 
> Ohmygosh.  I just had a positive mental event while typing that last phrase.
> 
> What if I made the authzfile able to do variable substition of the rootname?
>  So, you could set it to "/opt/svn/%(rootname)s-authz.conf" and ViewVC would
> substitute the root name for the %(rootname)s before reading the authz file?

I'd vote for that one, too.

Cheers,

-tt

-- 
Tom Throckmorton

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]