hedgerow

Self-hosted RSS reader in Crystal and Marten

Hedgerow

Hedgerow is an RSS reader you host yourself. Several people can share one instance, each with their own feeds, folders, read state and stars. It renders its pages on the server, works without JavaScript, has a light and a dark theme, and runs on SQLite or PostgreSQL.

Light Dark
Hedgerow on a desktop, light theme Hedgerow on a desktop, dark theme
Hedgerow on a tablet, light theme Hedgerow on a tablet, dark theme
Hedgerow on a phone, light theme Hedgerow on a phone, dark theme

It isn't finished. I'm building it in stages, and docs/PLAN.md shows where it stands: this is the end of Stage 1, a complete reader for feeds. Full-text articles and an installable, offline app come next. The decisions behind it are in docs/adr/.

What you need

  • A server with Podman or Docker, including Compose (podman compose or docker compose). The commands below use Podman; with Docker, write docker where they say podman (Meridian needs Podman).
  • For HTTPS, a domain name whose DNS points at the server, and ports 80 and 443 reachable from the internet.
  • A copy of this repository on the server.

You don't need Crystal or anything else Hedgerow is built with. The image is built from the Containerfile, which compiles Hedgerow inside a build container. The first build downloads and compiles everything and takes several minutes; later builds reuse what didn't change.

There are three ways to run Hedgerow. All of them serve it over HTTPS.

Run it with Compose (recommended)

deploy/compose.yml starts three containers: Caddy, which gets a certificate for your domain and renews it, Hedgerow, and PostgreSQL. Only Caddy is reachable from outside.

In the repository, write your domain and two random secrets into deploy/.env:

(umask 077; cat > deploy/.env <<EOF
HEDGEROW_DOMAIN=rss.example.com
HEDGEROW_SECRET_KEY=$(openssl rand -hex 32)
HEDGEROW_DATABASE_PASSWORD=$(openssl rand -hex 24)
EOF
)

umask 077 makes the file readable for you only, from the moment it exists.

Keep this file. The secret key signs sessions and image links; if it changes, everyone is signed out. The database password is set when PostgreSQL starts for the first time. Compose refuses to start while any of the three is missing.

Build the image and start everything. --wait returns once Hedgerow has set up the database and answers:

podman compose -f deploy/compose.yml up -d --build --wait

Then create the first admin. It asks for the password twice:

podman compose -f deploy/compose.yml exec hedgerow /app/bin/manage create_admin you@example.com

Open https://rss.example.com and sign in.

Some things to know:

  • Rootless Podman may not bind ports below 1024. Either allow it on the host (the sysctl net.ipv4.ip_unprivileged_port_start), or set HEDGEROW_HTTP_PORT and HEDGEROW_HTTPS_PORT in deploy/.env and forward 80 and 443 to them.
  • The containers restart on their own (restart: unless-stopped). With rootless Podman they come back after a reboot only if the user's podman-restart.service is enabled and the user may run services without being logged in (loginctl enable-linger).
  • Hedgerow believes the forwarded headers (X-Forwarded-For, X-Forwarded-Proto) of Caddy only, which has the fixed address 172.28.53.10 in the Compose network 172.28.53.0/24 (HEDGEROW_TRUSTED_PROXIES). If that subnet collides with a network on your server, change both at the top of deploy/compose.yml.
  • deploy/.env can also hold the settings deploy/compose.yml passes on to Hedgerow: HEDGEROW_REGISTRATION, HEDGEROW_FETCH_INTERVAL_MINUTES, HEDGEROW_FETCH_CONCURRENCY, HEDGEROW_ALLOWED_PRIVATE_NETWORKS, HEDGEROW_KEEP_READ_DAYS, HEDGEROW_KEEP_UNREAD_DAYS, HEDGEROW_MAX_SUBSCRIPTIONS, HEDGEROW_DEFAULT_TIME_ZONE and HEDGEROW_CONTACT_URL (see Configuration). Compose runs one Hedgerow process that fetches the feeds and updates the database itself, so HEDGEROW_WORKER and HEDGEROW_MIGRATE_ON_START stay at their defaults.
  • Compose names the project hedgerow-production; its volumes are hedgerow-production_pgdata (the database) and hedgerow-production_caddy-data (the certificates). It gives Hedgerow 40 seconds to stop, so a fetch in progress can finish.

