Blob


1 .\"
2 .\" Copyright (c) 2020 Tracey Emery <tracey@traceyemery.net>
3 .\"
4 .\" Permission to use, copy, modify, and distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
7 .\"
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 .\"
16 .Dd $Mdocdate$
17 .Dt GOTWEBD.CONF 5
18 .Os
19 .Sh NAME
20 .Nm gotwebd.conf
21 .Nd gotwebd configuration file
22 .Sh DESCRIPTION
23 .Nm
24 is the run-time configuration file for
25 .Xr gotwebd 8 .
26 .Pp
27 The file format is line-based, with one configuration directive per line.
28 Any lines beginning with a
29 .Sq #
30 are treated as comments and ignored.
31 .Pp
32 Macros can be defined that are later expanded in context.
33 Macro names must start with a letter, digit, or underscore, and may
34 contain any of those characters, but may not be reserved words.
35 Macros are not expanded inside quotes.
36 For example:
37 .Bd -literal -offset indent
38 lan_addr = "192.168.0.1"
39 listen on $lan_addr port 9090
40 .Ed
41 .Pp
42 Paths mentioned in
43 .Nm
44 must be relative to
45 .Pa /var/www ,
46 the
47 .Xr chroot 2
48 environment of
49 .Xr httpd 8 .
50 .Sh GLOBAL CONFIGURATION
51 The available global configuration directives are as follows:
52 .Bl -tag -width Ds
53 .It Ic chroot Ar path
54 Set the path to the
55 .Xr chroot 2
56 environment of
57 .Xr httpd 8 .
58 If not specified, it defaults to
59 .Pa /var/www ,
60 the home directory of the www user.
61 .It Ic listen on Ar address Ic port Ar number
62 Configure an address and port for incoming FastCGI connections.
63 Valid
64 .Ar address
65 arguments are hostnames, IPv4 and IPv6 addresses.
66 The
67 .Ar port
68 argument may be number or a service name defined in
69 .Xr services 5 .
70 May be specified multiple times to build up a list of listening sockets.
71 .It Ic listen on socket Ar path
72 Configure a
73 .Ux Ns -domain
74 socket for incoming FastCGI connections.
75 May be specified multiple times to build up a list of listening sockets.
76 .It Ic prefork Ar number
77 Run the specified number of server processes.
78 .Xr gotwebd 8
79 runs 3 server processes by default.
80 .It Ic user Ar user
81 Set the
82 .Ar user
83 which will run
84 .Xr gotwebd 8 .
85 If not specified, the user www will be used.
86 .El
87 .Pp
88 If no
89 .Ic listen
90 directive is used,
91 .Xr gotwebd 8
92 will listen on the
93 .Ux Ns -domain
94 socket at
95 .Pa /var/www/run/gotweb.sock .
96 .Sh SERVER CONFIGURATION
97 At least one server context must exist for
98 .Xr gotwebd 8
99 to function.
100 In case no server context is defined in the configuration file, a default
101 server context will be used which uses default parameters for all
102 applicable settings.
103 .Pp
104 A server context is declared with a unique
105 .Ar name ,
106 followed by server-specific configuration directives inside curly braces:
107 .Pp
108 .Ic server Ar name Brq ...
109 .Pp
110 The first server defined is used if the requested hostname is not
111 matched by any server block.
112 .Pp
113 The available server configuration directives are as follows:
114 .Bl -tag -width Ds
115 .It Ic custom_css Ar path
116 Set the path to a custom Cascading Style Sheet (CSS) to be used.
117 If this option is not specified then the default style sheet
118 .Sq gotweb.css
119 will be used.
120 .It Ic logo Ar path
121 Set the path to an image file containing a logo to be displayed.
122 Defaults to
123 .Sq got.png .
124 .It Ic logo_url Ar url
125 Set a hyperlink for the logo.
126 Defaults to
127 .Lk https://gameoftrees.org .
128 .It Ic max_commits_display Ar number
129 Set the maximum amount of commits and tags displayed per page.
130 Defaults to 25.
131 .It Ic max_repos_display Ar number
132 Set the maximum amount of repositories displayed on the index screen.
133 Defaults to 25.
134 Set to zero to show all the repositories without pagination.
135 .It Ic repos_path Ar path
136 Set the path to the directory which contains Git repositories that
137 the server should publish.
138 Defaults to
139 .Pa /run/gotwebd.sock
140 under the chroot.
141 .It Ic respect_exportok Ar on | off
142 Set whether to display the repository only if it contains the magic
143 .Pa git-daemon-export-ok
144 file.
145 Disabled by default.
146 .It Ic show_repo_age Ar on | off
147 Toggle display of last repository modification date.
148 Enabled by default.
149 .It Ic show_repo_cloneurl Ar on | off
150 Toggle display of clone URLs for a repository.
151 This requires the creation of a
152 .Pa cloneurl
153 file inside the repository which contains one URL per line.
154 Enabled by default.
155 .It Ic show_repo_description Ar on | off
156 Toggle display of the repository description.
157 Enabled by default.
158 The
159 .Pa description
160 file in the repository should be updated with an appropriate description.
161 .It Ic show_repo_owner Ar on | off
162 Set whether to display the repository owner.
163 Enabled by default.
164 Displaying the owner requires owner information to be added to the
165 .Pa config
166 file in the repository.
167 .Xr gotwebd 8
168 will parse owner information from either a [gotweb] or a [gitweb] section.
169 For example:
170 .Bd -literal -offset indent
171 [gotweb]
172 owner = "Your Name"
173 .Ed
174 .It Ic site_link Ar string
175 Set the displayed site link name for the index page.
176 Defaults to
177 .Sq Repos .
178 .It Ic site_name Ar string
179 Set the displayed site name title.
180 Defaults to
181 .Sq Gotweb .
182 .It Ic site_owner Ar string
183 Set the displayed site owner.
184 Defaults to
185 .Sq Got Owner .
186 .It Ic show_site_owner Ar on | off
187 Toggle display of the site owner.
188 Enabled by default.
189 .It Ic summary_commits_display Ar number
190 The maximum number of commits to show in the summary page.
191 Defaults to 10.
192 .It Ic summary_tags_display Ar number
193 The maximum number of tags to show in the summary page.
194 Defaults to 3.
195 .El
196 .Sh FILES
197 .Bl -tag -width Ds -compact
198 .It Pa /etc/gotwebd.conf
199 Default location of the
200 .Nm
201 configuration file.
202 .It Pa /var/www/run/gotweb.sock
203 Default location for the
204 .Xr gotwebd 8
205 listening socket.
206 .El
207 .Sh EXAMPLES
208 A sample configuration:
209 .Bd -literal -offset indent
210 server "localhost" {
211 site_name "my public repos"
212 site_owner "Flan Hacker"
213 site_link "Flan' Projects"
215 .Ed
216 .Pp
217 Another example, this time listening on a local port instead of the
218 implicit
219 .Ux
220 socket.
221 .Bd -literal -offset indent
222 listen on 127.0.0.1 port 9000
223 listen on ::1 port 9000
225 server "localhost" {
226 site_name "my public repos"
228 .Ed
229 .Sh SEE ALSO
230 .Xr got 1 ,
231 .Xr httpd.conf 5 ,
232 .Xr services 5 ,
233 .Xr gotwebd 8 ,
234 .Xr httpd 8