Redmine…field
Tuesday, October 20th, 2009Redmine then.
So what’s that then i hear you cry…ok well maybe not but you’re probably still interested. Redmine is an alternative project planning, issue tracking, wiki type tool to Trac. We’ve been using Trac in the office for a few years now, i installed v0.10 about two years ago. Up until now, that’s been fine, it’s offered everything we wanted. (See http://trac.edgewall.org/)
But we’ve outgrown it, as with many things, so we’ve turned to Redmine (http://www.redmine.org/) which has many better features, such as:
- Multi-project support
- Cross project tickets
- Ticket dependancy and relations
- SVN/Wiki BLAME (puts the name of the person who edited of each line of code/wiki next to it)
- Built in LDAP auth support – with field configuration (ie configure that uid=username etc, so it will work with AD and native LDAP)
- Time management and planning – including worked hours, gantt chart and more.
- Lots of good plugins – including, graphing, costing (budgets), ticket reminder (Whiner – emails a reminder to a user if they haven’t worked on an assigned ticket in a set period), code review (annotation) and more
So that’s Redmine, what about the installation. To evaluate the system i set up a basic ESXi 4.0 VM running CentOS 5.3. It was installed mostly from this guide http://blog.itsmine.co.uk/2009/01/22/howto-install-subversion-and-redmine-on-centos5-rhel5/
This went mostly smoothly, i skipped the steps of setting up SVN (but did this later on). It wasn’t all plain sailing though there were a few issues -
MySQL Sock
(unable to find /tmp/mysql.sock) To solve this simply edit redmine/config/database.yml to inset the new socket location. You need to edit this file anyway, but that’s covered by the install guide. Here’s the final config (username and password obscured for obvious reasons)
production: adapter: mysql database: redmine host: localhost username: ourdbuser password: ourdbpassword encoding: utf8 socket: /var/lib/mysql/mysql.sock
For our system (CentOS) the location of the MySQL socket was at /var/lib/mysql/mysql.sock.
Email configuration, is in email.yml also in the config directory
production: delivery_method: :smtp smtp_settings: address: ourmailserver.internaldomain port: 25 domain: ourdomain.co.uk # authentication: :none # user_name: daemonuser # password: daemonpassword
That’s for a mailserver which doesn’t require authentication, this will be the case for most people. If you do need it you can specify plain and secure as authentication types, as well as uncommenting those 3 lines obviously.
Trac Migration:
Simples!? Well, you’d think so. Firstly i had issues installing sqlite2 on the system alongside sqlite3 which apparently they will both work side-by side. Anyway, our new CentOS system was stuck with sqlite3, but our Trac DB is in sqlite (2) format on NetBSD. This means that i was unable to direclty import the sqlite2 database into Redmine as i couldn’t compile the sqlite2 ruby gem.
Trac as of v0.11 started using sqlite3 so provided upgrade instructions, which would have been fine on their own (see http://trac.edgewall.org/wiki/0.10/TracUpgrade) (Command
sqlite trac2.db .dump | sqlite3 trac.db
What i did here was instead redirect the dump to a file which i copied onto the new Redmine server and imported that way, using these commands
#Execute on trac v0.10 server sqlite trac.db .dump > tracdump.dmp #Execute on Redmine sqlite3 server cat tracdump.dmp | sqlite3 trac.db
Then use the trac migration instructions here http://www.redmine.org/wiki/1/RedmineMigrate
I modified the command,
#Original command rake redmine:migrate_from_trac RAILS_ENV="test"#Modified rake redmine:migrate_from_trac RAILS_ENV="production"
This imported the Trac db directly into the project, you will need to supply the location to the trac envrionment (full envrionment not just the DB so do a trac hotcopy to get a full version, but convert and overwrite the trac.db file in /tracroot/db/trac.db)
The trac backup command is
/usr/pkg/bin/trac-admin /usr/pkg/share/trac/tracproject hotcopy /root/tracbakup
That’s for NetBSD installations, on your system trac-admin is likely to be lcoated elsewhere and your trac project location will be where ever you set it up to be.
Subversion integration:
I had an issue here where it refused to load the repo properly. First of all i had created a new local repo then imported the SVN dump file from our production SVN server
#SVN Dump
svnadmin dump /path/to/reponame > /tmp/reponame.dump #SVN Createsvnadmin create /path/to/reponame#SVN Restore
svnadmin load /path/to/reponame < /tmp/repo1.dump
I then configured Apache with mod_dav_svn to act as the SVN server, secured against LDAP with the following config
<Location /svn> DAV svn SVNPath "/var/svn/repo/" AuthType Basic AuthName "Subversion repository" AuthBasicProvider ldap AuthzLDAPAuthoritative On AuthLDAPURL ldap://ldapserver.local:389/ou=People,dc=ourdomain,dc=co,dc=uk AuthLDAPBindDN cn=admin,ou=People,dc=ourdomain,dc=co,dc=uk AuthLDAPBindPassword adminpassword AuthLDAPGroupAttributeIsDN on Require ldap-group cn=Dev,ou=Groups,dc=ourdomain,dc=co,dc=uk Require group cn=Dev,ou=Groups </Location>
That config just lives in httpd.conf (or under ssl.conf if you wish) and states that the repository at /var/svn/repo is to be served as /svn via HTTP to anyone in the Dev group of LDAP (where Dev is a ListOfUniqueNames) It specifies the credentials to bind to LDAP with (admin).
That done we can configure Redmine, this is done through the UI, go to the web interface which should hopefully be running and log in with admin/admin. If you’ve imported Trac then you’ll already have a project set up in which case go to Settings > Repository. Fill out the obvious details, if you don’t allow public read-only access then you need to specify a user which at minimum can read-only.
This probably won’t work for you as the system won’t have permission to create the config directories in the default location /root/.subversion/ So follow the bottom of the Redmine CentOS install guide carefully. I also ran a command which fetched the commit history manually so that the credentials were saved and i could accept any certificates which were presented.
So that’s it more or less. A couple of small hints,
To enable cross-project ticket references go to global Administration > Settings > Issue Tracking and tick ‘Allow cross-project issue relations’. For LDAP auth go to Administration > Settings > Authentication Then at the bottom right hand corner there is a small ‘LDAP Authentication’ link Click this and then ‘New Authentication Mode’ to fill out the details.
One of the neat things about Redmine is the ability to specify which LDAP fields correspond to username, firstname, lastname and email. Which is very useful as AD stores the usename in one field wheras POSIX users are stored differently.
I hope that help’s someone, i’m going to attempt to blog more of my work IT stuff like this (nothing sensitive obviously) as i know i was googling a lot to find answers to my questions!
