- Published
- 24 March 2015
Update: I've written about this in a bit more detail in a later post.
As of about three weeks ago, I have a proper, paying job. The job itself is great - I'm doing somrthing that (for now) I find interesting, engrossing, and worthwhile, at a really great place, in a pretty neat city. I get to hang out with incredibly geeky people and learn about a whole bunch of interesting things.
One of the things I've had to get used to, though, is having a work computer. During my Ph.D. I did all my computer work on my laptop, which was a mix of great and not-so-great. I could do what I wanted on my system, install whatever I wanted, process data with whatever tools appealed to me, and write my thesis in LaTeX, much to the consternation of my advisor. However, this did mean that I had to lug my laptop everywhere I went, and when I was working at Uni I was constrained to a rather small screen and generally pretty laptop-y keyboard. In addition, it meant I had to pay for my own work-station.
Now I have my own computer at work. It's great, in a way: I don't have to bring the laptop to work, and it's all kitted out and optimised for exactly the sort of work I'm doing[1]. Plus a nice big screen is handy when you need three different windows open for your current task.
There's one big thing I miss from my OS X-only days, though, and that's the miracle of productivity that is OmniFocus. OmniFocus kept me organised throughout both my degrees, and its project-and-context system (with a few hacks) was a miracle of organisation for both personal and work projects. As soon as I arrived at my new job, I started getting information from people - things I wanted to track or do or get more information about - and I had no inbox to put them in. A list in a book worked at first, but I was soon reaching the point where I needed something a bit more heavy-duty.
I started to look around for alternatives to OmniFocus - either Windows-based programs that I could run on my workstation with whatever privileges I had, or web-apps that I could have running in a tab in Firefox. And I found that all but one lacked some feature or other. The standout app was Tracks, a self-hosted, rails-based GTD app that I remember from the halcyon days when you could consider rails an "up-and-comer".
Tracks and OmniFocus are quite alike. They're not the simplest or prettiest apps in their field, but they do GTD really well. Tracks' projects and contexts fit right into my workflow, and its dependencies[2] are a godsend, sorely missing from almost every other GTD app in the field. There's only one main flaw with Tracks: you need to host it yourself.
Hosting with Heroku
So, how to host Tracks? More importantly, how to host tracks without paying a ridiculous amount every year for a service that only I will use? The hosting service Heroku was my first thought: it's one of the first cloud platforms I heard about, and I remembered that it was generally free as long as your app was small, low-traffic, and not that database-intensive. These all describe a one-person Tracks install, so I thought I'd give it a go.
Downloading and unzipping Tracks from the website, the first thing I needed to do was set up a couple of yaml
files in the config
folder. Of note, I needed to copy over database.yml.templ
and site.yml.templ
to database.yml
and site.yml
respectively, and set the appropriate values. To start I decided on sqlite as a database, however I'll be talking about why this is a bad choice soon enough.
Once everything was set up, it was time to upload to heroku. While heroku has a number of ways you can upload your webapp, I tend to prefer the heroku toolbelt. Once this is installed, all you need to do is cd
to the right directory, initialise a git
repo, and then make a heroku app:
$ git init
$ heroku create your-appname-here
If you go to your Heroku dashboard, you'll see your new app here as well:
Now all you need to do is add, commit and push:
$ git add -A .
$ git commit -m "First commit"
$ git push heroku master
After a series of status messages from heroku (and a bit of waiting as it installs the relevant gems), the process will probably result in failure:
remote: checking for sqlite3.h... no
remote: sqlite3.h is missing. Try 'port install sqlite3 +universal',
remote: 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote: and check your shared library search path (the
remote: location where your sqlite3 shared library is located).
...
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Detected sqlite3 gem which is not supported on Heroku.
remote: ! https://devcenter.heroku.com/articles/sqlite3
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
Which is less than ideal. Undeterred, I decided to switch to Heroku's own PostgreSQL plugin.
Postgres and Heroku
Heroku apps can take any number of add-ons, some free, some paid. Heroku supplies some of its own as well, including a handy PostgreSQL plugin. Heading to the add-ons page, a search for "postgresql" turns up a grand total of 5 add-ons, including, at the top, Heroku's own:
To the right of this table we see the text:
heroku addons:add heroku-postgresql
To add the add-on to our app, we just go back into the terminal and type that in:
$ heroku addons:add heroku-postgresql
Adding heroku-postgresql on your-appname-here... done, v6 (free)
Attached as HEROKU_POSTGRESQL_TEAL_URL
Database has been created and is available
! This database is empty. If upgrading, you can transfer
! data from another database with pgbackups:restore.
Use `heroku addons:docs heroku-postgresql` to view documentation.
Which is relatively painless. Heading back to your app's page on heroku, you'll now see the PostgreSQL database sitting there, waiting for us to interact with it: