Wednesday, September 24, 2014 at 9:30 PM

River4 and the local filesystem

In previous versions, River4 stored all its data in an S3 bucket.

Starting in v0.96, it can be configured to store its data in the local filesystem.

The new version is on GitHub.

How it works

There's a new environment variable called fspath.

If it's not defined, everything is exactly as before.

If it is defined, we use a local directory for storage. It's specified by fspath.

Example

I created a folder on my desktop computer, and set the environment variable with this command in the Unix shell:

export fspath=/Users/davewiner/river4data/

I created a lists sub-folder, and copied a few OPML subscription lists in the folder.

I copied river4.js into another folder and used the cd command to change to that directory, and entered:

node river4.js

The server booted up and started reading feeds.

PS: Of course I already had node.js installed, and had installed feedparser and opmlparser.

Accessing the dashboard

You can access the dashboard on the local computer with this URL, entered in a browser:

http://localhost:1337/dashboard

How it's implemented

I wrote a new set of "fs" routines that are parallel to the s3 routines, and then added a layer of abstraction. Each routine calls the s3 routine if it's set up that way and calls the fs routine if it's set up the other way.

Fairly straightforward, and it worked the first time I ran it.

I have it running on two systems, one on a Mac desktop machine, storing data in the file system, and my original system in Heroku using S3 storage. Same software, configured differently.

Pointers

A blog post, providing perspective.


Last built: Mon, Jul 20, 2015 at 10:22 AM

By Dave Winer, Wednesday, September 24, 2014 at 9:30 PM. Reallll soooon now...