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

RE: [ViewCVS] setting up viewcvs for auth/access

From: bruce <bedouglas_at_earthlink.net>
Date: 2005-04-20 16:15:23 CEST

michael,

thanks for the reply. it appears that either my email, or the isp, or
something was inteferring with email over the last few days. so i wasn't
sure if this was being looked at, if there was no real answer, or etc...

however, i've managed to more or less get Gforge4/Viewcvs/apache2.0.52,
fedora core 2 working. it appears that i can allow a user to specify a given
repository, and that viewcvs then uses the undeerlying SVN auth files from
the Location block in the httpd.conf file, which is what i had expected. i'm
not exactly sure why there was an initial problem... there is a problem with
the caching of the username/password/coookies/etc.. i can go throught
user/passwd process, access a given project, kill the browser session, and
return to the webstei/url, and the gforge/viewcvs will allow me access
without prompoting for the user/passwd. if i clean out the cache/delete the
cache/cookies, then i get the user/passwd auth dialog.

the relevant portions of the apache httpd.conf/viewcvs.conf files are listed
below. as you can see, i'm doing a crude matching of the 'viewcvs.cgi/proj'
to implement the authorization process. i'm sure there's a better way, but i
don't know what it is.

httpd.conf
-------------------------------------------
#
# Primary GForge vhost
#
# Load gforge config files from the config directory /etc/httpd/conf.d".
#Include conf.d/gforge_vh.conf

# HTTP
<VirtualHost 192.168.1.52:80>
ServerName dev1.gotdns.com
#ServerName gforge.mesa.com
#ServerAlias app1.gotdns.com
ServerAdmin webmaster@gforge.mesa.com /> DocumentRoot /var/www/gforge/www

<Directory /var/www/gforge/www>
Options Indexes FollowSymlinks
AllowOverride All
order allow,deny
allow from all
php_admin_value include_path
"/var/www/gforge/etc/custom:/var/www/gforge:/var/www/gforge/www/include:."
php_admin_value default_charset "UTF-8"
php_admin_value register_globals "On"
</Directory>

Alias /images/ /var/www/gforge/www/images/
DirectoryIndex index.html index.php
<IfModule mod_userdir.c>
UserDir disabled
</IfModule>

php_admin_value default_charset "UTF-8"

<Directory /var/www/gforge/www>
Include /var/www/gforge/etc/httpd.secrets
</Directory>

ScriptAliasMatch ^/plugins/([^/]*)/cgi-bin/(.*)
/usr/lib/gforge/plugins/$1/cgi-bin/$2

# Projects and Users script
<Location /projects>
ForceType application/x-httpd-php
</Location>
<Location /users>
ForceType application/x-httpd-php
</Location>

<Location /plugins/scmsvn/cgi-bin/viewcvs.cgi/forge>
SVNPath /gforge-svn/forge/svn
AuthType Basic
AuthName "Forge Repository"
AuthUserFile /gforge-svn/svn-auth
Require valid-user
</Location>

<Location /plugins/scmsvn/cgi-bin/viewcvs.cgi/jupiter>
SVNPath /gforge-svn/jupiter/svn
AuthType Basic
AuthName "Forge Repository"
AuthUserFile /gforge-svn/svn-auth
Require valid-user
</Location>

# 404 Error document
ErrorDocument 404 /404.php
LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" gforge
# CustomLog "|/usr/sbin/cronolog
/var/www/gforge/var/log/#gforge/%Y/%m/%d/gforge.log" gforge

# GForge without the DNS delegation
# Project home pages are in a virtual /www/<group> location
AliasMatch ^/www/([^/]*)/(.*) /home/groups/$1/htdocs/$2
ScriptAliasMatch ^/([^/]*)/cgi-bin/(.*) /home/groups/$1/cgi-bin/$2
<Directory /home/groups>
Options Indexes FollowSymlinks
AllowOverride All
order allow,deny
allow from all
</Directory>

# Ensure that we don't try to use SSL on SSL Servers
<IfModule apache_ssl.c>
SSLDisable
</IfModule>
</VirtualHost>
--------------------------------------------