Run one container behind your own proxy

If you already run a web server or proxy with TLS (nginx, Caddy, Traefik, …), Hedgerow can be a single container with SQLite on a volume. It fetches feeds in the same process.

Build the image and keep a secret key in a file:

podman build -f Containerfile -t localhost/hedgerow:latest .
(umask 077; printf 'HEDGEROW_SECRET_KEY=%s\n' "$(openssl rand -hex 32)" > hedgerow.env)

Start it, listening on port 8000 of the server's loopback address. --stop-timeout 40 gives a fetch in progress time to finish when the container stops:

podman run -d --name hedgerow --restart unless-stopped --stop-timeout 40 \
  -p 127.0.0.1:8000:8000 -v hedgerow-data:/app/data --env-file hedgerow.env \
  -e HEDGEROW_ALLOWED_HOSTS=rss.example.com \
  -e HEDGEROW_TRUSTED_PROXIES=192.0.2.1 \
  localhost/hedgerow:latest

Wait until it has set up the database and answers ok, then create the first admin:

until curl -fs http://127.0.0.1:8000/health; do sleep 1; done
podman exec -it hedgerow /app/bin/manage create_admin you@example.com

Your proxy forwards https://rss.example.com to 127.0.0.1:8000 and must send two headers: X-Forwarded-Proto: https and X-Forwarded-For with the client's address. Caddy's reverse_proxy does both by itself.

HEDGEROW_TRUSTED_PROXIES is the address your proxy connects from, as Hedgerow sees it (an address or a range, several separated by commas). Hedgerow believes the two headers only from there; from anyone else they could be forged. If the value is wrong, every page says it needs HTTPS (/health still answers), and the log names the address to use:

podman logs hedgerow

Look for Ignoring X-Forwarded-For from <address>: not listed in HEDGEROW_TRUSTED_PROXIES, put that address into the variable, then remove and start the container again. For a proxy on the same host that connects to the published port, this is usually an address of Podman's container network, not 127.0.0.1, and it can be the same for everything that comes through that port. That is why the command above publishes the port on 127.0.0.1 only: then only programs on the server can use it.

Plain HTTP, only if you must

Without a proxy, Hedgerow refuses plain HTTP and says how to fix it. On a network you trust, for example to try it at home, you can switch that off:

podman run -d --name hedgerow -p 8000:8000 -v hedgerow-data:/app/data --env-file hedgerow.env \
  -e HEDGEROW_ALLOWED_HOSTS=localhost \
  -e HEDGEROW_INSECURE_HTTP=true \
  localhost/hedgerow:latest

Know what that means: passwords and session cookies then travel unencrypted. Anyone who can see the traffic, on the same Wi-Fi or anywhere on the way, can read them and use your session. Hedgerow logs a warning at every start while HEDGEROW_INSECURE_HTTP is set. Don't use it on a server reachable from the internet.

Run it with Meridian

Meridian deploys containers to your own servers with rootless Podman and its own Caddy. .meridian/ holds two examples: deploy.example.yml (SQLite on a volume) and deploy.postgres.example.yml (PostgreSQL as an accessory). Both run a web role and a worker role that fetches the feeds, and run the migrations in a hook before the new version starts.

Copy one to .meridian/deploy.yml (Git ignores that file), replace 192.0.2.10 and rss.example.com with your server and domain (also in the hooks), and check what Meridian will do:

cp .meridian/deploy.example.yml .meridian/deploy.yml
meridian plan

A fresh server needs Meridian's user and rootless Podman first: meridian server bootstrap --host 192.0.2.10 (see Meridian's quickstart). Meridian deploys an image it finds locally, so build it, then create the secrets, set up the server and deploy:

podman build -f Containerfile -t localhost/hedgerow:latest .
meridian secret gen HEDGEROW_SECRET_KEY
meridian setup
meridian deploy

With the PostgreSQL example, also run meridian secret gen HEDGEROW_DATABASE_PASSWORD and, before the first deploy, meridian accessory start hedgerow-postgres.

meridian exec gives the command no terminal, so a password prompt there would show what you type. Read the password on your own machine without echo and hand it over instead:

