Skip to content

About

Docker fork of Commafeed. Added security and public use options .

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

MadnessFeed

Based on CommaFeed https://github.com/Athou/commafeed

Disclaimer:

While guided and checked, AI is responsible for half of the coding. Development is also 100% for own personal use. If you want personal changes, please fork or copy it for your own use/development.


Additional features compared to original (Might not be fully up-to-date)

  • Option for multiple read-only public pages, each with its own address, name and selection of categories, which can be used to share different RSS feed dashboards
  • Option for MFA (TOTP or passkey) added to the login (with option to reset it)
  • Additional security including the option to restrict access to the login page to specific subnets while still allowing the public pages to be reached
  • Reduced memory usage
  • And more...

A self-hosted RSS reader with a clean, distraction-free interface. Follow your feeds from any device, share read-only selections of them on one or more public pages, and keep your account locked down with two-factor authentication.

MadnessFeed

Highlights

Reading

  • Four layouts (title only, compact, detailed, expanded), light and dark themes and a configurable accent color
  • Works equally well on a phone and on a big screen
  • Keyboard shortcuts for nearly everything
  • Categories and subcategories, tags, starred articles and full-text search
  • Rules that automatically mark articles as read
  • Push notifications (ntfy, Gotify, Pushover) when new articles are published
  • Right-to-left feeds, and an interface translated into 25+ languages
  • OPML import and export
  • Your own CSS and JavaScript to customize the interface

Sharing

  • Optional public pages: read-only views of the categories you choose, which anyone can open without an account. You can create as many as you like, each with its own address, name and selection of categories (see Public pages)

Security

  • Two-factor authentication with an authenticator app and/or passkeys, with a recovery path that only the server administrator can use (see Two-factor authentication)
  • Network restriction: allow the application and login page only from your own networks, while the public pages stay reachable from anywhere (see Restricting access to your networks)
  • A Docker image that runs as any user, never as root, and works with --cap-drop=ALL
  • Protection against server-side request forgery when fetching feeds

Apps and integrations

  • Fever and Google Reader compatible APIs, supported by many iOS and Android RSS apps
  • A REST API, documented at /openapi on your instance

Under the hood

  • Compiled to a native executable: starts in under a second and runs comfortably in 256 MB
  • Handles thousands of users and millions of feeds
  • Embedded database by default, or PostgreSQL, MySQL or MariaDB

Quick start

Docker

docker run --name madnessfeed --detach --publish 8082:8082 --restart unless-stopped \
    --volume /path/to/madnessfeed/data:/madnessfeed/data \
    --env PUID=99 --env PGID=100 \
    --memory 256M ghcr.io/gittimeraider/madnessfeed:latest

Open http://localhost:8082/. The first visit asks you to create the administrator account.

PUID/PGID are the user and group the application runs as. Set them to the owner of your data directory (99:100 on unRAID, or the output of id on a regular Linux host).

docker-compose

services:
  madnessfeed:
    image: ghcr.io/gittimeraider/madnessfeed:latest
    restart: unless-stopped
    environment:
      - PUID=99
      - PGID=100
    volumes:
      - ./data:/madnessfeed/data
    deploy:
      resources:
        limits:
          memory: 256M
    ports:
      - 8082:8082

The Docker image guide covers image tags, running with --user and --cap-drop=ALL, and unRAID setup.

Everything MadnessFeed stores (accounts, feeds, articles, two-factor settings, passkeys) lives in the database. With the default embedded database, that's the /madnessfeed/data volume: keep it and nothing is lost when you update or recreate the container.

Configuration

MadnessFeed runs without any configuration. Every setting is optional and can be given in any of these ways:

  • environment variables, in UPPER_SNAKE_CASE: madnessfeed.allowed-networks becomes MADNESSFEED_ALLOWED_NETWORKS (this is the usual way with Docker)
  • a config/application.properties file in the working directory
  • a .env file in the working directory
  • command line arguments, like -Dmadnessfeed.allowed-networks=192.168.1.0/24

