Comments Broken

January 20th, 2007 Well Typo has decided to solve my comment spam problem, but now it won't allow comments at all. So sorry to any non-spammers trying to comment. I'm moving to Mephisto ASAP. UPDATE: Comments are back with mephisto

You've got Spam!

January 16th, 2007

I’ve been hit with some serious blog spamming for a while now. Both comments and trackback.

After a period of time away from my blog I came back to realise that the bots had taken over my content. I first noticed when I was checking my Google Analytics and found people were coming to my blog to read about some acts i’d never even knew about let alone wrote about!!.

So I cleared up all the Trackbacks (too spammy), turned on Akismet in Typo and cleared down the rest of the comment spam.

Interesting dynamics to the spam content. Some was plain spam, some was just short news articles. Some was psesdo-spam saying “great article, really useful” which could have been a real comment but obviously wasn’t. Some just reposted other peoples comments.

Well Akismet has got rid of some of it but a lot is still coming through. Annoyingly Typo still seems to store the comment if Akismet says it is spam but sets Published to ‘No’. This means I still have to trawl through the Unpublished spam to find the ones to get rid of.

Anyway all this is forcing me to start working on a move to Mephisto. Has anyone else done this move? Any tips. Will Mephisto do better with my spam.

Live in hope ;-)

RailsDAV update, dynamic base_dir

January 13th, 2007

I’ve added a couple of features to the RailsDAV act_as_filewebdav. Dynamic base directories and absolute base directories.

act_as_filewebdav takes two parameters:

base_dir can take either a String for the base directory or a Symbol which will use a method in the controller to return the base directory to use on each request.

absolute allows for either true or false (defaults to false) to determine to use either an absolute filesystem directory or relative to the RAILS_ROOT

So a common example usecase to allow users to upload/download to their own directories after they have logged on using basic HTTP authentication.


class FileDavController < ApplicationController
  act_as_filewebdav :base_dir => :user_web_dir, :absolute => true
  before_filter :user_auth

  def user_auth
    basic_auth_required {|username, password| session[:user] = User.authenticate(username,password) }
  end

  def user_web_dir
    "/var/user/#{session[:user].username}" 
  end

end

11 comments »

New WebDAV Ruby On Rails Plugin Release

January 6th, 2007

I’ve finally had some time over the holidays to put together a new release of the RailsDAV plugin for WebDAV functionality in Rails.

It’s still really a 0.0.2 release as bugs are to be fixed and still havn’t nailed a structure for the plugin i’m happy with. But for now I have improved the structure and implemented some fixes courtesy of Albert Ramstedt. Thanks Albert.

As such the use of RailsDAV plugin has changed a bit and it won’t be backwards compatible so scan the code if you are using it.

The act_as_railsdav method is attached to ActionController and can be used by calling act_as_railsdav on a controller


 class MyDavController < ActionController::Base
    act_as_railsdav

The controller must then have a route of

map.connect 'mydav/*path_info', :controller => 'my_dav', :action => 'webdav'

It is then necessary to implement some or all of the following methods:

get_resource_for_path needs to return a WebDAVResource object such as FileWebDavResource

To add webdav authentication to your controller just use


class MyDavController < ActionController::Base
   act_as_railsdav
   before_filter :my_auth

   def my_auth()
       basic_auth_required |username, password| do
          session[:user] = User.your_authentication(username,password)
       end
   end

Additionally you can add a simple filesystem expose to a controller by:


 class FileDavController < ActionController::Base
    act_as_filewebdav :base_dir => 'public'
 end

The new version of the plugin can be donwloaded using
svn co http://svn.liverail.net/svn/plugins/railsdav
It also requires the following gems

I’m going to spend a lot more time on RailsDAV now so let me know what you want out of it!

25 comments »