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.
35.Pp
36Make sure to pass the Host header, if necessary (as for nginx).
37.Bd -literal -offset indent
38proxy_set_header Host $http_host;
39.Ed
40.Ss BUILD
41Building
42.Nm
43requires a go compiler and libsqlite.
44On
45.Ox
46this is the go and sqlite3 packages.
47Other platforms may require additional development libraries or headers
48to be installed.
49Run make.
50Please be patient.
51Even on fast machines, building from source can take several seconds.
52.Ss OPTIONS
53The following options control where
54.Nm
55looks for data.
56.Bl -tag -width datadirx
57.It Fl datadir
58The root data directory, where the database and other user data are stored.
59Requires write access.
60Defaults to ".".
61.It Fl viewdir
62The root view directory, where html and other templates are stored.
63Read only.
64Defaults to ".".
65.El
66.Ss INIT
67Run the
68.Ic init
69command.
70This will create the database and ask four questions, as well as creating
71the initial user.
72See below about importing existing data.
73.Ss OPERATION
74Run honk.
75Log messages are sent to stderr and should probably be redirected to a file.
76.Ss CUSTOMIZATION
77Add custom memes (stickers) to the
78.Pa memes
79data directory.
80Image and video files are supported.
81.Pp
82Add custom emus (emoji) to the
83.Pa emus
84data directory.
85Image files are supported.
86.Pp
87Site CSS may be overridden by creating a
88.Pa views/local.css
89file in the data directory.
90A restart is required after changes.
91.Pp
92Custom HTML messages may be added to select pages by using the
93.Ic admin
94command.
95A restart is required after changes.
96.Bl -tag -width tenletters
97.It server
98Displayed on the home page.
99.It about
100Displayed on the about page.
101.It login
102Displayed about the login form.
103.El
104.Pp
105.Ss USER ADMIN
106New users can be added with the
107.Ic adduser
108command.
109This is discouraged.
110.Pp
111Passwords may be reset with the
112.Ic chpass Ar username
113command.
114.Ss MAINTENANCE
115The database may grow large over time.
116The
117.Ic cleanup Op Ar days
118command exists to purge old data, by default 30 days.
119This removes unreferenced, unsaved posts and attachments.
120It does not remove any original content.
121.Ss UPGRADE
122Stop the old honk process.
123Backup the database.
124Perform the upgrade with the
125.Ic upgrade
126command.
127Restart.
128.Pp
129There's also a
130.Pa blob.db
131file which is important to backup and restore.
132.Pp
133The current version of the honk binary may be printed with the
134.Ic version
135command.
136.Ss SECURITY
137.Nm
138is not currently hardened against SSRF, server side request forgery.
139Be mindful of what other services may be exposed via localhost or the
140local network.
141.Ss DEBUG
142Debug mode may be enabled or disabled by running
143.Ic debug Ar on|off .
144In debug mode, secure cookies are disabled and templates are reloaded
145every request.
146.Ss IMPORT
147Data may be imported and converted from other services using the
148.Ic import
149command.
150.Pp
151Currently limited to Twitter import.
152This requires a Twitter data archive.
153After unzipping the data archive, navigate to the tweet_media directory
154and unzip any zip files contained within.
155.Dl ./honk import username twitter source-directory
156.Sh FILES
157.Nm
158files are split between the data directory and the view directory.
159Both default to "." but may be specified by command line options.
160.Pp
161The data directory contains:
162.Bl -tag -width views/local.css
163.It Pa honk.db
164The main database.
165.It Pa blob.db
166Media and attachment storage.
167.It Pa emus
168Custom emoji.
169.It Pa memes
170Stickers and such.
171.It Pa views/local.css
172Locally customized CSS.
173.El
174.Pp
175The view directory contains:
176.Bl -tag -width views
177.It Pa views
178HTML templates and CSS files.
179.El
180.Sh EXAMPLES
181This series of commands creates a new database, sets a friendly
182welcome message, and runs honk.
183.Bd -literal -offset indent
184honk-v98> make
185honk-v98> ./honk -datadir ../honkdata init
186username: puffy
187password: OxychromaticBlowfishSwatDynamite
188listen address: /var/www/honk.sock
189server name: honk.example.com
190honk-v98> ./honk -datadir ../honkdata admin
191honk-v98> date; ./honk -datadir ../honkdata >> log 2>&1
192.Ed
193.Pp
194Upgrade to the next version.
195Clean things up a bit.
196.Bd -literal -offset indent
197datadir> cp honk.db backup.db
198datadir> cd ../honk-v99
199honk-v99> make
200honk-v99> ./honk -datadir ../honkdata upgrade
201honk-v99> ./honk -datadir ../honkdata cleanup
202honk-v99> date; ./honk -datadir ../honkdata >> log 2>&1
203.Ed
204.Sh ENVIRONMENT
205Image processing and scaling requires considerable memory.
206It is recommended to adjust the datasize ulimit to at least 1GB.
207.Sh SEE ALSO
208.Xr intro 1 ,
209.Xr honk 1
210.Sh CAVEATS
211There's no online upgrade capability.
212Upgrades may result in minutes of downtime.