The properties file has one advantage: MadnessFeed warns about unknown keys and typos in it.

All MadnessFeed settings, with their defaults and descriptions, are listed in documentation/application.properties. The underlying framework settings (prefixed with quarkus.) are described in the Quarkus configuration reference.

Settings you'll probably want

Environment variable Purpose
QUARKUS_HTTP_AUTH_SESSION_ENCRYPTION_KEY Secret used to encrypt the login cookie, at least 16 characters. Without it, a random key is generated at each start and everyone has to log in again after a restart.
MADNESSFEED_ALLOWED_NETWORKS Networks allowed to use the application and the login page. See Restricting access.
MADNESSFEED_PASSKEY_ALLOWED_FRAME_ORIGINS Dashboards (e.g. Organizr) allowed to show MadnessFeed in an iframe when using a passkey. See Passkeys inside a dashboard.
QUARKUS_HTTP_AUTH_FORM_COOKIE_SAME_SITE Set to none to stay logged in when MadnessFeed is shown in an iframe of a dashboard on another domain or IP address (e.g. Homarr). See Showing MadnessFeed inside a dashboard.
MADNESSFEED_USERS_ALLOW_REGISTRATIONS Whether visitors can create their own account (false by default).
MADNESSFEED_HTTP_CLIENT_BLOCK_LOCAL_ADDRESSES Set to false to follow feeds hosted on your local network. See the FAQ.
MADNESSFEED_FEED_REFRESH_INTERVAL Shortest time between two refreshes of a feed (5m by default). See How often feeds are refreshed.
MADNESSFEED_FEED_REFRESH_MAX_INTERVAL Longest time between two refreshes of a feed (4h by default).
MADNESSFEED_FEED_REFRESH_INTERVAL_EMPIRICAL Set to false to refresh every feed at exactly MADNESSFEED_FEED_REFRESH_INTERVAL instead of adapting to how often it posts.
MADNESSFEED_ROBOTS_TXT_FILE Path to your own robots.txt file. See Customizing robots.txt.
MADNESSFEED_SECURITY_TXT_FILE Path to a security.txt file, telling security researchers how to report vulnerabilities. See security.txt.

How often feeds are refreshed

By default, each feed is refreshed somewhere between 5 minutes and 4 hours after the previous refresh: feeds that post often are checked often, feeds that rarely post are checked rarely. The bounds are MADNESSFEED_FEED_REFRESH_INTERVAL and MADNESSFEED_FEED_REFRESH_MAX_INTERVAL, written as durations such as 30s, 15m or 2h. To refresh every feed at a fixed interval, for example every 15 minutes:

--env MADNESSFEED_FEED_REFRESH_INTERVAL=15m \
--env MADNESSFEED_FEED_REFRESH_INTERVAL_EMPIRICAL=false

A feed can still be refreshed less often when it asks for it (Cache-Control or Retry-After headers) or keeps failing. The Fetch all my feeds now action refreshes everything immediately.

Customizing robots.txt

By default, MadnessFeed serves a /robots.txt that asks every search engine and crawler to stay away:

User-agent: *
Disallow: /

To serve your own, use one of these (the first one that is set wins):

  1. A file (easiest to edit): put a robots.txt in your data directory, e.g. /path/to/madnessfeed/data/robots.txt on the host, and point MadnessFeed to it:

    --env MADNESSFEED_ROBOTS_TXT_FILE=/madnessfeed/data/robots.txt

    The file is read on every request, so edits apply immediately, without a restart. If it can't be read, MadnessFeed logs a warning and falls back to the next option.

  2. The content itself, with \n between lines:

    --env 'MADNESSFEED_ROBOTS_TXT=User-agent: *\nDisallow: /\nAllow: /public/'

    In docker-compose, quote the value with single quotes so the \n is kept as is.

  3. Nothing: the default above. Set MADNESSFEED_HIDE_FROM_WEB_CRAWLERS=false to serve no robots.txt at all.

