all repos — honk @ b602d33e4b4c03dc9a1a172ec4a850152d4bc11b

my fork of honk

docs/honk.8 (view raw)

  1.\"
  2.\" Copyright (c) 2019 Ted Unangst
  3.\"
  4.\" Permission to use, copy, modify, and distribute this software for any
  5.\" purpose with or without fee is hereby granted, provided that the above
  6.\" copyright notice and this permission notice appear in all copies.
  7.\"
  8.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 10.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 11.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 12.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 13.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 14.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 15.\"
 16.Dd $Mdocdate$
 17.Dt HONK 8
 18.Os
 19.Sh NAME
 20.Nm honk
 21.Nd honk administration
 22.Sh DESCRIPTION
 23The
 24.Nm
 25daemon processes messages from other federated servers.
 26This is the admin manual.
 27For user operation, see
 28.Xr honk 1 .
 29.Ss Setup
 30.Pp
 31Set up a TLS reverse proxy.
 32.Nm
 33can listen on TCP or unix sockets, but will not terminate TLS.
 34https is a required component for federation.
 35Also, http signature verification requires accurate time keeping.
 36.Pp
 37Make sure to pass the Host header, if necessary (as for nginx).
 38.Bd -literal -offset indent
 39proxy_set_header Host $http_host;
 40.Ed
 41.Pp
 42FastCGI can be used by prefixing the listen address with "fcgi:".
 43.Ss Build
 44Building
 45.Nm
 46requires a go compiler 1.18 and libsqlite.
 47On
 48.Ox
 49this is the go and sqlite3 packages.
 50Other platforms may require additional development libraries or headers
 51to be installed.
 52Run make.
 53Please be patient.
 54Even on fast machines, building from source can take several seconds.
 55.Ss Options
 56The following options control where
 57.Nm
 58looks for data.
 59.Bl -tag -width datadirxdirx
 60.It Fl datadir Ar dir
 61The root data directory, where the database and other user data are stored.
 62This directory contains all user data that persists across upgrades.
 63Requires write access.
 64Defaults to ".".
 65Also set by
 66.Ev HONK_DATADIR .
 67.It Fl viewdir Ar dir
 68The root view directory, where html and other templates are stored.
 69The contents of this directory are generally replaced with each release.
 70Read only.
 71Defaults to ".".
 72Also set by
 73.Ev HONK_VIEWDIR .
 74.El
 75.Pp
 76The following options control log output.
 77Acceptable values include "stderr" (the default), "stdout", "null", "syslog",
 78or a file name.
 79syslog messages will be sent to the UUCP facility.
 80.Bl -tag -width errorlogxlogx
 81.It Fl errorlog Ar log
 82The error log.
 83Something bad has happened.
 84.It Fl infolog Ar log
 85The informative messages log.
 86Something has happened, but probably not too bad.
 87.It Fl debuglog Ar log
 88The debug log.
 89There's probably no reason to care.
 90.It Fl log Ar log
 91Set all three logs.
 92.El
 93.Ss Init
 94Run the
 95.Ic init
 96command.
 97This will create the database and ask four questions, as well as creating
 98the initial user.
 99See below about importing existing data.
