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