LJProxy

by Brian Enigma < brian at netninja . com > v1.1, 2009-11-31 http://netninja.com/projects/ljproxy LJProxy is a proxy between your LiveJournal groups (including friends who post protected entries) and Google Reader (or any other RSS newsreader you care to use). It is designed to be simple to install and maintain with minimum server requirements.

Download

The current version, v1.1, is available at http://netninja.com/wp-content/uploads/2009/11/LJProxy-1.1.zip

Background

I have been on LiveJournal since 2001. I have had a Permanent Account since 2005. Many of my friends have been using it for similar amounts of time. In the past few years, I have migrated my posting and reading off of LiveJournal. I do most of my blog reading through Google Reader, but still have a number of people I want to following on LiveJournal. They often post friends-only entries that are not accessible from within Google Reader. What I really want is a way to get each of my LiveJournal friend groups as a feed that contains both public and protected entries. This is what LJProxy was designed to do.

Design Goals

Prerequisites

At the time of writing, all of the above prerequisites are met with Dreamhost hosting. If you use the link http://www.dreamhost.com/r.cgi?37325 to sign up, I will get a referral reward. If you sign up for hosting on Dreamhost, the little bit of cash I get from the referral is a great incentive (which costs nothing extra to you) for me to continue development.

A Note About Sharing

Google Reader gives you all sorts of ways to share feeds and posts/articles with your friends. It has no concept of "friends locked" posts. LJProxy tries to make things clear by including the post's security in the title, so if you see it is friends-only, please do not share. When reading LiveJournal directly in a web browser, it takes a bit more effort to be an idiot -- you have to explicitly copy and paste the private text. Google makes being an inconsiderate idiot a little more easy by putting sharing functions a few clicks or keypresses away. Don't be an idiot. Your LiveJournal friends trust you with their private posts. Don't betray that trust.

Installation

First Test

Usage

Theory of Operation

There are two modes of operation within LJProxy. The first is retrieving a list of your friends and friend groups. This is what gets displayed immediately after logging in. It uses the client/server API (http://www.livejournal.com/doc/server/ljp.csp.protocol.html) to make secure requests. The second mode of operation is retrieval of RSS. This mode conforms to the following pseudocode:

Generated Files

log.txt

This is a log of the most recent set of LiveJournal requests. If you have direct access to the server running LJProxy, (and it's Linux-based) you can run "tail -f log.txt" to see it process and aggregate the feeds.

{group_name}-{passkey}.xml

This is the cache file for each group. The passkey is included in the filename so that someone can't just directly access "Default_View.xml" (or any other group name, assuming they know it).

Security

There are three places in this project where security is important: the communication between your web host and LiveJournal, the communication between your web host and Google, the filesystem on your web host. For communication between your web host and LiveJournal, the communication is as secure as we can make it. Features available through the official LJ client/server API use the challenge/response mechanism. This includes the initial login and retrieving the list of your friends and friend groups. Retrieving actual friend entries is not available through the API and instead goes through RSS fetches with Digest Authentication. Both methods hash your password so that it is never sent across the wire in plaintext. For communications between Google and your web host, you generated a private key. This private key, obviously, needs to be visible to Google's systems but does not reveal, in any way, your LiveJournal credentials. The filesystem on your web host is the last place where security comes into play. Since your LiveJournal password is stored in plaintext in the configuration file, you must be certain that -- if you are using shared hosting -- the configuration file is not visible to others. Most hosts do this automatically, but you may want to double-check this with your host.

Change Log

Version 1.1 : UI and performance enhancements: Version 1.0 : Initial release

Contact

I'm open to suggestions for improvement (especially if those suggestions come with patch files). I can answer some questions, but may not be able to answer webhost-specific questions since every web host seems to be a little different. I can be reached at the email address at the top of this document.