I recently moved my FreshRSS install from Janky NAS to my OpenBSD home server. I did this because I have limited CPU/RAM on JankyNAS and the docker image that’s available for TrueNAS uses an additional PostgreSQL container that takes up a decent amount of both. FreshRSS also supports an SQLite backend, and was readily available on OpenBSD via a package. Migrating it to the OpenBSD box seemed like less hassle than figuring out how to tweak the TrueNAS app to use the SQLite backend instead of PostgreSQL.
The migration went pretty smoothly, I installed FreshRSS on OpenBSD:
doas pkg_add freshrss
Then I followed the instructions in the package readme:
less /usr/local/share/doc/pkg-readmes/freshrss
Once I validated that FreshRSS was up and running. I needed to migrate my existing feeds, which I did by following the FreshRSS documentation.
The TL;DR is, on the old host dump the users DB:
./cli/export-sqlite-for-user.php --user <username> --filename
</path/to/db.sqlite>
Copy that to the new host, and import it:
./cli/import-sqlite-for-user.php --user <username> --filename
</path/to/db.sqlite>
Since I’m the only user, it was as simple as that.
I refreshed my browser tab, and voila, all my old feeds were there. Everything seemed to be working fine until this morning when I needed to add a new feed.
I got the following error:
cURL error 6: Could not resolve host: www.julienrouse.com
[https://www.julienrouse.com/blog/index.xml
I wasn’t sure why name resolution wasn’t working from FreshRSS, but was working from the host directly. I did a quick search for the error message + OpenBSD and that reminded me that I’ve come across this issue before.
The root cause is that OpenBSD’s httpd server runs inside a chroot.
chroot(8)
is a command that changes
the root directory that a program runs in. This means that as far as the
program is concerned, whichever directory it is chrooted into it will see
as /
so it’s unable to access any files or directories outside of that
directory.
The httpd(8)
deamon on OpenBSD is chrooted
into the /var/www
directory. In order to do DNS lookups, the curl extension in
PHP (which is what FreshRSS uses to add an RSS feed) calls gethostbyname(3)
which relies on /etc/resolv.conf
to determine it’s configuration. Since
/etc/resolv.conf
exists outside of the /var/www
chroot, PHP is unable
to see it.
The fix is to create an /etc
directory inside the /var/www
chroot(8) and
copy /etc/resolv.conf
there.
Once I did that, I got a different error:
cURL error 77: error setting certificate verify locations: CAfile:
/etc/ssl/cert.pem CApath: none [https://vincent.behar.name/index.xml]
Which was fixed in the same way as the first error, create an /ssl
directory
in the /var/www/etc/
chroot(8) and copy the missing file (cert.pem
) there.
After that, I was able to import rss feeds into FreshRSS.
Reply by Email