Subversion Admin Toolkit
This describes a set of PHP scripts that I use to administrate my Subversion repositories.
Assumptions
- You are using Subversion through Apache (http or https)
- You are using mod-svn_authz and a standard access file for it
- passwords are stored in a standard htpasswd-file, using MD5-Passwords
- You are using multiple repositories under one single path
- the subdirectory "admin" of that path is reserved for the password and access file and does not contain a repository (but is present)
- this all runs under Linux or Unix, it won't work under Windows
Installation
- get the sources from: svnadm.zip
- Install them somewhere into your normal Apache web space
- change the config.php file to match your configuration
- change the .htaccess file to match your configuration (if the scripts don't work after that, you didn't allow to override configuration in .htaccess, in this case reconfigure Apache to allow this or put the content of .htaccess in an appropriate section of your Apache config)
- make sure Apache can write/change the password and access file (and the directory it is in, since the scripts create changed access files as new file first and then moves the file onto the normal location)
- enter the line "#@admin = myuser" into your access file and replace "myuser" with the name of your primary admin account; whenever you accidentally deleted your primary admin rights you can restore them by adding/modifying this line
Usage
svnpasswd.php
This one is pretty self explanatory, you can use it to change the password of the logged in user.
svnadmin.php
Can be used to change access settings of your subversion repositories, to introduce new user groups into it, and to create new users and reset old users passwords.
A non-admin-user will not see anything in this script.
An admin will see his/her repositories and will be allowed to create and change groups that start with the name of his/her repositories.
The virtual repository "admin" contains global settings. An admin of "admin" is a global administrator and can see all repositories, change all groups and create new groups with any namespace (even without repository prefix). Global admins are also allowed to reset user passwords and to create new users.