Created by: ston1th 2019-05-29 18:19:36
Updated by: daniel 2022-11-18 17:31:26
Visibility: Public

Overview

This article describes how to set up the simple rss reader miniflux on OpenBSD.

Installation of an OpenBSD system is described here.

After the installation, the rss reader is available on localhost and port 8080. It is recommended to setup a simple reverse proxy with let`s encrypt to reach the page from your network or dmz.

Installation

Database setup

Miniflux only works with postgresql. The second package postgresql-contrib is needed because of the HSTORE extension Miniflux uses.

pkg_add postgresql-server postgresql-contrib

Disable networking, because only the unix socket will be used.

vi /var/postgresql/data/postgresql.conf
  listen_addresses = ''

Initialize postgres.

su -l _postgresql
initdb -D /var/postgresql/data/ -U postgres --auth=md5 --pwprompt --encoding=UTF-8 --locale=en_US.UTF-8
exit

Enable and start the service.

rcctl enable postgresql
rcctl start postgresql

Setup the database.

su -l _postgresql
psql -U postgres

CREATE DATABASE miniflux;
CREATE USER miniflux WITH PASSWORD '<password>';
GRANT ALL PRIVILEGES ON DATABASE miniflux TO miniflux;
CREATE EXTENSION hstore;
\q

Miniflux

Note: Watch out if there is a newer release than 2.0.30 see here: https://github.com/miniflux/miniflux/releases

ftp -o miniflux https://github.com/miniflux/miniflux/releases/download/2.0.30/miniflux-openbsd-amd64
mv miniflux /usr/local/sbin/
chmod 755 /usr/local/sbin/miniflux

Create config file.

cat <<EOF>/etc/miniflux.conf
DATABASE_URL=user=miniflux password=<password> dbname=miniflux host=/tmp sslmode=disable
BASE_URL=https://example.com/
EOF

Create daemon user.

mkdir /var/miniflux
useradd -L daemon -d /var/miniflux -s /sbin/nologin _miniflux
chown _miniflux:_miniflux /var/miniflux

Initialize miniflux.

su -l -s /bin/ksh _miniflux
miniflux -c /etc/miniflux.conf -migrate
miniflux -c /etc/miniflux.conf -create-admin

Create the service.

cat <<'EOF'> /etc/rc.d/miniflux
#!/bin/ksh

daemon="/usr/local/sbin/miniflux"
daemon_user="_miniflux"

. /etc/rc.d/rc.subr

rc_bg=YES
rc_reload=NO

rc_cmd $1
EOF
chmod 555 /etc/rc.d/miniflux

Enable and start the service.

rcctl enable miniflux
rcctl start miniflux