Archive for the ‘System Administration’ Category

Project Creation

Sunday, October 5th, 2008

After making a few tracs and subversion repos by hand and having to do all the little things that need setting up to make things run smoothly (remembering to give svn trunk/tags/branches directories, setting up trac authentication, etc.), I decided to make a little shell script to do most of it for me.

The script I wrote takes a name as its argument and makes a trac and a repository using that name and makes a linked pair with all the bits set the way I need them in my environment for basic functionality. The repository is accessible to anyone in group dev, and I am the only admin on the trac.

if [ $# != 1 ]; then
    echo "Usage: $0 <project name>"
    exit 1
echo "About to create svn/trac for project $PROJ."
echo "    svn: $SVNPATH"
echo "    trac: $TRACPATH"
echo "Press Ctrl-C to abort."
sleep 5
svnadmin create $SVNPATH
chown -R root:dev $SVNPATH
chmod -R g+ws $SVNPATH
svn mkdir -m "Directory layout" file://$SVNPATH/trunk file://$SVNPATH/branches file://$SVNPATH/tags
# initenv <projectname> <db> <repostype> <repospath>
trac-admin $TRACPATH initenv $PROJ sqlite:db/trac.db svn $SVNPATH
chmod g+w $TRACPATH/db
chmod g+w $TRACPATH/db/trac.db
cat >> $TRACPATH/conf/trac.ini <<EOF
acct_mgr.htfile.htpasswdstore = enabled
acct_mgr.web_ui.accountmodule = enabled
acct_mgr.web_ui.loginmodule = enabled
trac.web.auth.loginmodule = disabled
authentication_url =
password_file = /var/trac/htpasswd
password_store = HtPasswdStore
trac-admin $TRACPATH permission add jonathan TRAC_ADMIN

Things I might like to fix someday:

  1. I create duplicate sections in the trac.ini, although it appears to parse them OK.
  2. I’d like it to put a link on the wiki start page with the URL to the repository.

Trac Setup

Monday, July 7th, 2008

Redmine ended up being a bust due to Debian shipping a version of ruby (1.8.7) that is incompatible with Ruby on Rails. Apparently it doesn’t work above 1.8.6. I am impressed that a language’s flagship application gets broken by a point release and no one seems to have anything to say about it other than “don’t use 1.8.7″.

I switched back to Trac despite its limitations because it actually works. Of course, then I had to set up its user authentication, which was a headache of its own. Sometimes I cannot win.

Now, to put things on wikis!

Redmine Setup

Friday, July 4th, 2008

Having been annoyed by some of the limitations of trac in the past, I have decided that for an upcoming (sshhh! say nothing!) project, I’d try to use redmine, which seems to be about the same but with less suck.

Unlike trac, which is written in python, redmine uses ruby on rails (How terribly Web two-point-oh!). I checked the 0.7 version of redmine out of their repository and installed a bunch of debian ruby-related packages (ruby, rubygems, rake, rails, libdbd-mysql-ruby, libyaml-ruby), only to find that their version of rails is quite broken. After running gem install rails -v 2.0.2 things seemed to be going better.

Using apache instead of the built in web server added a few additional kinks. I needed to copy the virtual host config from GettingStartedWithRails (site currently broken, Google cache used). Then, I had to tweak the contents of the redmine directory a bit to get the right script executing. cp dispatch.cgi.example dispatch.cgi and then edit .htaccess, taking a pointer from the fastcgi lines, to include RewriteRule ^(.*)$ dispatch.cgi [QSA,L]. Perhaps fastcgi will be my next step, as it is really quite slow.