hotsh/rstat.us — pull request #612 by wilkie (2012-08-21 22:31:23+00:00)
Title: Bugfix/ssl and webfinger

Here is a fix for #530 (although it is already closed, it may occur on other self-hosted nodes) and makes progress toward resolving #387 where published urls are sane and working.

First, it updates the Gemfile to point to our fork of redfinger that has the issue where it does not validate ssl certificates fixed. I'm not sure if they are maintaining any fork of redfinger, so this will have to do. I'll try to get push rights to rubygems.

It also sets up a use_ssl flag in the Author model. When this flag is set, any urls published for this Author will be using https. For instance, in their XRD. Tests accompany this change to reflect that the xrd urls are indeed using the indicated protocol.

The use_ssl flag defaults to using the protocol used when creating the account. So, if you post a user create using https, it is assumed that https is available and will be used for that Author. Otherwise, http is used. Some self-hosted nodes may not want ssl, or require it, and this is a good way to make the default choice as good as one can hope for without the overhead of making a person choose.

Let's promote nodes with good security with minimal effort.

However, for rstat.us as an established node, a data migration will be needed to set all local Author's use_ssl to true since SSL is forced. All new Authors will get use_ssl set to true initially. All exisiting Authors will need it to be set as such:

Author.all.map{|a| a.use_ssl = true; a.save }

I didn't provide the migration as a task. I'd just have to remove it in a future pull request. And, well, screw it. It's not hard to set one field. :)

This paves the way for OStatus compliance by allowing better support for XRD publishing and viewing.