.\" Copyright (c) 2023 Omar Polo .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .Dd January 8, 2024 .Dt PKG_FCGI 8 .Os .Sh NAME .Nm pkg_fcgi .Nd FastCGI interface to browse the OpenBSD port tree .Sh SYNOPSIS .Nm .Op Fl dv .Op Fl j Ar n .Op Fl p Ar path .Op Fl s Ar socket .Op Fl u Ar user .Op Ar database .Sh DESCRIPTION .Nm is a FastCGI server that serves an interface to browse through and query the .Ox port tree from Gemini. .Pp It opens a socket at .Pa /var/www/run/pkg_fcgi.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 /pkg_fcgi/pkgs.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 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 EXAMPLES Example configuration for .Xr gmid 8 : .Bd -literal -offset -indent server "localhost" { listen on * fastcgi socket "/run/pkg_fcgi.sock" } .Ed .Sh SEE ALSO .Xr gmid 8 .Sh AUTHORS .An Omar Polo Aq Mt op@omarpolo.com