View posts for January, 2009

Basic Authentication problems with Phusion Passanger (mod_rails)

Phusion Passenger aka. “mod_rails” is great! It makes Rails deployment pretty easy and time-saving. Unfortunately it has a bug in it’s current 2.0.6 version which breaks Basic Authentication. Though this bug is fixed in the unreleased 2.1 version (see here) you need to care about the problem by yourself for now. The only working solution for me was to user Rails’ Basic Authentication functionality by hacking the following into my application controller:

class ApplicationController < ActionController::Base

  before_filter :http_auth  
 
  ...

  private
 
  def http_auth
    authenticate_or_request_with_http_basic do |user_name, password|
      user_name == "JohnDoe" && password == "secret123"
    end
  end

end

At this point you can be as creative as you want with reading the user name and password form a file or database and checking hashed passwords instead of plain text. For my purposes this was just enough, so I didn’t waste any more time on it. At the end of this post be warned: Basic Authentication through Rails does only protect your application, but it does not protect the static content in your public directory.

1 Comment

Archiving Thunderbird e-mails

Looking for a smart way to archive your e-mails from Thunderbird? There are many advices like copy your “/home/(username)/.mozilla/…” directory, which (in my opinion) are not very smart. After googling quite a while, I found a very cool TB extension called SmartSave and it lives up to its name! It needed less than ten seconds to export 1900 mails with a total size of 150 MB. I like it!

Leave a Comment