1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
|
.\"
.\" Copyright (c) 2020 Stefan Sperling
.\"
.\" 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 $Mdocdate$
.Dt GOTWEBD 8
.Os
.Sh NAME
.Nm gotwebd
.Nd Game of Trees FastCGI server for web browsers
.Sh SYNOPSIS
.Nm
.Op Fl dnv
.Op Fl D Ar macro Ns = Ns Ar value
.Op Fl f Ar file
.Sh DESCRIPTION
.Nm
is a FastCGI server program which can display the contents of Git
repositories via a web browser.
The program has been designed to work out of the box with
the
.Xr httpd 8
web server.
.Pp
.Nm
provides the following options:
.Bl -tag -width tenletters
.It Fl D Ar macro Ns = Ns Ar value
Define
.Ar macro
to be set to
.Ar value .
Overrides the definition of
.Ar macro
in the configuration file.
.It Fl d
Do not daemonize.
Send log output to stderr.
.It Fl f Ar file
Set the path to the configuration file.
If not specified, the file
.Pa /etc/gotwebd.conf
will be used.
.It Fl n
Parse the configuration file, report errors if any, and exit.
.It Fl v
Verbose mode.
Verbosity increases if this option is used multiple times.
.El
.Pp
Enabling
.Nm
requires the following steps:
.Bl -enum
.It
The
.Xr httpd.conf 5
configuration file must be adjusted to run
.Nm
as a FastCGI helper program.
The
.Sx EXAMPLES
section below contains an appropriate configuration file sample.
.It
httpd(8) must be enabled and started:
.Bd -literal -offset indent
# rcctl enable httpd
# rcctl start httpd
.Ed
.It
Optionally, the run-time behaviour of
.Nm
can be configured via the
.Xr gotwebd.conf 5
configuration file.
.It
Git repositories must be created.
These repositories may reside anywhere in the filesystem and must
be readable, but should
.Em not
be writable, by the user
.Nm
runs as.
The default location for repositories published by
.Nm
is
.Pa /var/www/got/public .
.It
If the Git repositories served by
.Nm
do not receive changes from committers directly, they need to be kept
up-to-date with a mechanism such as
.Cm got fetch ,
.Xr git-fetch 1 ,
or
.Xr rsync 1 ,
scheduled by
.Xr cron 8 .
.El
.Sh FILES
.Bl -tag -width /var/www/got/public/ -compact
.It Pa /etc/gotwebd.conf
Default location of the
.Xr gotwebd.conf 5
configuration file.
.It Pa /var/www/got/public/
Default location for Git repositories served by
.Nm .
This location can be adjusted in the
.Xr gotwebd.conf 5
configuration file.
.It Pa /var/www/bin/gotwebd/
Directory containing statically linked
.Xr got 1
helper programs which are run by
.Nm
to read Git repositories.
.It Pa /var/www/htdocs/gotwebd/
Directory containing HTML, CSS, and image files used by
.Nm .
.It Pa /var/www/run/gotweb.sock
Default location for the
.Nm
listening socket.
.It Pa /tmp/
Directory for temporary files created by
.Nm .
.El
.Sh EXAMPLES
Example configuration for
.Xr httpd.conf 5 :
.Bd -literal -offset indent
types { include "/usr/share/misc/mime.types" }
server "example.com" {
listen on * port 80
root "/htdocs/gotwebd"
location "/" {
fastcgi socket "/run/gotweb.sock"
}
}
.Ed
.Pp
Hosting multiple
.Nm gotwebd
instances on the same HTTP server under different path prefixes, with
the first reached via the default
.Ux Ns -domain socket, the second configured to listen on localhost
port 9000:
.Bd -literal -offset indent
server "example.com" {
listen on * port 80
location "/gotwebd-unix/" {
fastcgi socket "/run/gotweb.sock"
}
location "/gotwebd-unix/*" {
root "/htdocs/gotwebd"
request strip 1
}
location "/gotwebd-tcp/" {
fastcgi socket tcp localhost 9000
}
location "/gotwebd-tcp/*" {
root "/htdocs/gotwebd"
request strip 1
}
}
.Ed
.Sh SEE ALSO
.Xr got 1 ,
.Xr git-repository 5 ,
.Xr gotwebd.conf 5 ,
.Xr httpd.conf 5 ,
.Xr httpd 8
.Sh AUTHORS
.An Omar Polo Aq Mt op@openbsd.org
.An Stefan Sperling Aq Mt stsp@openbsd.org
.An Tracey Emery Aq Mt tracey@traceyemery.net
|