Story 11 · Yarr
The Tab That Never Closed
“A feed you chose yourself will never be reordered by someone who wants you to stay longer.”
19 min read · by Syed Jafer K
1. Forty-One Tabs
Karthik was a second year student in Coimbatore, and he had a habit he was a little ashamed of. Every morning he opened the same blogs one after another. A Go blog, a database blog, a security researcher he admired, three engineering blogs from companies he hoped to join, a chess columnist, and a retired teacher who wrote about birds. By nine o'clock he had forty-one tabs open, and by evening he could not say which of them he had actually read.
Worse, he kept missing things. The security researcher posted a long article on a Tuesday and Karthik found it nine days later, because someone shared it on a social site. The site had decided, with no explanation, that he should see the bird teacher's post four times and the security article never.
His senior Divya, who ran the college's small lab server, saw the tabs over his shoulder in the library.
"You are polling forty-one websites with your own eyes," she said.
"What else can I do?"
"Let the websites tell you when they have something new. They already can. Almost every blog has a small file for exactly this, and there is a reader called Yarr that you can run on the lab machine. Sit down, I will show you."
2. What RSS Is, in Two Minutes
Divya started with the file, not the program, because the file is the whole idea.
Most blogs publish, next to the pages meant for people, a second page meant for programs. It is a plain text file, written in a format called RSS or Atom, that lists the blog's latest posts. Each entry has a title, a date, a link and often the text. When the blog publishes something new, the file changes. That is all.
A feed reader is a program that visits those files for you, every so often, and gathers the new entries into one list. You subscribe once. After that, new posts come to you.
| Question | Answer |
|---|---|
| Who decides what appears | You do, by choosing which feeds to subscribe to |
| In what order | Newest first, the same for everyone |
| Is there an algorithm | No |
| Does the blog need to know you exist | No, the reader just fetches a public file |
| Can I leave any time | Yes, your list of subscriptions can be exported |
| Does it work for sites that do not offer a feed | Not by itself |
She opened a blog Karthik read daily and added /feed to the end of the address. The browser showed a screen of tangled angle brackets.
"That is the feed," said Divya. "It looks ugly because it was never written for you. It was written for your reader."
Finding a feed. Many sites advertise their feed in the page header, and a good reader finds it for you when you paste the ordinary address of the site. When that fails, try the common endings such as
/feed,/rssor/atom.xml. Some sites have no feed at all, and then you are out of luck.
3. Why Yarr
There are many feed readers. Divya had tried a few before settling on this one, and she gave Karthik her reasons.
Yarr stands for yet another rss reader. The project describes it as a web-based feed aggregator, and it makes four promises that matter to someone self-hosting for the first time.
- One binary, no dependencies. You download a single file and run it. There is no web server to install beside it and no language runtime to set up.
- A small database in one file. By default Yarr keeps everything in a SQLite file. It can also use PostgreSQL, but a student does not need to.
- A web interface that adapts. It works on a desktop, a tablet and a phone, and can be added to a phone's home screen like an app.
- It is free and open source, under the MIT licence.
From the project's own feature list, here is what Karthik cared about.
| Feature | Why it mattered to him |
|---|---|
| Reads Atom, RSS, RDF and JSON feeds | Nearly every blog he followed would work |
| Full text search across all articles | He could find "that article about WAL mode" months later |
| A readability engine for local reading | Short feeds that only carry a summary can be opened as a clean article inside Yarr |
| Podcasts and video enclosures | The chess columnist posted video |
| OPML import and export | He could bring subscriptions in and take them out |
| Light, Beige, Night and System Auto themes | He read at night |
| Basic authentication and HTTPS | He wanted it reachable from his phone, but not by everyone |
| A Fever compatible API and a REST API | Third party phone apps could talk to it, and scripts too |
A word on the name. Yarr is a pirate's grunt, and the project keeps the joke. The reader itself is calm and plain.
4. The First Run, in Five Minutes
Divya wanted Karthik to see it work before he thought about servers. She did it on her own laptop.
The project publishes ready to run builds as zip files, one for each combination of system and processor. Linux, macOS and Windows are covered, in both 64 bit Intel and Arm flavours, plus 32 bit Arm on Linux. She downloaded the one for her machine, unzipped it and ran it.
unzip yarr_linux_amd64.zip
chmod +x yarr
./yarr
The exact file name depends on your system. The point is that there is one program and nothing else to install.
Yarr printed a line saying it was listening on 127.0.0.1:7070. She opened http://127.0.0.1:7070 in a browser, and an empty reader appeared with a small box to add a feed.
Two details are easy to miss and Divya made Karthik read them aloud.
127.0.0.1means this machine only. By default Yarr listens on the loopback address, so nobody else on the network can reach it. That is a sensible default for software that has no password yet.- The data is already being saved. With no options, Yarr stores its database as a file called
storage.dbin the user's configuration folder. On Linux that is~/.config/yarr/(or whereverXDG_CONFIG_HOMEpoints), on macOS it is~/Library/Application Support/yarr/, and on Windows it is under%AppData%\yarr\.
She pasted the address of the security researcher's blog into the box. Yarr found the feed on its own, and within a second the researcher's recent posts appeared in a list.
"That is the Tuesday article," said Karthik quietly. It was dated nine days earlier.
5. Bringing the Forty-One Tabs In
Karthik did not want to paste forty-one addresses by hand, and he did not have to. His browser bookmarks held most of the blogs, but a bookmark is not a subscription. The tool for bulk moves is OPML, a small file format that is just a list of feeds, and every serious reader can import and export it.
Divya's advice was to do this in two steps.
- Import first. She had an OPML file from her own reader with a few dozen good starting points, such as language blogs and release announcements. Karthik imported it from the reader's settings and kept the ones he liked.
- Add your own on top. For every tab on his long list, he pasted the address of the blog's front page and let Yarr discover the feed. A few sites had none, and he made a note of them.
Divya had one warning, and it is the most useful habit in this whole chapter.
Export your subscriptions now, and again every few months. The OPML file is your list of what you chose to follow. It is small, it works in any other reader, and it is the reason you are never stuck with a tool you have outgrown. Keep a copy somewhere that is not the reader's own machine.
When he finished, the list held thirty-three blogs. Eight of his tabs had never offered a feed. He closed those without regret, because he had never opened them twice.
6. Reading Without a Mouse
The reader's list is sorted newest first, with unread articles marked. Karthik quickly noticed what Divya had promised him, which was that nothing was hidden. There was no "you may also like". Every post from every blog he had chosen was in front of him, in order, and when he reached the bottom he was done.
"Done," he said, with some surprise. "It ends."
"That is the feature," said Divya. "A feed has an end. The tab you left open does not."
Yarr has keyboard shortcuts for moving through articles quickly, which suit a person who reads many short posts. The project says they exist, but this chapter does not list them, because the full set differs from version to version. Press the question mark key, or open the help in the reader, and your own copy will show you its list.
A few reading habits from the first fortnight.
- Use the readability view when a blog only publishes a short summary in its feed. Yarr can fetch the full article and show it cleanly inside the reader.
- Search for old articles. The search box covers everything stored, so a blog you subscribed to only last week is not much use for finding things from last year, but once the database fills, it becomes your private library.
- Switch to the night theme for late reading. The choices are Light, Beige, Night and System Auto, which follows the phone or computer setting.
- Read the podcast or video inside the page. The chess columnist's video posts played right in the reader.
7. A Home for It
A reader on a laptop is a toy. It checks feeds only when the laptop is awake, and it is reachable only from that laptop. The feeds are most valuable when the reader runs all day and collects posts while you sleep, so that your phone has them waiting in the morning.
Karthik's college had a small lab server, a Linux machine that stayed on, and Divya agreed to give him a corner of it. She set two ground rules before touching anything.
- Give Yarr its own user. It should not run as the administrator, and it should not own anything except its data folder.
- Keep the data in one known place, so that backing it up later is one command and not a search.
She prepared the folders.
sudo useradd --system --home /var/lib/yarr --create-home --shell /usr/sbin/nologin yarr
sudo mkdir -p /etc/yarr
sudo unzip yarr_linux_amd64.zip -d /tmp/yarr-install
sudo install -m 0755 /tmp/yarr-install/yarr /usr/local/bin/yarr
Then she created the file that holds the login, which brings us to the part that matters most.
8. Locking the Door Before Opening It
Yarr listens on loopback by default, and that protects a laptop. To use it from a phone, it has to listen on a real network address, and the moment it does, anybody who can reach that address can read the subscriptions and add feeds. So the password comes first.
Yarr's authentication is a single username and password, given in the form username:password. There are two ways to hand it over.
| Way | Flag | Environment variable |
|---|---|---|
| Directly on the command line | -auth |
YARR_AUTH |
| From a file | -auth-file |
YARR_AUTHFILE |
When both are given, the file wins. Divya chose the file, and the reason is practical. A password typed on the command line shows up in the process list, where any other user on the machine can read it. A file with the right permissions does not.
echo 'karthik:a-long-passphrase-not-this-one' | sudo tee /etc/yarr/auth > /dev/null
sudo chown yarr:yarr /etc/yarr/auth
sudo chmod 600 /etc/yarr/auth
Two small things about the environment variable names. A command line flag always takes precedence over its environment variable. And the file variable is spelled YARR_AUTHFILE, with no second underscore, which is an easy typo to make and a hard one to see.
Basic authentication sends the password with every request. On its own, over plain HTTP, anyone watching the network could read it. Never expose Yarr to a network you do not trust without HTTPS in front of it, which is the next two sections.
9. Running It as a Service
A program started in a terminal stops when the terminal closes. Divya wanted Yarr to start by itself when the server boots, restart if it crashes, and run as the new yarr user.
On most Linux servers that job belongs to systemd, and she wrote one small unit file.
# /etc/systemd/system/yarr.service
[Unit]
Description=Yarr feed reader
After=network-online.target
Wants=network-online.target
[Service]
User=yarr
Group=yarr
ExecStart=/usr/local/bin/yarr -addr 127.0.0.1:7070 -db /var/lib/yarr/yarr.db -auth-file /etc/yarr/auth
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Look at the three flags she chose.
-addr 127.0.0.1:7070keeps Yarr on loopback. A reverse proxy will face the world in its place, and Yarr never has to.-db /var/lib/yarr/yarr.dbputs the database in the folder she made, instead of in a hidden configuration folder that nobody remembers.-auth-file /etc/yarr/authreads the login from the protected file.
She started it and checked that it was alive.
sudo systemctl daemon-reload
sudo systemctl enable --now yarr
systemctl status yarr
curl -I http://127.0.0.1:7070
The last command answered. Yarr was running, but it still asked for the password and still could not be reached from outside, exactly as intended.
The unit file is common practice, not part of the Yarr documentation. The project describes the flags and the binary, but it does not ship a service file, so the one above is Divya's, and you may adjust it to your own distribution.
10. The Container Way
Karthik asked whether there was a tidier way, since the lab server already ran other things in Docker. There is. The project publishes an image on Docker Hub as nkanaev/yarr, and also on the GitHub container registry.
The documented way to run it is this.
docker pull nkanaev/yarr:latest
docker run -d --name yarr \
-p 7070:7070 \
-v yarr-data:/data \
nkanaev/yarr:latest \
-db /data/yarr.db -addr 0.0.0.0:7070
Notice the one change from the systemd setup. Inside a container the address must be 0.0.0.0, which means all interfaces of the container, because otherwise nothing outside the container could reach it. The volume called yarr-data is the part that keeps the database safe when the container is replaced.
If you run it this way, bind the published port to loopback and let a proxy face the world. Write -p 127.0.0.1:7070:7070 in place of -p 7070:7070, or Docker will publish the port on every interface. And you still need the password, so add -auth-file with the file mounted in, or set YARR_AUTH in the container's environment.
The docs also show a compose example that pairs Yarr with PostgreSQL, using the YARR_DB variable for the connection string. It is the right pattern for a larger setup. For one person's reading list, the SQLite file is plenty.
11. Putting a Proper Address and HTTPS in Front
Divya's lab server already ran a Caddy web server, the same tool that hands out certificates by itself, so there was almost nothing left to do. She added three lines.
reader.example.org {
reverse_proxy 127.0.0.1:7070
}
Caddy fetched a certificate, redirected plain HTTP to HTTPS and passed requests through to Yarr. From Karthik's phone, the address https://reader.example.org showed Yarr's sign-in. He logged in, then used the browser's menu to add it to the home screen, and from then on it opened like any other app.
Two other options exist, and it is worth knowing why you might want them.
- Yarr can do HTTPS itself, with
-cert-fileand-key-file. Both must be given. This suits a setup with no proxy in front. - Yarr can listen on a Unix socket instead of a port, with an address such as
-addr unix:/var/run/yarr.sock. The documentation notes it is handy when a web server like nginx or Caddy sits in front. - A sub path. If the reader must live under a path such as
/readeron a shared domain, the-baseoption sets the base path of the service URL. The project gives no example, so test it on a spare instance first.
Do not skip the password because the address feels obscure. A strange hostname is not a lock. Anything on the public internet is found by scanners within hours.
12. When a Feed Will Not Load
In the third week one of Karthik's blogs stopped updating. The reader showed an error next to it, a small warning sign. He had a quick mental list of suspects, and Divya added to it.
| What he saw | The likely reason | What to try |
|---|---|---|
| The feed shows an error, others are fine | The blog moved or changed its feed address | Open the blog in a browser, find the new feed link, update the subscription |
| It loads in a browser but not in Yarr | The site blocks automated fetches, or is very slow | Raise -client-timeout if slow, otherwise there is little to do |
| Everything fails at once | The server cannot reach the internet, or DNS is down | Test with curl from the server |
| Articles are cut short | The feed only carries a summary | Use the readability view to fetch the full article |
| The blog has no feed | The author never published one | Look for an email newsletter or accept that this blog is not for the reader |
The -client-timeout option deserves a sentence. It sets the overall time Yarr will wait when fetching a feed or a site, and the default is 30 seconds. It accepts durations such as 120s, 2m or 1m30s. Raise it when you follow something slow, such as a feed generated on demand by a small home server, and leave it alone otherwise.
Logs help when a feed is a mystery. By default Yarr writes them to the terminal, which under systemd means the journal.
journalctl -u yarr -f
You can also send them to a file with -log-file.
13. What to Back Up
Karthik asked what he would lose if the lab server died. Divya made him answer his own question.
"What did you put into Yarr that you cannot get back?"
He thought. The articles themselves lived on the blogs. The only things that were his were the list of subscriptions, which feeds he had organised and which posts he had starred or kept unread.
All of that lives in the database file, so the backup is that file. There is one thing to know about copying it. Yarr's SQLite database uses a mode called WAL, short for write-ahead log, which keeps recent changes in a second file beside the main one. Copying the main file while Yarr is busy can miss them. Two safe ways follow.
# Option 1: stop the reader for a moment and copy the file
sudo systemctl stop yarr
sudo cp /var/lib/yarr/yarr.db /var/backups/yarr-$(date +%F).db
sudo systemctl start yarr
# Option 2: ask SQLite to make a consistent copy while it runs
sudo -u yarr sqlite3 /var/lib/yarr/yarr.db ".backup '/var/lib/yarr/backup.db'"
Option 2 needs the sqlite3 tool installed. The .backup command is part of SQLite itself.
On top of the file copy, keep the OPML export from section 5. The two cover different failures. The database file restores everything exactly. The OPML file survives even if you switch to a different reader in three years.
Test a restore once. Copy the backup to your laptop, run Yarr there with
-dbpointing at it, and check that your subscriptions appear. A backup you have not opened is only a hope.
14. Keeping It Healthy
Yarr asks for very little. A small routine is enough.
- Update when a new release appears. Download the new binary, replace the old one and restart. Because the program is one file, an update is a replacement. Take a copy of the database first.
- Watch the database size now and then. Years of articles from thirty feeds take space, and a reader that never forgets will grow.
- Prune subscriptions every few months. Some blogs go quiet. Some become noise. Remove them, because the reader is only as good as what you put in it.
- Keep the password out of chat and documents. The auth file is the only secret. Treat it like one.
sudo systemctl restart yarr # after replacing the binary
systemctl status yarr # confirm it came back
15. Small Habits That Keep It Safe
- Never expose Yarr on a public address without a password and HTTPS.
- Prefer
-auth-fileover-auth, and give the file mode 600. - Run it as its own user, not as an administrator.
- Keep it on loopback and use a proxy when it must be reachable from outside.
- Export your subscriptions as OPML regularly and keep a copy elsewhere.
- Back up the database file safely, with Yarr stopped or with SQLite's backup command.
- Subscribe slowly. A reader with three hundred feeds is a new inbox with the same problem.
16. Epilogue: The Morning That Ended
A month later Karthik sat in the library with his laptop closed. His phone showed the reader, and the reader showed seven new articles from the night before.
He read the security researcher's post first. He read the bird teacher's, which was about a kingfisher on the college pond. Then he scrolled down and found he had reached the end. There was nothing more to read. Nobody had arranged for there to be.
He realised that for the first time in two years he had finished his morning reading before the first class began, and that the forty-one tabs were gone.
Divya came by with her tea.
"Nothing to see on the screen," she said, glancing at his phone.
"That is what I like about it," said Karthik. "The page ends."
"Good. Now tell me, you now have a server of your own. What happens to it if the lab loses power?"
He looked at her, and then at his phone, and opened the notes app to write the word backup.
Quick Reference Cheat-Sheet
| I want to... | Do this |
|---|---|
| Try Yarr in a minute | Unzip the release for your system and run ./yarr, then open http://127.0.0.1:7070 |
| Run it on a server | Use the zip build with a systemd unit, or the Docker image |
| Change the address | -addr or YARR_ADDR, default 127.0.0.1:7070 |
| Choose where data lives | -db or YARR_DB, a SQLite file path or a PostgreSQL connection string |
| Set a password | -auth-file (preferred) or -auth, in the form username:password |
| Serve over HTTPS | Put Caddy or nginx in front, or give -cert-file and -key-file |
| Run behind a sub path | -base |
| Wait longer for a slow feed | -client-timeout, default 30s |
| Write logs to a file | -log-file |
| Move my subscriptions in or out | OPML import and export |
| Find an old article | Use the search box |
| Back up | Copy the database with Yarr stopped, or use SQLite .backup, plus an OPML export |
Key takeaways
- A feed is a plain file a blog publishes for programs, and a feed reader gathers all of them into one list that you control.
- Yarr is one binary with one database file, so installing it, moving it and backing it up are all simple.
- By default it listens only on
127.0.0.1. Opening it to the network is a deliberate step, and the password comes first. - Prefer
-auth-fileto-auth, because a password on the command line is visible to other users. - Put a reverse proxy with HTTPS in front when Yarr must be reachable from a phone away from home.
- OPML is your exit door. Export it regularly and you can never be locked in.
- The database uses WAL mode, so back it up with Yarr stopped or with SQLite's own backup command.
Self-hosting is not always about running something grand. Sometimes it is a small program that checks thirty websites for you every morning, and then tells you, honestly, that you are done.