Updating DokuWiki on OpenBSD
Note 1: The following may partially apply to other UN*X operating systems as well with minor adaptations.
Note 2: As a general rule, before making significant changes to your wiki, make sure you have a good backup. A simple copy (including file system permissions) of your DokuWiki root directory will suffice.
DokuWiki is available as a port on OpenBSD. So the seemingly easiest way to update is to execute:
$ doas pkg_add -u
.
There are two drawbacks though:
-
The port is not always updated to the latest version of DokuWiki.
-
At the time of writing, the port in OpenBSD 7.4 is
dokuwiki-2023.04.04p0
("Jack Jackrum") while the latest offcial release is DokuWiki 2024-02-06a "Kaos".
If you want your DokuWiki to live anywhere else than in/var/www/dokuwiki/
you are out of luck.-
This also means that running a second instance of DokuWiki on the same host is impossible without manual intervention.
You could use the upgrade Plugin. However that requires the whole DokuWiki directory tree to be writable by the web server. Personally I feel that this is a potential security issue. though not exploitable on its own.
So IMHO it makes sense to decouple the OpenBSD port from the running instance(s) of DokuWiki. You could let your DokuWiki live in e.g.
/var/www/mywiki/
or, if you use a web server other than the chroot(2)ed httpd(8),/home/my-web-user/mywiki/
.You could still install the OpenBSD port just to get all of the minimum dependencies taken care of. But you might just as well install the dependencies manually. (This would also allow you to set up a more modern version of PHP for DokuWiki instead of the default version corresponding with the particular OpenBSD release.)
So I have come up with a script to handle the updates. This script downloads the latest stable release of DokuWiki, sets the permissions (minimal required for correct operation of the wiki), updates a working DokuWiki instance and does cleanup such as deleting files that are no longer needed.
See GitHub for the actual script.
It may be a good idea to invalidate the DokuWiki caches after the upgrade. This can be accomplished simply by saving the DokuWiki configuration.
blog/updating_dokuwiki_on_openbsd.txt · Last modified: by fiwswe
-