At time of this post, FreshRSS is not packaged in pkgsrc. So we install it manually to test its features before starting a packaging process.

Installation

First we fetch the last release available at https://github.com/FreshRSS/FreshRSS/releases/latest/:

ftp -o FreshRSS-1.27.1.tar.gz https://github.com/FreshRSS/FreshRSS/archive/refs/tags/1.27.1.tar.gz

Then we create a directory where our HTTP server can serve the files and we extract them:

mkdir -p /srv/http/freshrss"
tar -x -f FreshRSS-1.27.1.tar.gz -C /srv/http/freshrss

PostgreSQL

We use PostgreSQL as DBMS. We need some packages to be installed:

pkgin install postgresql16-server php83-pdo_pgsql php83-mbstring

A role and a table must be created for FreshRSS:

createuser --username=pgsql
           --pwprompt <password_db> freshrss
createdb   --username=pgsql 
           --owner=freshrss freshrss

Configuration

FreshRSS

FreshRSS can be installed and configured from command line:

./cli/prepare.php
./cli/do-install.php  --default-user jdoe \
                      --base-url https://rss.triaxx.online \
                      --api-enabled \
                      --db-type pgsql \
                      --db-user freshrss \
                      --db-password <passwd_db>
./cli/create-user.php --user jdoe \
                      --password '<password_user>' \
                      --api-password '<password_api>' \
                      --email jdoe@triaxx.online

NGINX

Before publicly serving FreshRSS, it can be useful to restrict the access to the server during the configuration process:

htpasswd -c /usr/pkg/etc/httpd/.htpasswd jdoe

The corresponding NGINX configuration file snippet is:

server {
  auth_basic                   "Restricted Area";
  auth_basic_user_file         /usr/pkg/etc/httpd/.htpasswd;
  server_name                  rss.triaxx.online;

    location / {
    proxy_pass               http://localhost:9000/;
    proxy_set_header         Host $host;
    proxy_set_header         X-Forwarded-Proto https;
  }
}

Lighthttpd

The file can be served by Lighthttpd by adding this configuration file snippet:

$SERVER["socket"] == "localhost:9000" {
  $HTTP["host"]   == "rss.triaxx.online" {
    server.document-root       = "/srv/http/freshrss/FreshRSS-1.27.1/p"
    fastcgi.server += ( ".php" =>
      ((
        "socket" => "/var/run/php-fpm-freshrss.sock"
      ))
    )
  }
}

PHP-FPM

FPM can be used to interpret PHP. We need to add a dedicated configuration file that should be named php-fpm.d/freshrss.conf:

[freshrss]
listen                 = /var/run/php-fpm-freshrss.sock
pm                     = dynamic
pm.max_children        = 5
pm.max_spare_servers   = 3
pm.min_spare_servers   = 1

Finishing stage

Authentication removing

When FreshRSS works as expected, we can remove auth_basic and auth_basic_user_file from the NGINX configuration.

Towards packaging