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

"C. Michael Pilato" <[email protected]> Mon, 29 Sep 2008 15:58:35 -0400
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Organization CollabNet, Inc.
Message-ID <48E1336B.8040506__49581.6789953553$1222718868$gmane$org@collab.net>
Tom Throckmorton wrote:
> 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

Wow.  This is embarrassing.  Did I really commit that code?  I've taken a
few different cracks at per-root configury, but didn't think I'd committed
any of them.

Well, if that's the one that's in there now, and folks are finding it
useful, maybe I should just document it and move on, eh?  (*Sheesh*)

:-)

-- 
C. Michael Pilato <[email protected]>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFI4TNrokEGqRcG/W4RAoKYAKCiJoZUhJPrfTtMyGocl4Gnl/R6bwCggt3O
hmKyT5mGBkaPP/C9qp7n3/4=
=MWW2
-----END PGP SIGNATURE-----