stty -echo; printf 'Password: '; read -r password; stty echo; echo
printf '%s\n' "$password" | meridian exec web -- /app/bin/manage create_admin you@example.com --password-stdin
unset password

Meridian doesn't say which addresses its Caddy connects from, so the examples look up the subnet of its network meridian-proxy on the server at every deploy and store it as the secret HEDGEROW_TRUSTED_PROXIES (see the comment in the hook). Until the first deploy has run, meridian check reports that secret as missing. Other apps Meridian runs behind the same Caddy share that network, so Hedgerow believes their forwarded headers too; run it on a server of its own if you don't trust them.

The examples give the worker 40 seconds to stop (stop_timeout: 40), so a fetch in progress can finish; the key needs a Meridian release after 0.1.0-alpha.3. On a reboot the server's own stop limit for the deploy user's services applies, and it can be shorter (systemctl show "user@$(id -u).service" -p TimeoutStopUSec). A fetch cut off then is fetched again within 5 minutes.

Accounts

The first admin can only be made with create_admin, shown above for each way. After that, registration depends on HEDGEROW_REGISTRATION:

  • invite (the default): an admin creates a link under Admin → Invitations and sends it. Each link works once and for 7 days.
  • open: anyone who reaches the site can sign up.
  • closed: nobody can.

Admins can make other users admins and delete users. Hedgerow sends no e-mail, so there is no "forgot password" link. An admin sets a new password on the server, which also signs that user out everywhere:

podman compose -f deploy/compose.yml exec hedgerow /app/bin/manage set_password you@example.com

For the single container it's podman exec -it hedgerow /app/bin/manage set_password you@example.com. With Meridian, read the password as shown above and hand it over twice (without a terminal, set_password reads it twice):

printf '%s\n%s\n' "$password" "$password" | meridian exec web -- /app/bin/manage set_password you@example.com

Every user can download their subscriptions as OPML and delete their own account under Settings. Deleting an account removes it with its folders, subscriptions, read state and stars at once; it can't be undone. The last admin can't delete their own account: make another user an admin first.

Configuration

Hedgerow reads its settings from environment variables. With Compose, put them in deploy/.env (the ones deploy/compose.yml passes on, see above); for the single container, add -e NAME=value or a line to hedgerow.env.

Variable Default Meaning
HEDGEROW_SECRET_KEY none, required Signs sessions and image links. Keep it secret and keep it the same.
HEDGEROW_ALLOWED_HOSTS none, required The host names Hedgerow answers to, separated by commas. Compose sets it from HEDGEROW_DOMAIN.
HEDGEROW_TRUSTED_PROXIES empty Addresses and ranges of the proxies in front of Hedgerow, whose X-Forwarded-For and X-Forwarded-Proto it believes. Compose and the Meridian examples set it.
HEDGEROW_INSECURE_HTTP false Serve plain HTTP (see above).
DATABASE_URL SQLite in /app/data postgres://user@host:5432/name for PostgreSQL. Compose sets it.
HEDGEROW_DATABASE_PASSWORD unset The PostgreSQL password, kept out of the URL.
HEDGEROW_REGISTRATION invite open, invite or closed.
HEDGEROW_WORKER inline inline fetches feeds in the web process; external leaves that to bin/manage worker.
HEDGEROW_MIGRATE_ON_START true Update the database when the server starts.
HEDGEROW_FETCH_INTERVAL_MINUTES 30 How often each feed is fetched.
HEDGEROW_FETCH_CONCURRENCY 4 How many feeds are fetched at once.
HEDGEROW_ALLOWED_PRIVATE_NETWORKS empty Hosts and networks on your own network that feeds may use (see below).
HEDGEROW_KEEP_READ_DAYS 60 Delete read entries after this many days without a change.
HEDGEROW_KEEP_UNREAD_DAYS 180 Delete unread entries after this many days without a change.
HEDGEROW_MAX_SUBSCRIPTIONS 1000 Feeds per user.
HEDGEROW_DEFAULT_TIME_ZONE UTC The time zone of new accounts (each user can change theirs).
HEDGEROW_CONTACT_URL unset Added to the User-Agent (see below).
ASSETS_URL unset Serve stylesheets, scripts and fonts from another host.
PORT 8000 The port Hedgerow listens on inside the container.

