0

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.

1 Answers1

2

UPDATE

Setting the /var/svn folder owner to www-data:

chown -R www-data:www-data /var/svn

and you can then create a subversion repository from a webpage without sudo.


If you really want to do that, let's limit the www-data user to run svnadmin command without prompting for password. Type visudo and add the following line:

www-data  ALL=(ALL)   NOPASSWD:/usr/bin/svnadmin
quanta
  • 51,413
  • 19
  • 159
  • 217