[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svnserve not reading hooks-env?

From: Steven Simpson <ss_at_comp.lancs.ac.uk>
Date: Thu, 10 Nov 2016 14:56:26 +0000

Hi Stefan,

On 10/11/16 00:07, Stefan wrote:
> On 11/10/2016 00:45, Steven Simpson wrote:
>> PROBLEM: When attempting to commit via SSH, I get errors from my
>> scripts indicating that they haven't found the REPOWEBMAN_CONFIG
>> setting, so they fail, and the commit fails. HTTPS-invoked hooks work
>> fine.
> So if I get you right you are saying that someone connecting to the
> server via https://[URL] causes the hook to run as expected while
> someone using svn+ssh://[URL] triggers the hook but that fails due to
> REPOWEBMAN_CONFIG not being set?

Correct.

> If I get you right, I can't follow you why you think REPOWEBMAN_CONFIG
> would be set in the svn+ssh-case (or maybe I'm lacking some knowledge
> here?).
> You stated that you specified REPOWEBMAN_CONFIG in
> /etc/forge/svn-hooks-env.ini which is set in the Apache config (aka:
> applies when someone uses https://[URL]).
>
> You also state that you start svnserve with the config file being set to
> /etc/forge/svnserve.ini. But where would you expect the connection to
> the REPOWEBMAN_CONFIG-environment variable here?

if you create a fresh repo with svnadmin create, a default
conf/svnserve.conf is created containing:

[general]
(...snip...)
### The authz-db option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a /, the file's location is relative to the
### directory containing this file. The specified path may be a
### repository relative URL (^/) or an absolute file:// URL to a text
### file in a Subversion repository. If you don't specify an authz-db,
### no path-based access control is done.
### Uncomment the line below to use the default authorization file.
# authz-db = authz
(...snip...)
### The hooks-env options specifies a path to the hook script environment
### configuration file. This option overrides the per-repository default
### and can be used to configure the hook script environment for multiple
### repositories in a single file, if an absolute path is specified.
### Unless you specify an absolute path, the file's location is relative
### to the directory containing this file.
# hooks-env = hooks-env

These are the two options I've set in /etc/forge/svnserve.ini. The
authz-db option is effective, as I can make it point at a non-existent
file to force an error, but the hooks-env option seems to have no effect.

Given that, this trace from inside a repo should make sense, right?:

$ ls -F conf/
authz hooks-env@ passwd svnserve.conf@ svnserve.conf-orig
$ readlink -f conf/hooks-env conf/svnserve.conf
/etc/forge/svn-hooks-env.ini
/etc/forge/svnserve.ini
$ cat /etc/forge/svnserve.ini
[general]
authz-db=/var/forge/service/svn-authz.conf
hooks-env=/etc/forge/svn-hooks-env.ini
$ cat /etc/forge/svn-hooks-env.ini
[default]
LANG=en_GB.UTF-8
PATH=/usr/bin:/bin
REPOWEBMAN_CONFIG=/etc/forge/repowebman.ini

Even if svnserve is ignoring the hooks-env option, conf/hooks-env
symlinks to the same file (and that is effective for <file:> access).

> Am I missing something
> or is this actually the cause of your problem?

I'm starting to think that hooks-env with svnserve is a documented
unfeature. ;-) I don't see it in the 1.7 docs, but it is in 1.8:

<http://svnbook.red-bean.com/en/1.8/svn.serverconfig.svnserve.html#svn.serverconfig.svnserve.ref.general>

I think I will have to do it the old-fashioned way.

Cheers!
Received on 2016-11-10 15:56:58 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.