100.Ss Operation
101Run honk.
102.Ss Customization
103The funzone contains fun flair that users may add to posts and profiles.
104Add custom memes (stickers) to the
105.Pa memes
106data directory.
107Image and video files are supported.
108Add custom emus (emoji) to the
109.Pa emus
110data directory.
111PNG and GIF files are supported.
112.Pp
113Site CSS may be overridden by creating a
114.Pa views/local.css
115file in the data directory.
116Site JS may similarly be included by creating
117.Pa views/local.js .
118A restart is required after changes.
119A site icon.png and favicon.ico will be served from the views directory
120in the data directory, if present.
121.Pp
122Custom HTML messages may be added to select pages by using the
123.Ic admin
124command.
125This interface is a little rough.
126A restart is required after changes.
127.Bl -tag -width tenletters
128.It server
129Displayed on the home page.
130.It about
131Displayed on the about page.
132.It login
133Displayed on the login form.
134.It avatar colors
135Four 32-bit hex colors (RGBA).
136.El
137.Pp
138.Ss User Admin
139New users can be added with the
140.Ic adduser
141command.
142This is discouraged.
143.Pp
144Passwords may be reset with the
145.Ic chpass Ar username
146command.
147.Pp
148Users may be deleted with the
149.Ic deluser Ar username
150command.
151.Pp
152Follow and unfollow requests can be sent via command line with
153.Ic follow Ar username Ar url
154and
155.Ic unfollow Ar username Ar url .
156.Ss Maintenance
157The database may grow large over time.
158The
159.Ic cleanup Op Ar days
160This will not immediately reduce the size of the database, but frees space
161for future use.
162A vacuum may be performed manually if necessary, but will require more time
163and additional disk space.
164.Pp
165Backups may be performed by running
166.Ic backup dirname .
167Backups only include the minimal necessary information, such as user posts
168and follower information, but not external posts.
169.Pp
170Sometimes servers simply disappear, resulting in many errors trying to deliver
171undeliverable messages.
172Running
173.Ic unplug Ar hostname
174will delete all subscriptions and pending deliveries.
175.Ss Upgrade
176Stop the old honk process.
177Backup the database.
178Perform the upgrade with the
179.Ic upgrade
180command.
181Restart.
182.Pp
183The current version of the honk binary may be printed with the
184.Ic version
185command.
186.Ss Security
187.Nm
188is not currently hardened against SSRF, server side request forgery.
189Be mindful of what other services may be exposed via localhost or the
190local network.
191.Ss Development
192Development mode may be enabled or disabled by running
193.Ic devel Ar on|off .
194In devel mode, secure cookies are disabled, TLS certs are not verified,
195and templates are reloaded every request.
196.Ss Import
197Data may be imported and converted from other services using the
198.Ic import
199command.
200Currently supports Honk, Mastodon, Twitter, and Instagram exported data.
201Posts are imported and backdated to appear as old honks.
202The Mastodon following list is imported, but must be refollowed.
203.Pp
204To prepare a Honk data archive, extract the export.zip file.
205.Dl ./honk import username honk source-directory
206.Pp
207To prepare a Mastodon data archive, extract the archive-longhash.tar.gz file.
208.Dl ./honk import username mastodon source-directory
209.Pp
210To prepare a Twitter data archive, extract the twitter-longhash.zip file.
211After unzipping the data archive, navigate to the tweet_media directory
212and unzip any zip files contained within.
213.Dl ./honk import username twitter source-directory
214.Pp
215To prepare an Instagram data archive, extract the igusername.zip file.
216.Dl ./honk import username instagram source-directory
217.Ss Export
218User data may be exported to a zip archive using the
219.Ic export
220command.
221This will export the user's outbox and inbox in ActivityPub json format,
222along with associated media.
223.Dl ./honk export username zipname
224.Ss Advanced Options
225Advanced configuration values may be set by running the
226.Ic setconfig Ar key value
227command.
228For example, to increase the fast timeout value from 5 seconds to 10:
229.Dl ./honk setconfig fasttimeout 10
230.Pp
231To support separate mentions without a subdomain,
232e.g. @user@example.com and https://honk.example.com/u/user,
233set config key 'masqname' to 'example.com'.
234Route
235.Pa /.well-known/webfinger
236from the top domain to honk.
237.Pp
238Custom URL seperators (not "u" and "h") may be specified by adding
239"usersep" and "honksep" options to the config table.
240e.g. example.com/users/username/honk/somehonk instead of
241example.com/u/username/h/somehonk.
242.Sh FILES
243.Nm
244files are split between the data directory and the view directory.
245Both default to "." but may be specified by command line options.
246.Pp
247The data directory contains:
248.Bl -tag -width views/local.css
249.It Pa honk.db
250The main database.
251.It Pa blob.db
252Media and attachment storage.
253.It Pa emus
254Custom emoji.
255.It Pa memes
256Stickers and such.
257.It Pa views/local.js
258Locally customized JS.
259.It Pa views/local.css
260Locally customized CSS.
261.El
262.Pp
263The view directory contains:
264.Bl -tag -width views
265.It Pa views
266HTML templates and CSS files.
267.El
268.Sh EXAMPLES
269This series of commands creates a new database, sets a friendly
270welcome message, and runs honk.
271.Bd -literal -offset indent
272honk-v98> make
273honk-v98> ./honk -datadir ../honkdata init
274username: puffy
275password: OxychromaticBlowfishSwatDynamite
276listen address: /var/www/honk.sock
277server name: honk.example.com
278honk-v98> ./honk -datadir ../honkdata admin
279honk-v98> date; ./honk -log honk.log -datadir ../honkdata
280.Ed
281.Pp
282The views directory includes a sample mastodon.css to change color scheme.
283.Bd -literal -offset indent
284honk-v98> mkdir ../honkdata/views
285honk-v98> cp views/mastodon.css ../honkdata/views/local.css
286.Ed
287.Pp
288Upgrade to the next version.
289Clean things up a bit.
290.Bd -literal -offset indent
291datadir> cp honk.db backup.db
292datadir> cd ../honk-v99
293honk-v99> make
294honk-v99> ./honk -datadir ../honkdata upgrade
295honk-v99> ./honk -datadir ../honkdata cleanup
296honk-v99> date; ./honk -log honk.log -datadir ../honkdata
297.Ed
298.Sh ENVIRONMENT
299Image processing and scaling requires considerable memory.
300It is recommended to adjust the datasize ulimit to at least 1GB.
301.Sh SEE ALSO
302.Xr intro 1 ,
303.Xr honk 1
304.Sh CAVEATS
305There's no online upgrade capability.
306Upgrades may result in minutes of downtime.