honk/docs/honk.8

215 lines
5.6 KiB
Groff
Raw Normal View History

.\"
.\" Copyright (c) 2019 Ted Unangst
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate$
.Dt HONK 8
.Os
.Sh NAME
.Nm honk
.Nd honk administration
.Sh DESCRIPTION
The
.Nm
daemon processes messages from other federated servers.
This is the admin manual.
For user operation, see
.Xr honk 1 .
.Ss SETUP
.Pp
Set up a TLS reverse proxy.
.Nm
can listen on TCP or unix sockets, but will not terminate TLS.
https is a required component for federation.
.Pp
Make sure to pass the Host header, if necessary (as for nginx).
.Bd -literal -offset indent
proxy_set_header Host $http_host;
.Ed
2019-10-12 17:19:43 +02:00
.Ss BUILD
2019-10-12 17:16:16 +02:00
Building
.Nm
requires a go compiler and libsqlite.
On
.Ox
this is the go and sqlite3 packages.
Other platforms may require additional development libraries or headers
to be installed.
Run make.
Please be patient.
Even on fast machines, building from source can take several seconds.
.Ss OPTIONS
The following options control where
.Nm
looks for data.
.Bl -tag -width datadirx
.It Fl datadir
The root data directory, where the database and other user data are stored.
Requires write access.
Defaults to ".".
.It Fl viewdir
The root view directory, where html and other templates are stored.
Read only.
Defaults to ".".
.El
.Ss INIT
Run the
.Ic init
command.
This will create the database and ask four questions, as well as creating
the initial user.
2019-11-13 01:00:00 +01:00
See below about importing existing data.
.Ss OPERATION
Run honk.
Log messages are sent to stderr and should probably be redirected to a file.
2019-10-12 17:02:01 +02:00
.Ss CUSTOMIZATION
Add custom memes (stickers) to the
.Pa memes
data directory.
2019-10-12 17:02:01 +02:00
Image and video files are supported.
.Pp
Add custom emus (emoji) to the
.Pa emus
data directory.
2019-10-12 17:02:01 +02:00
Image files are supported.
.Pp
Site CSS may be overridden by creating a
.Pa views/local.css
file in the data directory.
2019-10-21 02:11:15 +02:00
A restart is required after changes.
2019-10-12 17:02:01 +02:00
.Pp
Custom HTML messages may be added to select pages by using the
.Ic admin
command.
2019-10-21 02:11:15 +02:00
A restart is required after changes.
.Bl -tag -width tenletters
.It server
Displayed on the home page.
.It about
Displayed on the about page.
.It login
Displayed about the login form.
.El
2019-10-12 17:02:01 +02:00
.Pp
.Ss USER ADMIN
2019-10-12 17:02:01 +02:00
New users can be added with the
.Ic adduser
command.
This is discouraged.
2019-10-13 01:21:29 +02:00
.Pp
Passwords may be reset with the
2019-11-06 19:26:35 +01:00
.Ic chpass Ar username
2019-10-13 01:21:29 +02:00
command.
.Ss MAINTENANCE
The database may grow large over time.
The
2019-11-06 19:26:35 +01:00
.Ic cleanup Op Ar days
command exists to purge old data, by default 30 days.
2019-11-01 06:36:07 +01:00
This removes unreferenced, unsaved posts and attachments.
It does not remove any original content.
.Ss UPGRADE
Stop the old honk process.
Backup the database.
Perform the upgrade with the
.Ic upgrade
command.
Restart.
2019-10-12 17:02:01 +02:00
.Pp
There's also a
.Pa blob.db
file which is important to backup and restore.
.Pp
The current version of the honk binary may be printed with the
.Ic version
command.
.Ss SECURITY
2019-10-20 04:59:28 +02:00
.Nm
is not currently hardened against SSRF, server side request forgery.
Be mindful of what other services may be exposed via localhost or the
local network.
.Ss DEBUG
2019-10-20 22:39:01 +02:00
Debug mode may be enabled or disabled by running
.Ic debug Ar on|off .
In debug mode, secure cookies are disabled and templates are reloaded
every request.
2019-11-13 01:00:00 +01:00
.Ss IMPORT
Data may be imported and converted from other services using the
.Ic import
command.
2019-11-13 03:27:54 +01:00
Posts are imported and backdated to appear as old honks.
No other information is imported.
2019-11-13 01:00:00 +01:00
.Pp
Currently limited to Twitter import.
This requires a Twitter data archive.
After unzipping the data archive, navigate to the tweet_media directory
and unzip any zip files contained within.
.Dl ./honk import username twitter source-directory
.Sh FILES
.Nm
files are split between the data directory and the view directory.
Both default to "." but may be specified by command line options.
.Pp
The data directory contains:
.Bl -tag -width views/local.css
.It Pa honk.db
The main database.
.It Pa blob.db
Media and attachment storage.
.It Pa emus
Custom emoji.
.It Pa memes
Stickers and such.
.It Pa views/local.css
Locally customized CSS.
.El
.Pp
The view directory contains:
.Bl -tag -width views
.It Pa views
HTML templates and CSS files.
.El
2019-11-06 19:26:35 +01:00
.Sh EXAMPLES
This series of commands creates a new database, sets a friendly
welcome message, and runs honk.
.Bd -literal -offset indent
honk-v98> make
honk-v98> ./honk -datadir ../honkdata init
username: puffy
password: OxychromaticBlowfishSwatDynamite
listen address: /var/www/honk.sock
server name: honk.example.com
honk-v98> ./honk -datadir ../honkdata admin
honk-v98> date; ./honk -datadir ../honkdata >> log 2>&1
.Ed
.Pp
Upgrade to the next version.
Clean things up a bit.
.Bd -literal -offset indent
datadir> cp honk.db backup.db
datadir> cd ../honk-v99
honk-v99> make
honk-v99> ./honk -datadir ../honkdata upgrade
honk-v99> ./honk -datadir ../honkdata cleanup
honk-v99> date; ./honk -datadir ../honkdata >> log 2>&1
.Ed
.Sh ENVIRONMENT
Image processing and scaling requires considerable memory.
It is recommended to adjust the datasize ulimit to at least 1GB.
.Sh SEE ALSO
.Xr intro 1 ,
.Xr honk 1
.Sh CAVEATS
There's no online upgrade capability.
Upgrades may result in minutes of downtime.