You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by John Aldridge <jo...@informatix.co.uk> on 2007/12/04 19:03:59 UTC
Make part of repository visible via Apache?
We run Apache as a web server for internal company material. One of the
things it serves is a URL
http://www/Documents
which is currently an ordinary folder in the Apache DocumentRoot folder
whose contents (mostly html files) are populated by checking out the
"trunk/Documents" subtree of our repository.
This has two disadvantages:
a) Anyone who updates a document needs to remember to do an "svn update"
in order to make the updated document visible, and
b) It's a waste of disk (& backup tape) space.
I wondered whether mod_dav_svn could be used to solve both of these
problems by having Apache serve a direct view onto the repository, so I
loaded the mod_dav and mod_dav_svn modules and added
<Location /Documents>
DAV svn
SVNPath d:/svn-repos
</Location>
to the Apache config file. This worked, kind of, but has a number of
problems which make it less than ideal
a) I can't find a way of making the URL http://www/Documents show the
contents of just "/trunk/Documents", rather than the repository root
folder. This will break any existing links on other pages. The nearest I
have to a solution is to serve the entire repository as /svn and add a
Redirect /Documents http://www/svn/trunk/Documents
directive. This isn't ideal, though, as I'd rather preserve the myth
that these documents really do live in /Documents.
b) I have no wish to allow write access to the repository via Apache
(that's done by a service running svnserve). Is there a simple way of
configuring mod_dav_svn to be readonly, short of configuring
authentication and access control options.
c) $Revision$ and $Date$ keywords are not expanded in the displayed
documents. Not a critical deficiency, but a pity.
I'd welcome any hints for solving these problems, or suggestions for a
better way to solve the underlying problem.
--
Thanks,
John
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: Make part of repository visible via Apache?
Posted by "Reedick, Andrew" <jr...@ATT.COM>.
> -----Original Message-----
> From: John Aldridge [mailto:john.aldridge@informatix.co.uk]
> Sent: Tuesday, December 04, 2007 2:04 PM
> To: users@subversion.tigris.org
> Subject: Make part of repository visible via Apache?
>
> This has two disadvantages:
>
> a) Anyone who updates a document needs to remember to do an "svn
> update"
> in order to make the updated document visible, and
>
Or have a checkin-hook script kick off the update. Or have a script
monitor the directory to see if the revision number between the working
copy and the repository are out of date to determine when to run update.
*****
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA623
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Make part of repository visible via Apache?
Posted by John Aldridge <jo...@informatix.co.uk>.
I won't quote the original (lengthy) question here, but in summary I
asked whether Apache/mod_dav_svn could be configured to serve a live
read-only view of a subtree of the repository.
The general conclusion seems to be that this can't be made to work well,
and that I'd be better off keeping a checked out working copy (in some
non-backed up location) and serving that, perhaps with the aid of a
post-commit script to make sure that it stays synchronized with the
repository.
Thanks to all who replied.
--
Cheers,
John
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Make part of repository visible via Apache?
Posted by Les Mikesell <le...@gmail.com>.
John Aldridge wrote:
> We run Apache as a web server for internal company material. One of the
> things it serves is a URL
>
> http://www/Documents
>
> which is currently an ordinary folder in the Apache DocumentRoot folder
> whose contents (mostly html files) are populated by checking out the
> "trunk/Documents" subtree of our repository.
>
> This has two disadvantages:
>
> a) Anyone who updates a document needs to remember to do an "svn update"
> in order to make the updated document visible, and
You could schedule an 'svn update' to run periodically.
> b) It's a waste of disk (& backup tape) space.
Have you looked at viewvc (http://www.viewvc.org/) or websvn
(http://websvn.tigris.org/) for read-only browser access? You may or
may not want to expose the history the way these do.
--
Les Mikesell
lesmikesell@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Make part of repository visible via Apache?
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Dec 4, 2007, at 13:03, John Aldridge wrote:
> We run Apache as a web server for internal company material. One of
> the things it serves is a URL
>
> http://www/Documents
>
> which is currently an ordinary folder in the Apache DocumentRoot
> folder whose contents (mostly html files) are populated by checking
> out the "trunk/Documents" subtree of our repository.
>
> This has two disadvantages:
>
> a) Anyone who updates a document needs to remember to do an "svn
> update" in order to make the updated document visible, and
Write a post-commit hook which automatically runs "svn update" on
this directory after every commit.
> b) It's a waste of disk (& backup tape) space.
Disk space is cheap.
Don't back up this directory.
> I wondered whether mod_dav_svn could be used to solve both of these
> problems by having Apache serve a direct view onto the repository,
> so I loaded the mod_dav and mod_dav_svn modules and added
>
> <Location /Documents>
> DAV svn
> SVNPath d:/svn-repos
> </Location>
>
> to the Apache config file. This worked, kind of, but has a number
> of problems which make it less than ideal
>
> a) I can't find a way of making the URL http://www/Documents show
> the contents of just "/trunk/Documents", rather than the repository
> root folder. This will break any existing links on other pages. The
> nearest I have to a solution is to serve the entire repository as /
> svn and add a
>
> Redirect /Documents http://www/svn/trunk/Documents
>
> directive. This isn't ideal, though, as I'd rather preserve the
> myth that these documents really do live in /Documents.
Only an entire repository can be served. You can't serve just a subset.
> b) I have no wish to allow write access to the repository via
> Apache (that's done by a service running svnserve). Is there a
> simple way of configuring mod_dav_svn to be readonly, short of
> configuring authentication and access control options.
Not sure. Well, you could write a start-commit hook which simply
denies all commits. But you'd presumably have to engineer it so that
it only does this if it's apache trying to do the commit, since you'd
still want commits from svnserve. Not sure how to detect which
process is doing the committing.
> c) $Revision$ and $Date$ keywords are not expanded in the displayed
> documents. Not a critical deficiency, but a pity.
Correct. Keyword expansion only happens in the client. mod_dav_svn is
a server, not a client, so it does not expand keywords.
> I'd welcome any hints for solving these problems, or suggestions
> for a better way to solve the underlying problem.
Go with the way you have it now, serving a working copy.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Make part of repository visible via Apache?
Posted by Toby Thain <to...@smartgames.ca>.
>
> b) I have no wish to allow write access to the repository via
> Apache (that's done by a service running svnserve). Is there a
> simple way of configuring mod_dav_svn to be readonly, short of
> configuring authentication and access control options.
But it's not difficult; mod_authz_svn, and/or Apache Limit directive.
--Toby
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Make part of repository visible via Apache?
Posted by John Peacock <jo...@havurah-software.org>.
John Aldridge wrote:
> c) $Revision$ and $Date$ keywords are not expanded in the displayed
> documents. Not a critical deficiency, but a pity.
Just to touch on this last point, all of the keyword expansion happens
in the client code exclusively, so there is no way to display the files
directly out of the server and still have keyword expansion.
Honestly, since diskspace is really cheap, you should just serve up a
working copy to your internal users, and just use a post-commit script
to ensure that this is always reflecting the most recent files
committed. I can recommend SVN::Notify::Mirror (with
SVN::Notify::Config) as a very low maintenance way of accomplishing that
(but then again I wrote the former and have adopted the latter, so I
would say that ;-)
John
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Make part of repository visible via Apache?
Posted by Johnathan Gifford <jg...@wernervas.com>.
John,
Have you considered creating a second URL for the same repository and block access to those directories that folks should not have access to with-in your Subversion authorization file?
You can see how to do this at:
http://blogs.open.collab.net/svn/2007/03/subversion_ldap.html
Hope this helps,
Johnathan
>>> On Tue, Dec 4, 2007 at 1:03 PM, in message
<47...@informatix.co.uk>, John Aldridge
<jo...@informatix.co.uk> wrote:
> We run Apache as a web server for internal company material. One of the
> things it serves is a URL
>
> http://www/Documents
>
> which is currently an ordinary folder in the Apache DocumentRoot folder
> whose contents (mostly html files) are populated by checking out the
> "trunk/Documents" subtree of our repository.
>
> This has two disadvantages:
>
> a) Anyone who updates a document needs to remember to do an "svn update"
> in order to make the updated document visible, and
>
> b) It's a waste of disk (& backup tape) space.
>
> I wondered whether mod_dav_svn could be used to solve both of these
> problems by having Apache serve a direct view onto the repository, so I
> loaded the mod_dav and mod_dav_svn modules and added
>
> <Location /Documents>
> DAV svn
> SVNPath d:/svn-repos
> </Location>
>
> to the Apache config file. This worked, kind of, but has a number of
> problems which make it less than ideal
>
> a) I can't find a way of making the URL http://www/Documents show the
> contents of just "/trunk/Documents", rather than the repository root
> folder. This will break any existing links on other pages. The nearest I
> have to a solution is to serve the entire repository as /svn and add a
>
> Redirect /Documents http://www/svn/trunk/Documents
>
> directive. This isn't ideal, though, as I'd rather preserve the myth
> that these documents really do live in /Documents.
>
> b) I have no wish to allow write access to the repository via Apache
> (that's done by a service running svnserve). Is there a simple way of
> configuring mod_dav_svn to be readonly, short of configuring
> authentication and access control options.
>
> c) $Revision$ and $Date$ keywords are not expanded in the displayed
> documents. Not a critical deficiency, but a pity.
>
> I'd welcome any hints for solving these problems, or suggestions for a
> better way to solve the underlying problem.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: Make part of repository visible via Apache?
Posted by "Harvey, Edward" <Ed...@patni.com>.
> We run Apache as a web server for internal company material. One of
the
> things it serves is a URL
>
> http://www/Documents
>
*snip*
> I wondered whether mod_dav_svn could be used to solve both of these
> problems by having Apache serve a direct view onto the repository, so
I
> loaded the mod_dav and mod_dav_svn modules and added
Right now, what URL is used to access your svn repo? svn://? file://?
http://? Something else? (In most cases, you should use either svn://
or http(s):// because they're the most reliable to prevent repository
corruption.)
If you configure apache to serve your repo as http://blah/blah then in
fact you get exactly what you're talking about here. The most recent
version of the repo is available as a direct http url, without wasting
additional disk space, and it's read-only. In fact, this is what I
already do myself.
If you have any trouble getting this working, just ask again. It can be
difficult to get it working.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org