Only deploy/compose.yml reads these three:

Variable Default Meaning
HEDGEROW_DOMAIN none, required The domain Caddy gets a certificate for.
HEDGEROW_HTTP_PORT 80 The host port for HTTP (Caddy redirects it to HTTPS).
HEDGEROW_HTTPS_PORT 443 The host port for HTTPS.

Telling publishers who you are

Every request Hedgerow makes says Hedgerow/<version> (feed reader) in its User-Agent. If you set HEDGEROW_CONTACT_URL, the address goes in there too, so a publisher who sees your server in their logs can reach you:

HEDGEROW_CONTACT_URL=https://example.com/about

It's optional. A page about you or an e-mail link both work.

Feeds on your own network

Hedgerow fetches any URL a user gives it. On a server that is a risk: a feed URL could point at your router, at a database next to Hedgerow, or at the metadata service of your cloud provider. So Hedgerow only connects to public addresses. It checks every address a host name resolves to, connects to the address it checked, and checks again on every redirect.

If a feed lives on your own network, on a NAS or a small home server, you have to allow it. List host names and networks, separated by commas:

HEDGEROW_ALLOWED_PRIVATE_NETWORKS=nas.lan,192.168.1.0/24,fd12:3456::/48

Think before you add something. What you list is reachable for every user of the instance, from any feed they add. That includes redirects: a feed on the internet can redirect to nas.lan, and Hedgerow will follow. It also includes the full text of articles: a feed's item can link to a page on nas.lan, and Hedgerow loads that page and shows its text to the feed's subscribers. Only list what you would let anyone with an account read.

Some addresses stay blocked whatever the list says: loopback (127.0.0.0/8, ::1), link-local (169.254.0.0/16, fe80::/10), the unspecified address, and the cloud metadata addresses fd00:ec2::254 and 100.100.100.200. So Hedgerow can't read a feed from the server it runs on through localhost; use the server's address on your network and list it.

Fetching feeds

Hedgerow fetches every feed someone follows, every 30 minutes by default, four at a time, and never two requests to the same host at once. A feed that fails waits longer each time, up to a day; a feed whose server answers 410 Gone is no longer fetched until someone presses "Try again" on its settings page.

HEDGEROW_FETCH_INTERVAL_MINUTES=30
HEDGEROW_FETCH_CONCURRENCY=4

By default the web process does the fetching itself and says so in its log (Fetching due feeds every 10 s in this process). If you run more than one web process, or want fetching separate from serving pages, set HEDGEROW_WORKER=external on the web processes and run the worker as a process of its own, from the same image and with the same settings (the Meridian examples do this):

/app/bin/manage worker

One worker fetches at most 20 feeds, then waits 10 seconds. That keeps about 3,600 feeds on a 30-minute schedule, fewer when some hosts are slow. With more feeds, each one waits longer than the interval. "Fetch now" makes a feed due, and the worker fetches it in one of its next rounds.

"Never two requests to the same host at once" holds within one worker process. It does not hold across processes: during a deploy two web processes may both fetch, and so may two worker processes. A redirect can also lead to a host that another fetch is using at that moment. Full text that a reader asks for (below) is loaded by the web process, at most four pages at once and one per host, so a host may see one request from the worker and one from a reader at the same time. On SIGTERM a worker claims no new feeds and lets the fetches it started finish.

Full text

Many feeds send only a summary. For those Hedgerow loads the article's page, keeps the article and drops the rest (menus, comments, scripts). Each subscription's settings page chooses when: When the feed sends only a summary (under 1,000 characters of text; the default), Always, or Never. The page is loaded once for everyone who follows the feed. After each round of feeds the worker loads the pages that are waiting, one host at a time, for at most 30 seconds per round; opening an entry loads its page at once if it is still waiting.

Hedgerow keeps to the site's robots.txt (as Hedgerow, or *) for every page and every redirect, and stores nothing from a page behind a paywall: it shows the feed's text and says so. A page that fails is tried again after 30 and 60 minutes, then shown as "could not be loaded"; "Load full text" tries again by hand. Every entry keeps a link to the original.

How long entries stay

