Blob


1 .\" This file is in the public domain.
2 .Dd April 4, 2023
3 .Dt MSEARCHD 8
4 .Os
5 .Sh NAME
6 .Nm msearchd
7 .Nd FastCGI mail archive query server
8 .Sh SYNOPSIS
9 .Nm
10 .Op Fl dv
11 .Op Fl j Ar n
12 .Op Fl p Ar path
13 .Op Fl s Ar socket
14 .Op Fl t Ar tmpldir
15 .Op Fl u Ar user
16 .Op Ar db
17 .Sh DESCRIPTION
18 .Nm
19 is a server which implements the FastCGI Protocol to provide search
20 facilities for the mail archive.
21 .Pp
22 It opens a socket at
23 .Pa /var/www/run/msearchd.sock ,
24 owned by www:www with permissions 0660.
25 It will then
26 .Xr chroot 8
27 to
28 .Pa /var/www
29 and drop privileges to user
30 .Dq www .
31 Three child processes are ran to handle the incoming traffic on the
32 FastCGI socket.
33 Upon
34 .Dv SIGHUP
35 the database is closed and re-opened.
36 The default database used is at
37 .Pa /msearchd/mails.sqlite3
38 inside the chroot.
39 .Pp
40 The options are as follows:
41 .Bl -tag -width Ds
42 .It Fl d
43 Do not daemonize.
44 If this option is specified,
45 .Nm
46 will run in the foreground and log to standard error.
47 .It Fl j Ar n
48 Run
49 .Ar n
50 child processes.
51 .It Fl p Ar path
52 .Xr chroot 2
53 to
54 .Ar path .
55 A
56 .Ar path
57 of
58 .Pa /
59 effectively disables the chroot.
60 .It Fl s Ar socket
61 Create an bind to the local socket at
62 .Ar socket .
63 .It Fl t Ar tmpldir
64 Path to a directory containing the template files.
65 .Pa /etc/smarc
66 by default.
67 .It Fl u Ar user
68 Drop privileges to
69 .Ar user
70 instead of default user www and
71 .Xr chroot 8
72 to their home directory.
73 .It Fl v
74 Enable more verbose (debug) logging.
75 Multiple
76 .Fl v
77 options increase the verbosity.
78 .El
79 .Sh FILES
80 .Bl -tag -width Ds
81 .It Pa /etc/smarc/foot.html
82 Template with the trailing part of the page.
83 .It Pa /etc/smarc/head.html
84 Template with the first part of the page.
85 .Dv TITLE
86 is replaced with
87 .Dq Search .
88 .It Pa /etc/smarc/search-header.html
89 Template for the start of the search page.
90 .It Pa /etc/smarc/search.html
91 Template for the search form.
92 .Dv QUERY
93 is replaced with the search query.
94 .It Pa /var/www/msearchd/mails.sqite3
95 Default database.
96 .It Pa /var/www/run/msearchd.sock
97 .Ux Ns -domain socket.
98 .El
99 .Sh EXAMPLES
100 Example configuration for
101 .Xr httpd.conf 5 :
102 .Bd -literal -offset -indent
103 server "localhost" {
104 listen on * port 80
105 root "/smarc"
106 gzip-static
108 location "/search" {
109 fastcgi socket "/run/msearchd.sock"
112 .Ed
113 .Sh SEE ALSO
114 .Xr httpd 8
115 .Sh AUTHORS
116 .An Omar Polo Aq Mt op@openbsd.org