Blob


1 .\" Copyright (c) 2023 Omar Polo <op@omarpolo.com>
2 .\"
3 .\" Permission to use, copy, modify, and distribute this software for any
4 .\" purpose with or without fee is hereby granted, provided that the above
5 .\" copyright notice and this permission notice appear in all copies.
6 .\"
7 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 .Dd January 8, 2024
15 .Dt PKG_FCGI 8
16 .Os
17 .Sh NAME
18 .Nm pkg_fcgi
19 .Nd FastCGI interface to browse the OpenBSD port tree
20 .Sh SYNOPSIS
21 .Nm
22 .Op Fl dv
23 .Op Fl j Ar n
24 .Op Fl p Ar path
25 .Op Fl s Ar socket
26 .Op Fl u Ar user
27 .Op Ar database
28 .Sh DESCRIPTION
29 .Nm
30 is a FastCGI server that serves an interface to browse through and
31 query the
32 .Ox
33 port tree from Gemini.
34 .Pp
35 It opens a socket at
36 .Pa /var/www/run/pkg_fcgi.sock ,
37 owned by www:www with permissions 0660.
38 It will then
39 .Xr chroot 8
40 to
41 .Pa /var/www
42 and drop privileges to user
43 .Dq www .
44 Three child processes are ran to handle the incoming traffic on the
45 FastCGI socket.
46 Upon
47 .Dv SIGHUP
48 the database is closed and re-opened.
49 The default database used is at
50 .Pa /pkg_fcgi/pkgs.sqlite3
51 inside the chroot.
52 .Pp
53 The options are as follows:
54 .Bl -tag -width Ds
55 .It Fl d
56 Do not daemonize.
57 If this option is specified,
58 .Nm
59 will run in the foreground and log to standard error.
60 .It Fl j Ar n
61 Run
62 .Ar n
63 child processes.
64 .It Fl p Ar path
65 .Xr chroot 2
66 to
67 .Ar path .
68 A
69 .Ar path
70 of
71 .Pa /
72 effectively disables the chroot.
73 .It Fl s Ar socket
74 Create an bind to the local socket at
75 .Ar socket .
76 .It Fl u Ar user
77 Drop privileges to
78 .Ar user
79 instead of default user www and
80 .Xr chroot 8
81 to their home directory.
82 .It Fl v
83 Enable more verbose (debug) logging.
84 Multiple
85 .Fl v
86 options increase the verbosity.
87 .El
88 .Sh EXAMPLES
89 Example configuration for
90 .Xr gmid 8 :
91 .Bd -literal -offset -indent
92 server "localhost" {
93 listen on *
94 fastcgi socket "/run/pkg_fcgi.sock"
95 }
96 .Ed
97 .Sh SEE ALSO
98 .Xr gmid 8
99 .Sh AUTHORS
100 .An Omar Polo Aq Mt op@omarpolo.com