/robots.txt is always reachable, even from networks excluded by MADNESSFEED_ALLOWED_NETWORKS.

security.txt

A security.txt (RFC 9116) tells security researchers how to report vulnerabilities to you. MadnessFeed serves none by default. To serve one at /.well-known/security.txt, use one of these (the first one that is set wins):

  1. A file: put a security.txt in your data directory, e.g. /path/to/madnessfeed/data/security.txt on the host:

    Contact: mailto:security@example.com
    Expires: 2027-12-31T23:00:00.000Z
    Preferred-Languages: en
    

    and point MadnessFeed to it:

    --env MADNESSFEED_SECURITY_TXT_FILE=/madnessfeed/data/security.txt

    The file is read on every request, so edits apply immediately, without a restart.

  2. The content itself, with \n between lines:

    --env 'MADNESSFEED_SECURITY_TXT=Contact: mailto:security@example.com\nExpires: 2027-12-31T23:00:00.000Z'

Contact and Expires are required by the standard. Keep Expires less than a year in the future and update it before it passes. /.well-known/security.txt is always reachable, even from networks excluded by MADNESSFEED_ALLOWED_NETWORKS.

Using another database

The Docker image uses the embedded H2 database. For PostgreSQL, MySQL or MariaDB, build from source with the matching profile and set:

  • quarkus.datasource.jdbc.url, for example:
    • PostgreSQL: jdbc:postgresql://localhost:5432/madnessfeed
    • MySQL: jdbc:mysql://localhost/madnessfeed?autoReconnect=true&failOverReadOnly=false&maxReconnects=20&rewriteBatchedStatements=true&timezone=UTC
    • MariaDB: jdbc:mariadb://localhost/madnessfeed?autoReconnect=true&failOverReadOnly=false&maxReconnects=20&rewriteBatchedStatements=true&timezone=UTC
  • quarkus.datasource.username
  • quarkus.datasource.password

Security

Basics

  • MadnessFeed speaks plain HTTP on port 8082. If you use it outside your home network, put it behind a reverse proxy that provides HTTPS (Nginx Proxy Manager, Caddy, Traefik, SWAG, ...) rather than publishing the port to the internet.
  • Set QUARKUS_HTTP_AUTH_SESSION_ENCRYPTION_KEY to a long random secret. Anyone who knows it can forge login cookies.
  • Turn on two-factor authentication for your account.
  • Consider restricting access to your networks.
  • Run the container as a non-root user (PUID/PGID or --user). The image refuses 0 (root) for PUID/PGID.

Two-factor authentication

Each user can add a second step to their login in Settings → Security:

  • Authenticator app: scan the QR code with Aegis, 2FAS, Google Authenticator, Microsoft Authenticator, 1Password, Bitwarden or any other TOTP app, then confirm with the 6-digit code it shows.
  • Passkeys: your phone, your computer's fingerprint reader, face recognition or PIN, or a hardware security key. Passkeys need HTTPS (or http://localhost), and each one only works on the web address it was added from. If you move MadnessFeed to another domain, add your passkeys again.

Either one is enough to log in. Once two-factor authentication is on for an account:

  • the login page asks for a code or a passkey after the password
  • logging in with only a user name and password through HTTP basic authentication is refused
  • after 10 wrong codes, the second step is locked for 15 minutes
  • the account's API key (used by mobile apps and by ?apiKey= links) keeps working without a second step. Treat it like a password, and generate a new one in Settings → Profile if it leaks.

Lost your phone or passkey? On the login page, enter your user name and password, click Lost access to your authenticator?, then Write a reset code in the server logs. MadnessFeed writes a single-use code to its log, valid for 15 minutes. It is never shown in the browser, so only someone with access to the server can read it:

docker logs <container-name> 2>&1 | grep "Reset code"

