Getting Things Done with Tracks

Overview

Tracks is an Open Source GTD(Getting Things Done) program. Speaking personally, I'm a huge fan of Dave Allen's book - the GTD system and way of thinking has made me far more productive and effective. More importantly I feel so much more in control - no more worrying! GTD really requires some programs to allow you to use it - Tracks has worked very well for us.

How to

In a slight change from the default install, we are going to install tracks in a subdirectory called "tracks" - i.e. you will be able to access it at http://example.com/tracks.

Initial setup

  • download tracks from http://getontracks.org/
    • the release version was broken for me a few months ago, so we used the GIT repository (TODO)
    • git clone git://github.com/bsag/tracks.git
  • create database (mysql) and grant access
    • create database tracks;
    • grant all privileges on tracks to 'tracks'@'localhost' identified by 'magicpassword';
    • ideally these permissions should be substantially tightened
  • edit config/database.yml:
    production:
      adapter: mysql
      database: tracks
      host: localhost
      username: tracks
      password: magicpassword
  • copy config/site.yml.tmpl to config/site.yml and edit:
    • salt: "....." (type something random here - it's ensures a random password)
    • time_zone: "London" (run "rake time:zones:local" to see suggested zones)
    • subdir: "/tracks"
  • edit config/environment.rb and uncomment:
        ENV['RAILS_ENV'] = 'production'
  • rake db:migrate RAILS_ENV=production
  • script/server -e production
    • now point your webbrowser at localhost:3000 and create the admin user
    • edit preferences - set admin email address, your name

Running under apache

We can't just use Apache's "ProxyPass" as Tracks passes absolute URLs back.

Even editing config/environments/production.rb and setting this only fixes some:

  • config.action_controller.asset_host = "https://example.com/tracks"
  • add to config/environments.rb:
        config.action_controller.relative_url_root = '/tracks'
  • we also need some patches (at least in February 2009):
    • patch bundle-fu.rb using the patch from here and here
    • NB: ActionController::AbstractRequest.relative_url_root should be renamed ActionController::Base.relative_url_root
  • rm ./public/stylesheets/cache/* ./public/javascripts/cache/*
    • if you don't purge the caches, the CSS will be broken (you will see FILE READ ERROR in it)

Now we setup Apache using FCGI:

  • apt-get install libapache2-mod-fcgid
  • a2enmod fcgi
  • create an apache configuration file (e.g. in /etc/apache2/conf.d):
    Alias /tracks /var/tracks/public
    <Directory /var/tracks/public>
      Options +ExecCGI +FollowSymlinks
      Order Allow,Deny
      Allow from all
      AllowOverride None
      #AllowOverride All
      RewriteEngine on
      RewriteBase /tracks
     
      #RewriteRule ^/?$ dispatch.fcgi?controller=todo&action=list [QSA]
      # Rewrite to check for Rails cached page
      RewriteRule ^([^.]+)$ $1.html [QSA]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
    </Directory>
  • restart apache so that the fcgi module is loaded
  • visit http://example.com/tracks