37 Miniflux

Miniflux is a lightweight RSS reader, developed by Frdric Guillot. (Who also happens to be the developer of the favorite Open Source Kanban app, Kanboard)

Miniflux Screenshot
sponsored projects

I’ve reviewed Miniflux in detail on my blog, but features (among many) that I appreciate:

  • Compatible with the Fever API, read your feeds through existing mobile and desktop clients (This is the killer feature for me. I hardly ever read RSS on my desktop, I typically read on my iPhone or iPad, using Fiery Feeds or my new squeeze, Unread)
  • Send your bookmarks to Pinboard, Wallabag, Shaarli or Instapaper (I use this to automatically pin my bookmarks for collection on my blog)
  • Feeds can be configured to download a “full” version of the content (rather than an excerpt)
  • Use the Bookmarklet to subscribe to a website directly from any browsers
Some things changedno more SQLitein favor of golangopinions

37.1 Ingredients

  1. Docker swarm cluster with persistent shared storage
  2. Traefik configured per design
  3. DNS entry pointing your Miniflux url (i.e. miniflux.example.com) to your keepalived IP

37.2 Preparation

Setup data locations

Create the location for the bind-mount of the application data, so that it’s persistent:

mkdir -p /var/data/miniflux/database-dump
mkdir -p /var/data/runtime/miniflux/database

Setup environment

Create /var/data/config/miniflux/miniflux.env something like this:

DATABASE_URL=postgres://miniflux:secret@db/miniflux?sslmode=disable
POSTGRES_USER=miniflux
POSTGRES_PASSWORD=secret

# This is necessary for the miniflux to update the db schema, even on an empt\
y DB
RUN_MIGRATIONS=1

# Uncomment this on first run, else leave it commented out after adding your \
own user account
CREATE_ADMIN=1
ADMIN_USERNAME=admin
ADMIN_PASSWORD=test1234

# For backups
PGUSER=miniflux
PGPASSWORD=secret
PGHOST=db
BACKUP_NUM_KEEP=7
BACKUP_FREQUENCY=1d

The entire application is configured using environment variables, including the initial username. Once you’ve successfully deployed once, comment out CREATE_ADMIN and the two successive lines.

Setup Docker Swarm

Create a docker swarm config file in docker-compose syntax (v3), something like this:

with my patreon patronspremixgit pulldocker stack deploy
version: '3'

services:
  miniflux:
    image: miniflux/miniflux:2.0.7
    env_file: /var/data/config/miniflux/miniflux.env
    volumes:
     - /etc/localtime:/etc/localtime:ro
    networks:
    - internal
    - traefik_public
    deploy:
      labels:
        - traefik.frontend.rule=Host:miniflux.example.com
        - traefik.port=8080
        - traefik.docker.network=traefik_public

  db:
    env_file: /var/data/config/miniflux/miniflux.env
    image: postgres:10.1
    volumes:
      - /var/data/runtime/miniflux/database:/var/lib/postgresql/data
      - /etc/localtime:/etc/localtime:ro
    networks:
      - internal

  db-backup:
    image: postgres:10.1
    env_file: /var/data/config/miniflux/miniflux.env
    volumes:
      - /var/data/miniflux/database-dump:/dump
      - /etc/localtime:/etc/localtime:ro
    entrypoint: |
      bash -c 'bash -s <<EOF
      trap "break;exit" SIGHUP SIGINT SIGTERM
      sleep 2m
      while /bin/true; do
        pg_dump -Fc > /dump/dump_\`date +%d-%m-%Y"_"%H_%M_%S\`.psql
        (ls -t /dump/dump*.psql|head -n $$BACKUP_NUM_KEEP;ls /dump/dump*.psql\
)|sort|uniq -u|xargs rm -- {}
        sleep $$BACKUP_FREQUENCY
      done
      EOF'
    networks:
    - internal

networks:
  traefik_public:
    external: true
  internal:
    driver: overlay
    ipam:
      config:
        - subnet: 172.16.22.0/24

37.3 Serving

Launch Miniflux stack

Launch the Miniflux stack by running docker stack deploy miniflux -c <path -to-docker-compose.yml>

Log into your new instance at https://YOUR-FQDN, using the credentials you setup in the environment flie. After this, change your user/password as you see fit, and comment out the CREATE_ADMIN line in the env file (if you don’t, then an additional admin will be created the next time you deploy)

37.4 Chef’s Notes

1. Find the bookmarklet under the Settings -> Integration page.