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 then
59 .Pa /var/www
60 will be used.
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 .El
81 .Pp
82 If no
83 .Ic listen
84 directive is used,
85 .Xr gotwebd 8
86 will listen on the
87 .Ux Ns -domain
88 socket at
89 .Pa /var/www/run/gotweb.sock .
90 .Sh SERVER CONFIGURATION
91 At least one server context must exist for
92 .Xr gotwebd 8
93 to function.
94 In case no server context is defined in the configuration file, a default
95 server context will be used which uses default parameters for all
96 applicable settings.
97 .Pp
98 A server context is declared with a unique
99 .Ar name ,
100 followed by server-specific configuration directives inside curly braces:
101 .Pp
102 .Ic server Ar name Brq ...
103 .Pp
104 The first server defined is used if the requested hostname is not
105 matched by any server block.
106 .Pp
107 The available server configuration directives are as follows:
108 .Bl -tag -width Ds
109 .It Ic custom_css Ar path
110 Set the path to a custom Cascading Style Sheet (CSS) to be used.
111 If this option is not specified then the default style sheet
112 .Sq gotweb.css
113 will be used.
114 .It Ic logo Ar path
115 Set the path to an image file containing a logo to be displayed.
116 Defaults to
117 .Sq got.png .
118 .It Ic logo_url Ar url
119 Set a hyperlink for the logo.
120 Defaults to
121 .Lk https://gameoftrees.org .
122 .It Ic max_commits_display Ar number
123 Set the maximum amount of commits and tags displayed per page.
124 Defaults to 25.
125 .It Ic max_repos_display Ar number
126 Set the maximum amount of repositories displayed on the index screen.
127 Defaults to 25.
128 Set to zero to show all the repositories without pagination.
129 .It Ic repos_path Ar path
130 Set the path to the directory which contains Git repositories that
131 the server should publish.
132 Defaults to
133 .Pa /run/gotwebd.sock
134 under the chroot.
135 .It Ic respect_exportok Ar on | off
136 Set whether to display the repository only if it contains the magic
137 .Pa git-daemon-export-ok
138 file.
139 Disabled by default.
140 .It Ic show_repo_age Ar on | off
141 Toggle display of last repository modification date.
142 Enabled by default.
143 .It Ic show_repo_cloneurl Ar on | off
144 Toggle display of clone URLs for a repository.
145 This requires the creation of a
146 .Pa cloneurl
147 file inside the repository which contains one URL per line.
148 Enabled by default.
149 .It Ic show_repo_description Ar on | off
150 Toggle display of the repository description.
151 Enabled by default.
152 The
153 .Pa description
154 file in the repository should be updated with an appropriate description.
155 .It Ic show_repo_owner Ar on | off
156 Set whether to display the repository owner.
157 Enabled by default.
158 Displaying the owner requires owner information to be added to the
159 .Pa config
160 file in the repository.
161 .Xr gotwebd 8
162 will parse owner information from either a [gotweb] or a [gitweb] section.
163 For example:
164 .Bd -literal -offset indent
165 [gotweb]
166 owner = "Your Name"
167 .Ed
168 .It Ic site_link Ar string
169 Set the displayed site link name for the index page.
170 Defaults to
171 .Sq Repos .
172 .It Ic site_name Ar string
173 Set the displayed site name title.
174 Defaults to
175 .Sq Gotweb .
176 .It Ic site_owner Ar string
177 Set the displayed site owner.
178 Defaults to
179 .Sq Got Owner .
180 .It Ic show_site_owner Ar on | off
181 Toggle display of the site owner.
182 Enabled by default.
183 .It Ic summary_commits_display Ar number
184 The maximum number of commits to show in the summary page.
185 Defaults to 10.
186 .It Ic summary_tags_display Ar number
187 The maximum number of tags to show in the summary page.
188 Defaults to 3.
189 .El
190 .Sh FILES
191 .Bl -tag -width Ds -compact
192 .It Pa /etc/gotwebd.conf
193 Default location of the
194 .Nm
195 configuration file.
196 .It Pa /var/www/run/gotweb.sock
197 Default location for the
198 .Xr gotwebd 8
199 listening socket.
200 .El
201 .Sh EXAMPLES
202 A sample configuration:
203 .Bd -literal -offset indent
204 server "localhost" {
205 site_name "my public repos"
206 site_owner "Flan Hacker"
207 site_link "Flan' Projects"
209 .Ed
210 .Pp
211 Another example, this time listening on a local port instead of the
212 implicit
213 .Ux
214 socket.
215 .Bd -literal -offset indent
216 listen on 127.0.0.1 port 9000
217 listen on ::1 port 9000
219 server "localhost" {
220 site_name "my public repos"
222 .Ed
223 .Sh SEE ALSO
224 .Xr got 1 ,
225 .Xr httpd.conf 5 ,
226 .Xr services 5 ,
227 .Xr gotwebd 8 ,
228 .Xr httpd 8