viewcvs.conf
--------------------------------------------
# This setting specifies each of the Subversion roots (repositories)
# on your system and assigns names to them. Each root should be given
# by a "name: path" value. Multiple roots should be separated by
# commas and can be placed on separate lines.
#
#svn_roots = test2: /svn-gforge/uploadsvn
svn_roots = test5: /gforge-svn/test7/svn,
test2: /gforge-svn/test7/svn,
athena: /gforge-svn/athena/svn,
troy: /gforge-svn/troy/svn,
mars: /gforge-svn/mars/svn,
proteus: /gforge-svn/proteus/svn,
mercury: /gforge-svn/mercury/svn,
triton: /gforge-svn/triton/svn,
zeus: /gforge-svn/zeus/svn,
venus: /gforge-svn/venus/svn,
pluto: /gforge-svn/pluto/svn,
saturn: /gforge-svn/saturn/svn,
apollo: /gforge-svn/apollo/svn,
hermes: /gforge-svn/hermes/svn,
hera: /gforge-svn/hera/svn,
thor: /gforge-svn/thor/svn,
neptune: /gforge-svn/neptune/svn,
jupiter: /gforge-svn/jupiter/svn,
forge: /gforge-svn/forge/svn,

.
.
.
# The 'root_parents' setting specifies a list of directories in which
# any number of repositories may reside. Rather than force you to add
#
# You can specify multiple parent paths separated by commas or new lines.
#
# Each parent path is processed sequentially, so repositories under
# later parent paths may override earlier ones.
#
#root_parents = /gforge-svn/ : svn,
#root_parents = /home/svn-repositories : svn,
# /home/cvs-repositories : cvs
.
.
.
# root_as_url_component: Interpret the first path component in the URL
# after the script location as the root to use. This is an
# alternative to using the "root=" query key. If ViewCVS is configured
# with multiple repositories, this results in more natural looking
# ViewCVS URLs and allows you to browse checked out HTML files with
# relative links to other repository files within ViewCVS.
# Note: Enabling this option will break backwards compatibility with
# any old ViewCVS URL which doesn't have an explicit "root" parameter.
root_as_url_component = 1
.
.
.
--------------------------------------------

-----Original Message-----
From: cmpilato@localhost.localdomain
[mailto:cmpilato@localhost.localdomain]On Behalf Of C. Michael Pilato
Sent: Wednesday, April 20, 2005 6:50 AM
To: bedouglas@earthlink.net
Cc: viewcvs@lyra.org; users@subversion.tigris.org
Subject: Re: [ViewCVS] setting up viewcvs for auth/access

"bruce" <bedouglas@earthlink.net> writes:

> i can use http:/foo.com/testsvn and get the user/passwd dialog for the svn
> repository. i also get the user/passwd prompt using the command line svn
> functions...
>
> however, i'm not sure as to how i have to setup the
viewcvs.conf/httpd.conf
> files in order to get the viewcvs app to display the user/passwd dialog...

If you are using straight Apache directives for
authentication/authorization with your Subversion setup, then it
should be a trivial task to use those same directives for ViewCVS.

For example, something like the following (not fully tested, I'm just
a-typin' in email here):

   ### My Subversion repositories
   <Location /svn>
       SVNParentPath /usr/local/svn
       DAV svn
       AuthName "Subversion Repository"
       AuthType basic
       AuthUserFile /usr/local/svn-passwords
       Require valid-user
   </Location>

   ### My ViewCVS (uses the same password file as Subversion)
   ScriptAlias /viewcvs /usr/local/viewcvs-1.0-dev/www/cgi/viewcvs.cgi
   <Location /viewcvs>
       AuthName "Subversion Repository"
       AuthType basic
       AuthUserFile /usr/local/svn-passwords
       Require valid-user
   </Location>

If, however, you are using something more complicated (like
mod_authz_svn, etc.), then this might not work out so well.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Apr 20 16:37:35 2005

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.