subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Simpson>
Subject Re: svnserve not reading hooks-env?
Date Thu, 10 Nov 2016 14:56:26 GMT
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?


> 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:

### 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
### 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
$ cat /etc/forge/svnserve.ini
$ cat /etc/forge/svn-hooks-env.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:


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


View raw message