.\" This file is in the public domain. .Dd April 4, 2023 .Dt MSEARCHD 8 .Os .Sh NAME .Nm msearchd .Nd FastCGI mail archive query server .Sh SYNOPSIS .Nm .Op Fl dv .Op Fl j Ar n .Op Fl p Ar path .Op Fl s Ar socket .Op Fl t Ar tmpldir .Op Fl u Ar user .Op Ar db .Sh DESCRIPTION .Nm is a server which implements the FastCGI Protocol to provide search facilities for the mail archive. .Pp It opens a socket at .Pa /var/www/run/msearchd.sock , owned by www:www with permissions 0660. It will then .Xr chroot 8 to .Pa /var/www and drop privileges to user .Dq www . Three child processes are ran to handle the incoming traffic on the FastCGI socket. Upon .Dv SIGHUP the database is closed and re-opened. The default database used is at .Pa /msearchd/mails.sqlite3 inside the chroot. .Pp The options are as follows: .Bl -tag -width Ds .It Fl d Do not daemonize. If this option is specified, .Nm will run in the foreground and log to standard error. .It Fl j Ar n Run .Ar n child processes. .It Fl p Ar path .Xr chroot 2 to .Ar path . A .Ar path of .Pa / effectively disables the chroot. .It Fl s Ar socket Create an bind to the local socket at .Ar socket . .It Fl t Ar tmpldir Path to a directory containing the template files. .Pa /etc/smarc by default. .It Fl u Ar user Drop privileges to .Ar user instead of default user www and .Xr chroot 8 to their home directory. .It Fl v Enable more verbose (debug) logging. Multiple .Fl v options increase the verbosity. .El .Sh FILES .Bl -tag -width Ds .It Pa /etc/smarc/foot.html Template with the trailing part of the page. .It Pa /etc/smarc/head.html Template with the first part of the page. .Dv TITLE is replaced with .Dq Search . .It Pa /etc/smarc/search-header.html Template for the start of the search page. .It Pa /etc/smarc/search.html Template for the search form. .Dv QUERY is replaced with the search query. .It Pa /var/www/msearchd/mails.sqite3 Default database. .It Pa /var/www/run/msearchd.sock .Ux Ns -domain socket. .El .Sh EXAMPLES Example configuration for .Xr httpd.conf 5 : .Bd -literal -offset -indent server "localhost" { listen on * port 80 root "/smarc" gzip-static location "/search" { fastcgi socket "/run/msearchd.sock" } } .Ed .Sh SEE ALSO .Xr httpd 8 .Sh AUTHORS .An Omar Polo Aq Mt op@openbsd.org