Ostatus support in elgg: Revision

Ostatus is a protocol for federation of public content among sites. It comprises other four protocols, activitystreams, pshb, webfinger and salmon.

We've been working on adding support for these protocols to elgg 1.7.1 since some time, and now we have something like a workable implementation. On this page I will keep information up to date on supported features.

I'd like to hear feedback from people about the progress. Also, the ostatus people have expressed interest on talking about this with the elgg team.

Note this implementations are still untested with external services, for the moment all has been tested just among elgg instances.

Plugins

Ostatus support is developed as a number of elgg plugins. Ideally they could plug and play on elgg, but due to a couple details right now some modifications to elgg are needed to make it work.

The plugins are:

  • activitystreams (support for activitystreams serialization)
  • pshb (pubsubhubbub subscription and publishing)
  • salmon (changes flowing upstream)
  • foreign_objects (manages all remote objects that arrive to an elgg site)
  • openid_server (not really needed but we have the xrd framework based in that plugin)

Features

  • Ostatus endpoints for profiles, groups and riverdashboard.
  • Admins can subscribe endpoints from other networks.
  • Only public content gets managed by ostatus plugins.
  • Remote groups, users, blogs and threaded forums appear as native (they get recreated at subscriber site with a link to the original).
  • Remote users can join open groups
  • Remote users can comment on blogposts, or participate on the threaded forum (both by creating new threads or answering to posts)
  • Bookmarks, files, events and pages also get through with most information.

Implementation details

The implementation goes like this: activitystreams can serialize an atom view with activitystreams extra information. Then, atom updates (the entries inside a feed) can arrive either through pshb, or salmon. Pshb goes through a special hub that handles the subscription, while salmon updates go directly s2s.

 

Foreign objects get marked with foreign=true, and also get a number of extra metadata, like atom_id, which is the global identifier for objects.

Url and icon hooks provided, so the non-native remote objects can show appropriate icon and link.

For salmon, every site has an rsa key to sign updates.

Hacks

At the moment the system works by hacking the add_to_river function, to add a plugin hook. (actually two, one for foreign and one for non-foreign objects). Salmon and pshb register to this hook to make the notifications when applicable.

To provide the remote icon, we hook into tools/entity, which doesnt exist in vanilla elgg.

Obscure bug in elgg_get_entities_from_metadata when entities have no metadata at all (affects some searches on threaded forums). This has been locally fixed (or maybe just worked around?) and i dont know if it happens on elgg 1.8.

Links

examples:

unofficial lorea (production) elgg with ostatus supported:

plugins:

caedes

Sibarite developer of chaos working on the lorea project

History