On unRAID: Docker tab → click the MadnessFeed icon → Logs. Entering the code on the login page turns two-factor authentication off for that account and logs you in, so you can set it up again.

Showing MadnessFeed inside a dashboard (Homarr, Organizr, ...)

By default the login cookie is only sent when the page around MadnessFeed is on the same site. If MadnessFeed is at https://news.example.com, it works inside an iframe on https://example.com or https://dash.example.com, but inside a dashboard on another domain or on an IP address like http://192.168.1.10:7575, the browser drops the cookie: the login (including the two-factor step) succeeds and you land right back on the login page.

To allow it:

  1. Serve MadnessFeed over HTTPS. Browsers only send cookies into another site's iframe when they are marked Secure, and MadnessFeed only marks them so when it knows the request came over HTTPS. Behind a reverse proxy, that needs the three QUARKUS_HTTP_PROXY_* settings shown under Restricting access to your networks, and the proxy must send X-Forwarded-Proto: https (Nginx Proxy Manager, Caddy, Traefik and SWAG do by default).

  2. Add this environment variable to the MadnessFeed container and recreate it:

    --env QUARKUS_HTTP_AUTH_FORM_COOKIE_SAME_SITE=none
  3. Log out and log in again inside the dashboard, so the browser receives the new cookie.

Things to know:

  • This makes the browser send your login cookie to MadnessFeed from any site, so a malicious page you visit could make your browser send requests to MadnessFeed while you are logged in. Only turn it on if you need it, and combine it with restricting access to your networks.
  • Safari, Brave and private/incognito windows block cookies in other sites' iframes entirely, whatever the setting. Chrome, Edge and Firefox accept them unless you turned on "Block third-party cookies".
  • For passkeys inside the dashboard, also follow Passkeys inside a dashboard.

Passkeys inside a dashboard (Organizr, ...)

Browsers mark a passkey used inside an iframe of another web address, and MadnessFeed refuses it by default so that another site can't trick you into logging in through a hidden frame. To use passkeys while MadnessFeed is shown inside a dashboard:

  1. Tell MadnessFeed which dashboard to trust, as a comma-separated list of addresses (scheme, host and port only, no path):

    --env MADNESSFEED_PASSKEY_ALLOWED_FRAME_ORIGINS=https://dashboard.example.com
  2. Allow passkeys in the dashboard's iframe: it needs allow="publickey-credentials-get; publickey-credentials-create". Organizr doesn't offer these in Settings → Customize → Tabs → iFrame Allow, but it copies the stored value as is into the iframe, so you can add them to its configuration file. On the Docker host, find the file and the current value:

    docker exec <organizr-container> sh -c 'grep -rl "iframeAllow" /config --include=config.php'
    docker exec <organizr-container> sh -c 'grep "iframeAllow" <file found above>'

    Then edit that line (in the mapped config folder on the host, or with docker exec -it <organizr-container> vi <file>) and append ,publickey-credentials-get,publickey-credentials-create inside the quotes, e.g. 'iframeAllow' => 'clipboard-read,clipboard-write,publickey-credentials-get,publickey-credentials-create',. Reload Organizr in the browser. Saving the iFrame Allow setting again in Organizr's UI may drop the extra values.

A rejected passkey is written to the MadnessFeed log (passkey verification failed ...) with the reason.

Restricting access to your networks

Set MADNESSFEED_ALLOWED_NETWORKS to the networks that may use MadnessFeed, as a comma-separated list of CIDR ranges or single addresses (IPv4 and IPv6):

--env MADNESSFEED_ALLOWED_NETWORKS=192.168.1.0/24,10.8.0.0/24

Visitors from those networks (and from the server itself) use MadnessFeed normally. Everyone else can only open public pages. They get a "Not available from your network" page instead of the login page, and the server refuses every other request: logging in, the API, the mobile app APIs and live updates. Leave the variable unset to allow all networks, which is the default.

