all repos — honk @ 4a788131f9034941227bb4b1ab55a042969f01bf

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 ".".
 65.It Fl viewdir Ar dir
 66The root view directory, where html and other templates are stored.
 67The contents of this directory are generally replaced with each release.
 68Read only.
 69Defaults to ".".
 70.El
 71.Pp
 72The following options control log output.
 73Acceptable values include "stderr" (the default), "stdout", "null", "syslog",
 74or a file name.
 75syslog messages will be sent to the UUCP facility.
 76.Bl -tag -width errorlogxlogx
 77.It Fl errorlog Ar log
 78The error log.
 79Something bad has happened.
 80.It Fl infolog Ar log
 81The informative messages log.
 82Something has happened, but probably not too bad.
 83.It Fl debuglog Ar log
 84The debug log.
 85There's probably no reason to care.
 86.It Fl log Ar log
 87Set all three logs.
 88.El
 89.Ss Init
 90Run the
 91.Ic init
 92command.
 93This will create the database and ask four questions, as well as creating
 94the initial user.
 95See below about importing existing data.
 96.Ss Operation
 97Run honk.
 98.Ss Customization
 99The funzone contains fun flair that users may add to posts and profiles.
100Add custom memes (stickers) to the
101.Pa memes
102data directory.
103Image and video files are supported.
104Add custom emus (emoji) to the
105.Pa emus
106data directory.
107PNG and GIF files are supported.
108.Pp
109Site CSS may be overridden by creating a
110.Pa views/local.css
111file in the data directory.
112Site JS may similarly be included by creating
113.Pa views/local.js .
114A restart is required after changes.
115A site icon.png and favicon.ico will be served from the views directory
116in the data directory, if present.
117.Pp
118Custom HTML messages may be added to select pages by using the
119.Ic admin
120command.
121This interface is a little rough.
122A restart is required after changes.
123.Bl -tag -width tenletters
124.It server
125Displayed on the home page.
126.It about
127Displayed on the about page.
128.It login
129Displayed on the login form.
130.It avatar colors
131Four 32-bit hex colors (RGBA).
132.El
133.Pp
134.Ss User Admin
135New users can be added with the
136.Ic adduser
137command.
138This is discouraged.
139.Pp
140Passwords may be reset with the
141.Ic chpass Ar username
142command.
143.Pp
144Users may be deleted with the
145.Ic deluser Ar username
146command.
147.Pp
148Follow and unfollow requests can be sent via command line with
149.Ic follow Ar username Ar url
150and
151.Ic unfollow Ar username Ar url .
152.Ss Maintenance
153The database may grow large over time.
154The
155.Ic cleanup Op Ar days
156This will not immediately reduce the size of the database, but frees space
157for future use.
158A vacuum may be performed manually if necessary, but will require more time
159and additional disk space.
160.Pp
161Backups may be performed by running
162.Ic backup dirname .
163Backups only include the minimal necessary information, such as user posts
164and follower information, but not external posts.
165.Pp
166Sometimes servers simply disappear, resulting in many errors trying to deliver
167undeliverable messages.
168Running
169.Ic unplug Ar hostname
170will delete all subscriptions and pending deliveries.
171.Ss Upgrade
172Stop the old honk process.
173Backup the database.
174Perform the upgrade with the
175.Ic upgrade
176command.
177Restart.
178.Pp
179The current version of the honk binary may be printed with the
180.Ic version
181command.
182.Ss Security
183.Nm
184is not currently hardened against SSRF, server side request forgery.
185Be mindful of what other services may be exposed via localhost or the
186local network.
187.Ss Development
188Development mode may be enabled or disabled by running
189.Ic devel Ar on|off .
190In devel mode, secure cookies are disabled, TLS certs are not verified,
191and templates are reloaded every request.
192.Ss Import
193Data may be imported and converted from other services using the
194.Ic import
195command.
196Currently supports Honk, Mastodon, Twitter, and Instagram exported data.
197Posts are imported and backdated to appear as old honks.
198The Mastodon following list is imported, but must be refollowed.
199.Pp
200To prepare a Honk data archive, extract the export.zip file.
201.Dl ./honk import username honk source-directory
202.Pp
203To prepare a Mastodon data archive, extract the archive-longhash.tar.gz file.
204.Dl ./honk import username mastodon source-directory
205.Pp
206To prepare a Twitter data archive, extract the twitter-longhash.zip file.
207After unzipping the data archive, navigate to the tweet_media directory
208and unzip any zip files contained within.
209.Dl ./honk import username twitter source-directory
210.Pp
211To prepare an Instagram data archive, extract the igusername.zip file.
212.Dl ./honk import username instagram source-directory
213.Ss Export
214User data may be exported to a zip archive using the
215.Ic export
216command.
217This will export the user's outbox and inbox in ActivityPub json format,
218along with associated media.
219.Dl ./honk export username zipname
220.Ss Advanced Options
221Advanced configuration values may be set by running the
222.Ic setconfig Ar key value
223command.
224For example, to increase the fast timeout value from 5 seconds to 10:
225.Dl ./honk setconfig fasttimeout 10
226.Pp
227To support separate mentions without a subdomain,
228e.g. @user@example.com and https://honk.example.com/u/user,
229set config key 'masqname' to 'example.com'.
230Route
231.Pa /.well-known/webfinger
232from the top domain to honk.
233.Pp
234Custom URL seperators (not "u" and "h") may be specified by adding
235"usersep" and "honksep" options to the config table.
236e.g. example.com/users/username/honk/somehonk instead of
237example.com/u/username/h/somehonk.
238.Sh FILES
239.Nm
240files are split between the data directory and the view directory.
241Both default to "." but may be specified by command line options.
242.Pp
243The data directory contains:
244.Bl -tag -width views/local.css
245.It Pa honk.db
246The main database.
247.It Pa blob.db
248Media and attachment storage.
249.It Pa emus
250Custom emoji.
251.It Pa memes
252Stickers and such.
253.It Pa views/local.js
254Locally customized JS.
255.It Pa views/local.css
256Locally customized CSS.
257.El
258.Pp
259The view directory contains:
260.Bl -tag -width views
261.It Pa views
262HTML templates and CSS files.
263.El
264.Sh EXAMPLES
265This series of commands creates a new database, sets a friendly
266welcome message, and runs honk.
267.Bd -literal -offset indent
268honk-v98> make
269honk-v98> ./honk -datadir ../honkdata init
270username: puffy
271password: OxychromaticBlowfishSwatDynamite
272listen address: /var/www/honk.sock
273server name: honk.example.com
274honk-v98> ./honk -datadir ../honkdata admin
275honk-v98> date; ./honk -log honk.log -datadir ../honkdata
276.Ed
277.Pp
278The views directory includes a sample mastodon.css to change color scheme.
279.Bd -literal -offset indent
280honk-v98> mkdir ../honkdata/views
281honk-v98> cp views/mastodon.css ../honkdata/views/local.css
282.Ed
283.Pp
284Upgrade to the next version.
285Clean things up a bit.
286.Bd -literal -offset indent
287datadir> cp honk.db backup.db
288datadir> cd ../honk-v99
289honk-v99> make
290honk-v99> ./honk -datadir ../honkdata upgrade
291honk-v99> ./honk -datadir ../honkdata cleanup
292honk-v99> date; ./honk -log honk.log -datadir ../honkdata
293.Ed
294.Sh ENVIRONMENT
295Image processing and scaling requires considerable memory.
296It is recommended to adjust the datasize ulimit to at least 1GB.
297.Sh SEE ALSO
298.Xr intro 1 ,
299.Xr honk 1
300.Sh CAVEATS
301There's no online upgrade capability.
302Upgrades may result in minutes of downtime.