pzingg / cloud_hub

Elixir web server that implements both the WebSub and RssCloud APIs
https://websubhub.com
Other
0 stars 0 forks source link

cloud_hub

cloud_hub is an update notification hub server that implements two APIs that are typically used to enable near-realtime updates for subscribers of RSS and Atom feeds.

The two APIs share much in common, and are used to distribute notifications of live changes from various publishers.

RssCloud Configuration

The RssCloud API exposes two HTTP POST URLs, per the spec:

If you are a subscriber, please see the RSSCloud API docs or Dave Winer's RSS Cloud Walkthrough article for more information on the www-form-urlencoded parameters that should be sent to these URLs, and for how the hub server will request validation and send notification callbacks.

If you the publisher of an RSS 2.0 feed, you can add a \<cloud> child element to the \<channel> element in your feed, with these attributes:

See the RSS 2.0 Specification for more information about the \<cloud> element.

Then whenever you update your feed (the "resource"), send a HTTP POST request to the /rsscloud/ping URL on the cloud_hub server with one www-form-urlencoded parameter:

After the post to /rsscloud/ping, any subscribers who are subcribed to the URL will be notified via an asynchronous callback.

WebSub Hub Configuration

The WebSub Hub API exposes one HTTP POST URL, at /hub.

If you are a subscriber, please see Section 5 of the WebSub Hub specification for information on the parameters that must be sent in the POST body to the /hub URL.

If you are the publisher of an Atom feed, your feed should include at least two \<link> elements as children of the \<feed> element.

Then whenever you update your feed (the "resource"), send a HTTP POST request to the /hub URL on the cloud_hub server with two www-form-urlencoded parameters:

Admin Monitoring

The /status URL uses Phoenix LiveView to provide a dashboard of the hub's activity. At present, this is exposed publicly.

TODO

See the issues list at https://github.com/pzingg/cloud_hub/issues, and feel free to note bugs.

Development

You can setup your own development / production environment of cloud_hub as with any normal Elixir / Phoenix development.

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Acknowledgments

This repository is forked from the original WebSubHub repository by Luke Strickland. Work to extend the server to support RSSCloud, and other changes made for future compatibility with the Mastodon-compatible Akkoma Fediverse microblogging server are by Peter Zingg.

Contributing

  1. Fork it!
  2. Create your feature branch (git checkout -b feature/my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/my-new-feature)
  5. Create new Pull Request

Testing

The project includes a comprehensive test suite, so you should be encouraged to run tests as frequently as possible.

mix test

Help

If you need help with anything, please feel free to open a GitHub issue at the original WebSub Hub-only repository or at this combined WebSub Hub and RSS Cloud repository.

License

cloud_hub is licensed under the MIT License.