public
Description: Project Management, Collaboration and Time Tracking. Some additional features are implemented here compared to the original source.
Homepage: http://ari.github.com/clockingit/
Clone URL: git://github.com/ari/clockingit.git
Click here to lend your support to: clockingit and make a donation at www.pledgie.com !
name age message
file .boring Wed Aug 26 01:01:07 -0700 2009 adding file perm changes [brad wilson]
file .gems Tue Sep 22 03:00:26 -0700 2009 Heroku doesn't like mysql. [ari]
file .gitignore Thu Nov 05 02:04:20 -0800 2009 Merge branch 'master' of git://github.com/bradx... [ari]
file LICENSE Wed Aug 26 01:01:07 -0700 2009 adding file perm changes [brad wilson]
file README.rdoc Tue Oct 20 00:33:33 -0700 2009 Small improvements to the install process for y... [ari]
file RELEASE-NOTES Fri Nov 13 04:43:04 -0800 2009 Add release notes for recent improvements. [ari]
file Rakefile Wed Aug 26 01:01:07 -0700 2009 adding file perm changes [brad wilson]
directory app/ Sat Nov 14 20:19:44 -0800 2009 Merge branch 'master' of git://github.com/bradx... [ari]
directory config/ Fri Nov 13 04:42:48 -0800 2009 Allow any version of eventmachine to be used. T... [ari]
directory db/ Sat Nov 14 20:10:51 -0800 2009 fix bug with incoming emails failing validations [bradx3]
directory dump/ Fri Sep 04 08:32:11 -0700 2009 Use XHTML version of <br/> everywhere. [ari]
directory index/ Wed Aug 26 01:01:07 -0700 2009 adding file perm changes [brad wilson]
directory lang/ Thu Sep 10 18:13:24 -0700 2009 added coding comments for ruby1.9 compat [bradx3]
directory lib/ Sat Oct 24 21:21:09 -0700 2009 And another ferret server script. [ari]
directory log/ Wed Aug 26 01:01:07 -0700 2009 adding file perm changes [brad wilson]
directory public/ Thu Nov 12 23:25:00 -0800 2009 Merge branch 'master' of git://github.com/bradx... [ari]
directory resources/ Wed Aug 26 01:01:07 -0700 2009 adding file perm changes [brad wilson]
directory script/ Sat Oct 24 21:20:10 -0700 2009 Remove ferret startup script which hasn't been ... [ari]
file setup.rb Sat Oct 17 19:16:15 -0700 2009 Remove leftover ferret bits. [ari]
directory test/ Tue Nov 10 00:17:24 -0800 2009 hide/show columns per user working [bradx3]
directory tmp/ Mon Sep 07 22:50:08 -0700 2009 remove some unused rjs files [bradx3]
directory vendor/ Sun Nov 01 23:06:42 -0800 2009 small fix to shut up juggernaut in tests [bradx3]
README.rdoc

Installing jobsworth on your server

Step 1: Getting the source

The source is released under the MIT/X Consortium License.

The easiest way to get the source and easily update it from time to time is with git. You’ll need to install that on your machine and then run:

  git clone git://github.com/ari/clockingit.git

You will want to put the source somewhere sensible depending on your operating system. On OSX that might be ~/Sites/jobsworth and on FreeBSD /usr/local/www/jobsworth. We’ll use the FreeBSD path in these instructions.

Step 2: Prerequsites

You need to be running some type of Unix: OSX, Linux, Solaris, BSD. Windows will probably not work. You will also need a database. MySQL has been heavily tested, and some people are running postgresql.

Install the following packages:

  • ruby gems
  • ruby mysql driver (you could also choose postgresql)
  • rake
  • ImageMagick

How to install these will differ on each platform. Some possibilities:

FreeBSD

  portinstall ruby-iconv ruby18-gems ruby18-mysql rubygem-rake ImageMagick

OSX

First install the Macports system from www.macports.org. Then:

  sudo port install rb-rubygems rb-mysql rb-rake ImageMagick libxml2 libxslt

Linux, etc

Under other operating systems use your favourite package manager to ensure you have Ruby 1.8.x, rubygems, Imagemagick, Rake and the Ruby mysql driver installed. Something like:

  yum install libxml2 libxslt ImageMagick ruby

Step 3: Phusion Passenger

Install Phusion Passenger. You can instead use Mongrel, but it tends to be a little easier to set up with Phusion.

  gem install passenger
  passenger-install-apache2-module

And follow the instructions you’ll be given about how to install the relevant config for Apache httpd.

Your Apache httpd virtual host DocumentRoot should point to the public directory in the installation directory.

  <VirtualHost *:80>
    ServerName jobsworth.example.com.au
    RailsEnv production
    PassengerHighPerformance on

    DocumentRoot /usr/local/www/jobsworth/public
    CustomLog /var/log/www/myserver.example.com.au-access_log combined
    ErrorLog /var/log/www/myserver.example.com.au-access_log
  </VirtualHost>

Naturally adjust the paths to suit your own environment.

Step 4: Setup configuration and database

  cd /usr/local/www/jobsworth
  ruby setup.rb

Step 5: Ruby gems

There are a few Ruby gems which are needed for running CIT. Change directory into the top of your CIT installation, then type:

  rake gems:install

That will install the gems you need.

If you have trouble on OSX with the mysql gem (this seems to be an issue on 10.5), then try this

  sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-include=/opt/local/include/mysql5 --with-mysql-lib=/opt/local/lib/mysql5 --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config

Upgrading to a newer revision

  git checkout db/schema.rb
  git pull

Check that there aren’t any updated gems or new gems to install. If there are, just follow the instructions you will be given on screen.

  rake gems

Next, make sure the database is updated:

  rake db:migrate RAILS_ENV=production

Depending on which environment you are updating, you can change the RAIL_ENV value to "test" or "development" and the appropriate database will be updated.

Find the daemon running with

  ps ax | grep push_server

then kill the push server daemon.

Restart daemon

  cd /usr/local/www/jobsworth
  nohup ./script/push_server &
  apachectl restart

Setting up Email Integration

You need to set up your email software so that it sends all emails for a subdomain to your rails user, and set up the alias so that it runs the mailman script.

For example to configure sendmail to pass to jobsworth all emails sent to domain.com. See www.freebsd.org/doc/en/books/handbook/sendmail.html for more help on configuring sendmail on FreeBSD systems.

Add an entry to /etc/mail/local-host-names to contain your domain

  domain.com

Add an entry to /etc/mail/aliases to create an alias that will hand off emails to the mailman script

  jobsworth: "|/path/to/cit/script/runner -e production 'Mailman.receive(STDIN.read)'"

Add an entry to /etc/mail/virtusertable to redirect all emails to your domain to the above alias

  @domain.com        jobsworth

run "make; make restart" in /etc/mail