Setting up a RSS bot on Matrix

Originally, I was looking for a RSS reader and considered things like Tiny Tiny RSS, FreshRSS, Miniflux, etc. Then I came across maubot and its RSS bot. I figured I’ll give that a shot since I already run a Matrix homeserver. This isn’t a general how-to. I’m just documenting my experience and issues I ran into. Please refer to the actual docs.

Installing maubot

I used the Docker install. I use the Docker Compose plugin so after the initial docker run as per the docs and editing the config file, I added a service in my docker-compose.yml:

    container_name: maubot
    restart: unless-stopped
      - 29316:29316
      - /home/$USER/maubot/data/:/data

The changes I made to maubot’s config.yaml were: public_url, homeservers, and admins.

Start it with docker compose up -d.

Reverse proxy

Everything is behind a Nginx reverse proxy. Running maubot as a subdirectory on the main domain didn’t work completely. I think I’d need to add some rewrite rules to gets things routed properly. I tried it this way first since I just wanted to try it and wasn’t sure if I’d end up keeping it so I didn’t want to add a DNS record and SSL cert yet. Anyway, that’s what I ended up doing and that worked. Now I can access maubot at my subdomain and login with the admin user I set up. One thing I noticed is there is no logout button?

Installing RSS bot plugin

I uploaded the .zip file from GitHub but you can’t upload that one since everything is under an rss-master directory. You’ll need extract it and rezip it so the plugin source files are at the root.

Adding a client

This is basically a Matrix user which will serve as the bot. I used the register_new_matrix_user command on my homeserver to create the user. A mistake I made was logging in to Element with this user to get the access token. I would then logout which I think invalidates the token so I had problems adding a client in maubot. Logging into the bot user with the mbc auth command was the better option. Shell into the container with docker exec -it $CONTAINER_ID sh and login to the user to get the access token and device ID. Now I was able to add client in maubot.

Adding an instance

This is where you link the client (bot user) with the plugin (rss). This step was straightforward.

Using the bot

Invite it to a room and it should auto join. Send the message !rss to get the usage help:

Usage: !rss <subcommand> [...]

subscribe <feed URL> - Subscribe this room to a feed.

unsubscribe <feed ID> - Unsubscribe this room from a feed.

template <feed ID> <new template> - Change the notification template for a subscription in
this room

notice <feed ID> [true/false] - Set whether or not the bot should send updates as m.notice

subscriptions - List the subscriptions in the current room.

The way I’m using it is I created a private space of multiple rooms, where each room is essentially a rss feed category. The space is called RSS feeds and one of the rooms is Nitter where I’ll get Nitter (Twitter) feed updates.

/posts/images/rss_feeds_space.png /posts/images/matrix_rss_bot.png

Pretty cool so far.