Once a day Hedgerow deletes what nobody needs any more: read entries after 60 days, unread entries after 180 days, counted from their last change. Starred entries stay for good. Feeds nobody follows go too.

HEDGEROW_KEEP_READ_DAYS=60
HEDGEROW_KEEP_UNREAD_DAYS=180

On SQLite the freed space goes back to the file system right away. A database created before that was switched on needs one full vacuum; it blocks writes while it runs and needs free disk space the size of the database:

podman exec hedgerow /app/bin/manage vacuum

On PostgreSQL there's nothing to do.

When a Hedgerow update changes what HTML it keeps from feeds, /app/bin/manage resanitize cleans the stored entries again.

Moving to or from another reader

Under Settings → Your data you can download your subscriptions as OPML, with your folders and the names you gave your feeds, and import an OPML file from another reader (at most 2 MB and 2,000 feeds, folders at most three levels deep). Imported feeds are fetched over the following minutes. Each user can follow up to 1,000 feeds (HEDGEROW_MAX_SUBSCRIPTIONS) and have up to 200 folders.

Backups

Back up before every upgrade, and regularly. The commands below keep the backups in a directory backups that only you can read. Each backup goes to a new file first and replaces the previous one only once it is complete, so a failed backup never destroys the last good one. Create the directory once:

(umask 077; mkdir -p backups)

Compose (PostgreSQL)

pg_dump is safe while Hedgerow runs:

podman compose -f deploy/compose.yml exec -T postgres pg_dump -U hedgerow hedgerow > backups/new.sql &&
  mv backups/new.sql backups/hedgerow.sql

To restore, stop Hedgerow, load the backup and start Hedgerow again. The backup is loaded in one transaction: if it is incomplete or anything in it fails, the database stays as it was, and the last line says so.

podman compose -f deploy/compose.yml stop hedgerow
grep -q '^-- PostgreSQL database dump complete' backups/hedgerow.sql &&
  { echo 'SET client_min_messages = warning; DROP SCHEMA public CASCADE; CREATE SCHEMA public;'; cat backups/hedgerow.sql; } |
  podman compose -f deploy/compose.yml exec -T postgres psql -U hedgerow -d hedgerow -v ON_ERROR_STOP=1 -q -o /dev/null --single-transaction ||
  echo "Nothing restored: the database is unchanged."
podman compose -f deploy/compose.yml start hedgerow

Single container (SQLite)

The database is the file hedgerow.db on the volume hedgerow-data. The image has no sqlite3, so a throwaway Alpine container does the work; it sees only the volume and the backups directory. SQLite's .backup is safe while Hedgerow runs, and the copy is checked before it replaces the previous backup:

podman run --rm -v hedgerow-data:/app/data -v "$PWD/backups":/backup:Z docker.io/library/alpine:3.22.8 sh -c '
  apk add --no-cache sqlite >/dev/null &&
  test -s /app/data/hedgerow.db &&
  sqlite3 -bail /app/data/hedgerow.db ".backup /backup/new.db" &&
  test "$(sqlite3 /backup/new.db "PRAGMA integrity_check")" = ok &&
  sqlite3 -bail /backup/new.db "SELECT COUNT(*) FROM users" >/dev/null &&
  mv /backup/new.db /backup/hedgerow.db'

To restore, stop Hedgerow, put the checked backup in place and start Hedgerow again. If the backup is damaged or empty, nothing changes, and the last line says so:

podman stop hedgerow
podman run --rm -v hedgerow-data:/app/data -v "$PWD/backups":/backup:Z docker.io/library/alpine:3.22.8 sh -c '
  apk add --no-cache sqlite >/dev/null &&
  test "$(sqlite3 /backup/hedgerow.db "PRAGMA integrity_check")" = ok &&
  sqlite3 -bail /backup/hedgerow.db "SELECT COUNT(*) FROM users" >/dev/null &&
  cp /backup/hedgerow.db /app/data/restore.db && chown 10001:10001 /app/data/restore.db &&
  rm -f /app/data/hedgerow.db-wal /app/data/hedgerow.db-shm &&
  mv /app/data/restore.db /app/data/hedgerow.db' || echo "Nothing restored: the database is unchanged."
podman start hedgerow

Meridian

