Creating svn repo programmatically from a webpage and sudo
Posted
by
Adriano Varoli Piazza
on Server Fault
See other posts from Server Fault
or by Adriano Varoli Piazza
Published on 2011-11-25T16:30:06Z
Indexed on
2011/11/25
17:53 UTC
Read the original article
Hit count: 336
We want to automate the creation of the svn repos and trac environments for new projects. Basically, this would mean creating a web script that got some info (like env and repo name, etc) from the user and then executed
sudo -u svn svnadmin create /var/svn/<projectname>
trac-admin /var/trac/sites/<projectname> initenv [... All extra params...]
For the second command, this is simple, as it already runs as the www-data user, so I wouldn't have to use sudo. But for the first command, I'd have to use sudo and add www-data
to the sudoers file. I was wondering if this is a good idea, and how to do it in that case. Reading the manpage has left me with more doubts than certainties about this.
This webserver would only be accessible from our internal network, by the way. The OS is Ubuntu Server 10.04.
© Server Fault or respective owner