You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Michaël Bruneel <m...@alethes.be> on 2011/11/04 19:50:14 UTC

mod_dav_svn and Apache directive

  Hi,

  It seems that the dav_svn Apache module is not compatible with
<Location> directive when used with regular expression containing
negative part. For example, given that configuration:

    <Location ~ "^/(?!viewvc)" >
      DAV svn
      SVNPath /srv/svnroot/myproject
    </Location>

    ScriptAlias /viewvc "/usr/lib/cgi-bin/viewvc.cgi"

the content of the <title> tag in the HTML response becomes:

    <title>(?!viewvc) - Revision 1848: /</title>

instead of:

    <title>/ - Revision 1848: /</title>

and we get this error :

    svn: Server sent unexpected return value (400 Bad Request) in response
    to PROPFIND request for '%5E/(%3F!viewvc)/!svn/vcc/default'

  The repository root contains trunk/, branches/ and tags/ directories
and a viewvc/ directory will never be versioned. The viewvc URL is used
to browse the repository through ViewVC interface.

  Is it the really expected behaviour? Or is there something wrong
somewhere else?

Regards,

--
Michaël Bruneel
http://www.alethes.be

Re: mod_dav_svn and Apache directive

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Nov 4, 2011, at 13:50, Michaël Bruneel wrote:

>  It seems that the dav_svn Apache module is not compatible with
> <Location> directive when used with regular expression containing
> negative part. For example, given that configuration:
> 
>    <Location ~ "^/(?!viewvc)" >
>      DAV svn
>      SVNPath /srv/svnroot/myproject
>    </Location>
> 
>    ScriptAlias /viewvc "/usr/lib/cgi-bin/viewvc.cgi"
> 
> the content of the <title> tag in the HTML response becomes:
> 
>    <title>(?!viewvc) - Revision 1848: /</title>
> 
> instead of:
> 
>    <title>/ - Revision 1848: /</title>
> 
> and we get this error :
> 
>    svn: Server sent unexpected return value (400 Bad Request) in response
>    to PROPFIND request for '%5E/(%3F!viewvc)/!svn/vcc/default'

That sounds pretty much like what I found years ago. I gave up on trying to be clever with Location directives.


>  The repository root contains trunk/, branches/ and tags/ directories
> and a viewvc/ directory will never be versioned. The viewvc URL is used
> to browse the repository through ViewVC interface.
> 
>  Is it the really expected behaviour? Or is there something wrong
> somewhere else?

I suggest you do "Location /svn" for your repository, and "Location /viewvc" for your viewvc installation. Just keep them in totally separate URL spaces.



Re: mod_dav_svn and Apache directive

Posted by Philip Martin <ph...@wandisco.com>.
Michaël Bruneel <m...@alethes.be> writes:

>   IMHO, given <Location ~ "^/(?!viewvc)" > and URL '/', mod_dav_svn
> should be able to understand the regular expression and treat '/' as
> both the path to the repository and the path inside the repository. It
> should not use raw '(?!viewvc)' data as it does now.

That's only one case out of many. What about things like?

<Location ~ "/foo(?!xxx)">
<Location ~ "/foo/(?!xxx)">
<Location ~ "/foo/(?!xxx)zig">
<Location ~ "/foo(?!xxx)/zig">
<Location ~ "/foo/(?!xxx)/zig">

Take that last one: "/foo/bar/zig/zag" matches "/foo/(?!xxx)/zig" but
what is the path to the repository and what is the path inside the
repository?

What about SVNParentPath?

Are multiple regepxs allowed?

<Location ~ "/foo/(?!xxx)/zig/(?!yyy)">

Which things should be supported?  How should they behave?  What is the
advantage of supporting them?

-- 
Philip

Re: mod_dav_svn and Apache directive

Posted by Michaël Bruneel <m...@alethes.be>.
  Hi Philip,

  IMHO, given <Location ~ "^/(?!viewvc)" > and URL '/', mod_dav_svn
should be able to understand the regular expression and treat '/' as
both the path to the repository and the path inside the repository. It
should not use raw '(?!viewvc)' data as it does now.

  I understand that this behaviour could be a problem when the
repository itself contains a viewvc/ directory and it's better to use
totally separated URL. The point was to keep the URL and not force users
to relocate their working copy.

  Thanks for your help. Regards,

--
Michaël Bruneel
http://www.alethes.be

On sam, nov 05, 2011 at 10:13:36 +0000, Philip Martin wrote:
> Michaël Bruneel <m...@alethes.be> writes:
> 
> >     <Location ~ "^/(?!viewvc)" >
> >       DAV svn
> >       SVNPath /srv/svnroot/myproject
> >     </Location>
> 
> Given <Location /foo/bar> and an URL '/foo/bar/zig/zag' mod_dav_svn
> treats '/foo/bar' as the path to the repository and '/zig/zag' as the
> path inside the repository.
> 
> How would you Location work?  Where does '/foo/bar/zig/zag' get divided?
> 
> -- 
> Philip

Re: mod_dav_svn and Apache directive

Posted by Philip Martin <ph...@wandisco.com>.
Michaël Bruneel <m...@alethes.be> writes:

>     <Location ~ "^/(?!viewvc)" >
>       DAV svn
>       SVNPath /srv/svnroot/myproject
>     </Location>

Given <Location /foo/bar> and an URL '/foo/bar/zig/zag' mod_dav_svn
treats '/foo/bar' as the path to the repository and '/zig/zag' as the
path inside the repository.

How would you Location work?  Where does '/foo/bar/zig/zag' get divided?

-- 
Philip