Siosm's blog

Some thoughts from a systemd, Rust and security aficionado

Leselys, a web based, self-hosted RSS reader not written in PHP

Update: Fix systemd units.

I must confess: I’ve almost never used Google Reader as I’ve only been using Akregator as far as I remember. I didn’t want to rely on anyone to host my feeds and I guess I needed Google to stop providing Google Reader for free to realize I could just host my own web based reader, like many will probably do from now on.

So here are the requirements:

  • Self-hosted web-based open-source application;
  • Not written in PHP/MySQL or Java for security, performance and sanity reasons;
  • KISS/Keep It Simple Stupid: only necessary features, less code means less bugs;
  • OPML import feature;
  • Keyboard navigation support.

And the winner is Leselys as there is basically no competition once you’ve removed all the PHP/MySQL based readers.

I’ve imported, fixed and built all dependencies from the AUR and made a PKGBUILD for Leselys (Available in the AUR).

The setup is really easy (using packages from the siosm-aur repository). So first, let’s create a user and a group, install Leselys, start and enable mongodb:

1
2
3
4
5
6
7
$ sudo groupadd -r leselys
$ sudo useradd -Umrs /bin/false -g leselys -G leselys -d /var/lib/leselys leselys

$ sudo pacman -S leselys-git

$ sudo systemctl start mongodb
$ sudo systemctl enable mongodb

Now we can create a basic config file, add a user and test the server:

1
2
3
4
$ sudo -u leselys bash
$ cd /var/lib/leselys
$ leselys init leselys.ini
$ leselys serve leselys.ini & leselys worker leselys.ini

And here are two systemd service units:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$ cat /etc/systemd/system/leselys-server.service
[Unit]
Description=Leselys web elegant RSS reader - Web server
After=syslog.target network.target

[Service]
Type=simple
User=leselys
Group=leselys
UMask=007
WorkingDirectory=/var/lib/leselys
ExecStart=/usr/bin/leselys serve /var/lib/leselys/leselys.ini
Restart=on-abort

[Install]
WantedBy=multi-user.target

$ cat /etc/systemd/system/leselys-worker.service
[Unit]
Description=Leselys web elegant RSS reader - Feeds update worker
After=syslog.target network.target

[Service]
Type=simple
User=leselys
Group=leselys
UMask=007
WorkingDirectory=/var/lib/leselys
ExecStart=/usr/bin/leselys worker /var/lib/leselys/leselys.ini
Restart=on-abort

[Install]
WantedBy=multi-user.target

And an nginx configuration extract to make this setup more permanent:

1
2
3
4
5
6
7
8
9
10
# Leselys config
location /leselys/ {
	rewrite  ^/leselys(.+)$ $1 break;
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_set_header X-Scheme $scheme;
	proxy_set_header X-Script-Name /leselys;
	proxy_set_header Host $http_host;
	proxy_redirect off;
	proxy_pass http://localhost:5000;
}

Comments