Run these on the server as Meridian's user (deploy in the examples). The web container is hedgerow-blue or hedgerow-green, whichever is active, the worker is hedgerow-worker, the PostgreSQL accessory hedgerow-postgres, and each runs as a systemd user service of the same name. Before a restore, stop the web container and the worker; both write to the database:

active="hedgerow-$(cat ~/.local/state/meridian/services/hedgerow/active-color)"
systemctl --user stop "$active" hedgerow-worker

With the SQLite example the volume is hedgerow-data as well, so the backup and restore commands of the single container work unchanged on the server (without podman stop and podman start). With the PostgreSQL example, back up with:

podman exec hedgerow-postgres pg_dump -U hedgerow hedgerow > backups/new.sql &&
  mv backups/new.sql backups/hedgerow.sql

and restore with the Compose command, writing podman exec -i hedgerow-postgres psql … in place of podman compose -f deploy/compose.yml exec -T postgres psql …. Afterwards start both again:

systemctl --user start "$active" hedgerow-worker

Upgrading

Back up first. Then update your copy of the repository and rebuild; Hedgerow updates the database before the new version serves.

With Compose:

podman compose -f deploy/compose.yml up -d --build --wait

With the single container, build the image again, stop and remove the container, and start it with the same podman run command as before (the volume keeps the data):

podman build -f Containerfile -t localhost/hedgerow:latest .
podman stop hedgerow && podman rm hedgerow

With Meridian, build the image and run meridian deploy. The hook updates the database while the previous version still serves; the new version takes over only once it starts and answers.

If updating the database fails, the log names the step (podman compose -f deploy/compose.yml logs hedgerow, podman logs hedgerow, or Meridian's output). The steps before it stay done; the failed one is undone. With Meridian the previous version keeps serving; with Compose and the single container the new version doesn't start. This lists the steps and marks the ones done:

podman compose -f deploy/compose.yml run --rm hedgerow /app/bin/manage listmigrations
podman run --rm -v hedgerow-data:/app/data --env-file hedgerow.env -e HEDGEROW_ALLOWED_HOSTS=rss.example.com localhost/hedgerow:latest /app/bin/manage listmigrations
meridian exec web -- /app/bin/manage listmigrations

(the first for Compose, the second for the single container, the third with Meridian). Fix the cause and upgrade again, or go back.

Going back. Each version's database changes still work with the version before it, so you can go back one version without restoring anything: check out the previous version, then build and start it as above (with Meridian: build it and run meridian deploy). Don't use meridian rollback: the examples deploy the tag localhost/hedgerow:latest, which each build replaces, so it would start the new image again. Restore a backup only to undo changes to the data itself. Everything since that backup is then lost: new subscriptions, read state, stars, accounts.

PostgreSQL itself. deploy/compose.yml pins PostgreSQL 18 (postgres:18.3-alpine). A later 18.x only needs the new tag. A new major version can't read the data of version 18: back up with pg_dump, start the new version on a new, empty volume, restore the backup into it, and keep the old volume until you have checked the result.

What Hedgerow doesn't do

  • E-mail. No verification, no password reset by mail, no notifications. Admins reset passwords with set_password.
  • Search. You can browse by feed, folder, Today, Starred and All, but not search.
  • Sync with other apps. There is no API for mobile readers (Fever, Google Reader) yet.

Developing Hedgerow

AGENTS.md describes the local setup and the tests (bin/setup, bin/dev, bin/test-all), docs/ARCHITECTURE.md how the parts fit together. bin/smoke-container builds the image and runs it as a single container, with deploy/compose.yml, and with Compose and a separate worker; it also upgrades a database of the previous release and tests the backup and restore commands above. The Meridian examples are only checked with meridian plan.

License

Hedgerow is licensed under the GNU Affero General Public License, version 3 or later (LICENSE). If you run a modified Hedgerow for other people over a network, you have to offer them the complete source code of your version (section 13 of the license). The fonts, icons and libraries it ships with have their own licenses, listed in THIRD_PARTY_NOTICES.md.

Repository

hedgerow

Owner
Statistic
  • 1
  • 0
  • 0
  • 0
  • 10
  • about 18 hours ago
  • November 13, 2026
License

GNU Affero General Public License v3.0

Links
Synced at

Tue, 01 Dec 2026 05:28:31 GMT

Languages