+-------------------------------------------------------------------------------
| Running honk on OpenBSD
+-------------------------------------------------------------------------------

Initial configuration
=====================

honk expects to be fronted by a TLS terminating reverse proxy.
Make sure to pass the Host header for nginx(8)
	proxy_set_header Host $http_host;

Setup
=====

Please see /usr/local/share/doc/honk

honk(8)
-------

honk# doas -su _honk
honk$ umask 077; cd /var/honk && honk init
listenaddr: localhost:31337
servername: honk.example.com
honk$ touch /var/honk/savedinbox.json
honk$ exit

honk# rcctl enable honk
honk# rcctl start honk

Honk at https://honk.example.com

Customization
=============

Site CSS may be overridden by creating a views/local.css file in the
/var/honk directory. Site JS may similarly be included by creating
views/local.js. A restart is required after changes.

e.g. add this snippet to open all links in honks in new tabs.

function adjusttargets() {
        var els = document.querySelectorAll("p.content a")
        for (var i = 0; i < els.length; i++) {
                var e = els[i]
                e.target = "_blank"
        }
}
document.addEventListener('DOMContentLoaded', adjusttargets, false);

Maintenance
===========

The cleanup [days] command exists to purge old external data, by default 30
days. This removes unreferenced, unsaved posts and attachments. It does not
remove any original content.

honk# crontab -eu _honk

# crontab(5)
MAILTO=root
@daily /usr/local/bin/honk cleanup

Database Upgrade
================

If you are upgrading from a version before 0.9.7, you will need to upgrade
the database format:

Stop the old honk process.
honk# rcctl stop honk

Backup the database.
honk# doas -su _honk
honk$ umask 077; cd /var/honk && honk backup `date +backup-%F`

Perform the upgrade with the upgrade command.
honk$ honk upgrade
honk$ exit

Restart.
honk# rcctl start honk