Behind a reverse proxy, MadnessFeed sees every request as coming from the proxy. Tell it to use the client address the proxy forwards, and which proxy to trust for that:

--env QUARKUS_HTTP_PROXY_PROXY_ADDRESS_FORWARDING=true \
--env QUARKUS_HTTP_PROXY_ALLOW_X_FORWARDED=true \
--env QUARKUS_HTTP_PROXY_TRUSTED_PROXIES=172.18.0.5

Replace 172.18.0.5 with the address of your reverse proxy as MadnessFeed sees it (a single address, a CIDR range or a host name). Don't leave QUARKUS_HTTP_PROXY_TRUSTED_PROXIES out: without it, anyone can claim to be on your network by sending a fake X-Forwarded-For header. MadnessFeed logs a warning at startup if this happens. Make sure the proxy sets X-Forwarded-For (most do by default) and that MadnessFeed's port can't be reached directly, without going through the proxy.

Checking which address MadnessFeed sees. Docker's networking sometimes replaces the client address with the address of the Docker network's gateway (e.g. 172.17.0.1). Never allow a Docker network range such as 172.16.0.0/12 in MADNESSFEED_ALLOWED_NETWORKS: in that situation, it would allow every visitor. To see the addresses MadnessFeed sees, enable logging of refused requests with QUARKUS_LOG_CATEGORY__COM_MADNESSFEED_SECURITY_NETWORK__LEVEL=DEBUG, open MadnessFeed and look for refused ... from <address> in the logs.

Feeds on your local network

To protect your network, MadnessFeed refuses to fetch feeds from local addresses (see the FAQ).

Public pages

A public page shows the categories you choose to anyone, without an account. Visitors can only read: they can't see your other categories, settings or reading activity, and they can't change anything.

You can create as many public pages as you like, for example one for tech news and one for your hobbies. Each page has its own address, its own name, its own selection of categories and its own on/off switch, so you can share different categories with different people, or turn one page off without affecting the others. A category can be shown on several pages at once.

All pages are managed in Settings → Public page, which lists every page with an Enabled/Disabled badge. Click a page to open its settings.

To create a page:

  1. Go to Settings → Public page and click Add public page. To change an existing page, click it in the list instead.
  2. Optionally give the page a Name. It's shown next to "MadnessFeed" at the top of the page and in the browser tab.
  3. Turn on Enable public page.
  4. Tick the categories and subcategories to share. Each one is selected on its own; ticking a category doesn't include its subcategories. Feeds without a category can be shared too.
  5. Click Save, then copy the address shown.

Repeat these steps for every page you want. Each page gets its own address.

Each address contains a random code instead of your user name. Click Generate new address on a page at any time to replace that page's address: its old address stops working immediately, the addresses of your other pages don't change. Delete removes a page and its address.

If you used the public page before multiple pages were supported, it's moved to the list automatically on upgrade, with the same address and categories, and shows up as "Unnamed public page" until you give it a name.

Public pages stay reachable from every network, even when access is restricted to your networks.

Mobile apps

MadnessFeed works with mobile apps that support the Fever or Google Reader API (the latter is often listed as "FreshRSS" or "Google Reader API" in apps).

  1. Open Settings → Profile and generate an API key if you don't have one yet.
  2. Copy the Fever API URL or the Google Reader API URL link from the same page into your app.
  3. Log in from the app with your user name and the API key as the password.

Updating

A new image is published for every change to the repository. To update, pull ghcr.io/gittimeraider/madnessfeed:latest and recreate the container. On unRAID: Docker tab → Check for Updates → Apply Update. Database changes are applied automatically at startup.

latest always follows the main branch. To update only when you decide to, use a tag pinned to one version, like master-a1b2c3d. Available tags are listed under Packages → madnessfeed on the repository's GitHub page.

Building from source

./mvnw clean package [-P<database> [-Pnative]] [-DskipTests]
  • <database> is h2 (default), postgresql, mysql or mariadb.
  • -Pnative builds a native executable. It needs GraalVM (GRAALVM_HOME pointing to it), or Docker/Podman to build inside a container.
  • -DskipTests skips the tests for a faster build.

The result is in madnessfeed-server/target/:

  • madnessfeed-<version>-<database>-jvm.zip: extract it and run java -jar quarkus-run.jar (Java 25)
  • madnessfeed-<version>-<database>-<platform>-<arch>-runner: the native executable, if you used -Pnative

The native executable is recommended: it starts faster and uses less memory.

Memory usage

The native build runs well within 256 MB. You can cap its memory with -Xmx, e.g. ./madnessfeed-runner -Xmx256m.

With the Java build, -Xmx256m caps the memory too. To make Java give unused memory back to the system, add:

-Xms20m -XX:+UseG1GC -XX:+UseStringDeduplication -XX:-ShrinkHeapInSteps -XX:G1PeriodicGCInterval=10000 -XX:-G1PeriodicGCInvokesConcurrent -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10

FAQ

Getting "Access to local address blocked" when adding a feed

MadnessFeed refuses to fetch feeds from local and private addresses, so that users can't use it to reach other services on your network (server-side request forgery). If you need feeds from your local network, set MADNESSFEED_HTTP_CLIENT_BLOCK_LOCAL_ADDRESSES=false, but only if you trust every user of your instance.

I have to log in again after every restart

Set QUARKUS_HTTP_AUTH_SESSION_ENCRYPTION_KEY to a fixed secret of at least 16 characters.

Passkeys don't work

Passkeys need a secure connection: open MadnessFeed over HTTPS (through your reverse proxy), or on http://localhost. A passkey only works on the exact web address it was added from.

Listening on a single network interface

MadnessFeed listens on all interfaces. To limit it, set quarkus.http.host. When you set it to a local address like 127.0.0.1, host validation turns on automatically, which blocks requests coming through a reverse proxy. Allow your public host name to fix it:

quarkus.http.host=127.0.0.1
quarkus.http.proxy.proxy-address-forwarding=true
quarkus.http.proxy.allow-forwarded=true
quarkus.http.host-validation.allowed-hosts=rss.example.com

Translations

Translations are in madnessfeed-client/src/locales. To add a language:

  1. Add its two-letter ISO 639-1 code to the locales list in madnessfeed-client/.linguirc and madnessfeed-client/src/i18n.ts.
  2. Run npm run i18n:extract in madnessfeed-client.
  3. Translate the new madnessfeed-client/src/locales/<code>/messages.po file.

Development

The project has two parts: a Java backend (Quarkus) in madnessfeed-server and a React/TypeScript frontend in madnessfeed-client.

Backend: open madnessfeed-server in a Java IDE with the Lombok plugin, then run ./mvnw quarkus:dev.

Frontend: in madnessfeed-client, run npm install, then npm run dev.

The development server runs on http://localhost:8082 and forwards API requests to the backend on port 8083.

Before sending changes, run the checks that CI runs:

  • ./mvnw -pl madnessfeed-server spotless:apply verify for the backend (formatting, checkstyle, tests)
  • npm run lint and npm run test in madnessfeed-client for the frontend

CI and images

The ci workflow runs:

  • on every push, to any branch: builds the native executable and publishes the Docker image as <branch> and <branch>-<short-sha>, plus latest for master. Pushes that only change .md files are skipped.
  • on pull requests: runs the unit tests and builds the image, without publishing it.

To publish a fresh image without changing anything, for example to pick up updated base image packages, open the Actions tab, choose Rebuild Docker image, click Run workflow and pick a branch.

Each push leaves images in the registry. To clean them up, open Packages → madnessfeed on the repository's GitHub page and delete the versions you no longer need. Don't delete the one tagged latest or one your server is pinned to.

Dependencies are checked weekly by Dependabot.

License

Apache License 2.0

About

Docker fork of Commafeed. Added security and public use options .

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

Used by

Contributors

Languages