Blame


1 13b2bc37 2022-10-23 stsp .\"
2 13b2bc37 2022-10-23 stsp .\" Copyright (c) 2022 Stefan Sperling <stsp@openbsd.org>
3 13b2bc37 2022-10-23 stsp .\"
4 13b2bc37 2022-10-23 stsp .\" Permission to use, copy, modify, and distribute this software for any
5 13b2bc37 2022-10-23 stsp .\" purpose with or without fee is hereby granted, provided that the above
6 13b2bc37 2022-10-23 stsp .\" copyright notice and this permission notice appear in all copies.
7 13b2bc37 2022-10-23 stsp .\"
8 13b2bc37 2022-10-23 stsp .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 13b2bc37 2022-10-23 stsp .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 13b2bc37 2022-10-23 stsp .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 13b2bc37 2022-10-23 stsp .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 13b2bc37 2022-10-23 stsp .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 13b2bc37 2022-10-23 stsp .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 13b2bc37 2022-10-23 stsp .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 13b2bc37 2022-10-23 stsp .\"
16 13b2bc37 2022-10-23 stsp .Dd $Mdocdate$
17 13b2bc37 2022-10-23 stsp .Dt GOTD.CONF 5
18 13b2bc37 2022-10-23 stsp .Os
19 13b2bc37 2022-10-23 stsp .Sh NAME
20 13b2bc37 2022-10-23 stsp .Nm gotd.conf
21 13b2bc37 2022-10-23 stsp .Nd gotd configuration file
22 13b2bc37 2022-10-23 stsp .Sh DESCRIPTION
23 13b2bc37 2022-10-23 stsp .Nm
24 13b2bc37 2022-10-23 stsp is the run-time configuration file for
25 13b2bc37 2022-10-23 stsp .Xr gotd 8 .
26 13b2bc37 2022-10-23 stsp .Pp
27 13b2bc37 2022-10-23 stsp The file format is line-based, with one configuration directive per line.
28 13b2bc37 2022-10-23 stsp Any lines beginning with a
29 13b2bc37 2022-10-23 stsp .Sq #
30 13b2bc37 2022-10-23 stsp are treated as comments and ignored.
31 13b2bc37 2022-10-23 stsp .Sh GLOBAL CONFIGURATION
32 13b2bc37 2022-10-23 stsp The available global configuration directives are as follows:
33 13b2bc37 2022-10-23 stsp .Bl -tag -width Ds
34 40b85cca 2023-01-03 stsp .It Ic connection Ar option
35 40b85cca 2023-01-03 stsp Set the specified options and limits for connections to the
36 40b85cca 2023-01-03 stsp .Xr gotd 8
37 40b85cca 2023-01-03 stsp unix socket.
38 40b85cca 2023-01-03 stsp .Pp
39 40b85cca 2023-01-03 stsp The
40 40b85cca 2023-01-03 stsp .Ic connection
41 40b85cca 2023-01-03 stsp directive may be specified multiple times, and multiple
42 40b85cca 2023-01-03 stsp .Ar option
43 40b85cca 2023-01-03 stsp arguments may be specified within curly braces:
44 40b85cca 2023-01-03 stsp .Pp
45 40b85cca 2023-01-03 stsp .Ic connection Brq Ar ...
46 40b85cca 2023-01-03 stsp .Pp
47 40b85cca 2023-01-03 stsp Each option should only be specified once.
48 40b85cca 2023-01-03 stsp If a given option is listed multiple times, the last line which sets this
49 40b85cca 2023-01-03 stsp option wins.
50 40b85cca 2023-01-03 stsp .Pp
51 40b85cca 2023-01-03 stsp Valid connection options are:
52 40b85cca 2023-01-03 stsp .Bl -tag -width Ds
53 40b85cca 2023-01-03 stsp .It Ic request timeout Ar seconds
54 40b85cca 2023-01-03 stsp Specify the inactivity timeout for operations between client and server.
55 40b85cca 2023-01-03 stsp If this timeout is exceeded while a Git protocol request is being processed,
56 40b85cca 2023-01-03 stsp the request will be aborted and the connection will be terminated.
57 40b85cca 2023-01-03 stsp .Pp
58 2be11cde 2023-01-03 op The timeout value may also have a suffix indicating its unit of measure.
59 2be11cde 2023-01-03 op Supported suffixes are:
60 2be11cde 2023-01-03 op .Pp
61 2be11cde 2023-01-03 op .Bl -tag -compact -width tenletters
62 2be11cde 2023-01-03 op .It Ar s No or Ar S
63 2be11cde 2023-01-03 op seconds
64 2be11cde 2023-01-03 op .It Ar m No or Ar M
65 2be11cde 2023-01-03 op minutes
66 2be11cde 2023-01-03 op .It Ar h No or Ar H
67 2be11cde 2023-01-03 op hours
68 2be11cde 2023-01-03 op .El
69 2be11cde 2023-01-03 op .Pp
70 2be11cde 2023-01-03 op The default timeout is 1h (3600 seconds, one hour).
71 40b85cca 2023-01-03 stsp This should only be changed if legitimate requests are exceeding the default
72 40b85cca 2023-01-03 stsp timeout for some reason, such as the server spending an extraordinary
73 40b85cca 2023-01-03 stsp amount of time generating a pack file.
74 40b85cca 2023-01-03 stsp .It Ic limit Ic user Ar identity Ar number
75 40b85cca 2023-01-03 stsp Limit the maximum amount of concurrent connections by the user with
76 40b85cca 2023-01-03 stsp the username
77 40b85cca 2023-01-03 stsp .Ar identity
78 40b85cca 2023-01-03 stsp to
79 40b85cca 2023-01-03 stsp .Ar number .
80 40b85cca 2023-01-03 stsp Numeric user IDs are also accepted.
81 40b85cca 2023-01-03 stsp .Pp
82 40b85cca 2023-01-03 stsp The default per-user limit is 4.
83 40b85cca 2023-01-03 stsp This should only be changed if concurrent connections from a given user are
84 40b85cca 2023-01-03 stsp expected to exceed the default limit, for example if an anonymous user
85 40b85cca 2023-01-03 stsp is granted read access and many concurrent connections will share this
86 40b85cca 2023-01-03 stsp anonymous user identity.
87 40b85cca 2023-01-03 stsp .El
88 83577462 2023-01-05 stsp .It Ic listen on Ar path
89 13b2bc37 2022-10-23 stsp Set the path to the unix socket which
90 13b2bc37 2022-10-23 stsp .Xr gotd 8
91 13b2bc37 2022-10-23 stsp should listen on.
92 13b2bc37 2022-10-23 stsp If not specified, the path
93 13b2bc37 2022-10-23 stsp .Pa /var/run/gotd.sock
94 13b2bc37 2022-10-23 stsp will be used.
95 13b2bc37 2022-10-23 stsp .It Ic user Ar user
96 13b2bc37 2022-10-23 stsp Set the
97 13b2bc37 2022-10-23 stsp .Ar user
98 13b2bc37 2022-10-23 stsp which will run
99 13b2bc37 2022-10-23 stsp .Xr gotd 8 .
100 13b2bc37 2022-10-23 stsp Initially,
101 13b2bc37 2022-10-23 stsp .Xr gotd 8
102 eec68231 2022-12-14 stsp requires root privileges in order to create its unix socket.
103 13b2bc37 2022-10-23 stsp Afterwards,
104 13b2bc37 2022-10-23 stsp .Xr gotd 8
105 13b2bc37 2022-10-23 stsp drops privileges to the specified
106 13b2bc37 2022-10-23 stsp .Ar user .
107 13b2bc37 2022-10-23 stsp If not specified, the user _gotd will be used.
108 13b2bc37 2022-10-23 stsp .El
109 13b2bc37 2022-10-23 stsp .Sh REPOSITORY CONFIGURATION
110 13b2bc37 2022-10-23 stsp At least one repository context must exist for
111 13b2bc37 2022-10-23 stsp .Xr gotd 8
112 13b2bc37 2022-10-23 stsp to function.
113 0ccf3acb 2022-11-16 stsp For each repository, access rules must be configured using the
114 0ccf3acb 2022-11-16 stsp .Ic permit
115 0ccf3acb 2022-11-16 stsp and
116 0ccf3acb 2022-11-16 stsp .Ic deny
117 0ccf3acb 2022-11-16 stsp configuration directives.
118 0ccf3acb 2022-11-16 stsp Multiple access rules can be specified, and the last matching rule
119 0ccf3acb 2022-11-16 stsp determines the action taken.
120 0ccf3acb 2022-11-16 stsp If no rule matches, access to the repository is denied.
121 13b2bc37 2022-10-23 stsp .Pp
122 13b2bc37 2022-10-23 stsp A repository context is declared with a unique
123 13b2bc37 2022-10-23 stsp .Ar name ,
124 13b2bc37 2022-10-23 stsp followed by repository-specific configuration directives inside curly braces:
125 13b2bc37 2022-10-23 stsp .Pp
126 13b2bc37 2022-10-23 stsp .Ic repository Ar name Brq ...
127 13b2bc37 2022-10-23 stsp .Pp
128 13b2bc37 2022-10-23 stsp .Xr got 1
129 13b2bc37 2022-10-23 stsp and
130 13b2bc37 2022-10-23 stsp .Xr git 1
131 13b2bc37 2022-10-23 stsp clients can connect to a repository by including the repository's unique
132 13b2bc37 2022-10-23 stsp .Ar name
133 13b2bc37 2022-10-23 stsp in the request URL.
134 13b2bc37 2022-10-23 stsp Clients appending the string
135 13b2bc37 2022-10-23 stsp .Dq .git
136 13b2bc37 2022-10-23 stsp to the
137 13b2bc37 2022-10-23 stsp .Ar name
138 13b2bc37 2022-10-23 stsp will also be accepted.
139 13b2bc37 2022-10-23 stsp .Pp
140 13b2bc37 2022-10-23 stsp If desired, the
141 13b2bc37 2022-10-23 stsp .Ar name
142 13b2bc37 2022-10-23 stsp may contain path-separators,
143 13b2bc37 2022-10-23 stsp .Dq / ,
144 13b2bc37 2022-10-23 stsp to expose repositories as part of a virtual client-visible directory hierarchy.
145 13b2bc37 2022-10-23 stsp .Pp
146 13b2bc37 2022-10-23 stsp The available repository configuration directives are as follows:
147 13b2bc37 2022-10-23 stsp .Bl -tag -width Ds
148 0ccf3acb 2022-11-16 stsp .It Ic deny Ar identity
149 0ccf3acb 2022-11-16 stsp Deny repository access to users with the username
150 0ccf3acb 2022-11-16 stsp .Ar identity .
151 0ccf3acb 2022-11-16 stsp Group names may be matched by prepending a colon
152 0ccf3acb 2022-11-16 stsp .Pq Sq \&:
153 0ccf3acb 2022-11-16 stsp to
154 0ccf3acb 2022-11-16 stsp .Ar identity .
155 0ccf3acb 2022-11-16 stsp Numeric IDs are also accepted.
156 13b2bc37 2022-10-23 stsp .It Ic path Ar path
157 13b2bc37 2022-10-23 stsp Set the path to the Git repository.
158 3b706203 2023-01-02 stsp Must be specified.
159 0ccf3acb 2022-11-16 stsp .It Ic permit Ar mode Ar identity
160 0ccf3acb 2022-11-16 stsp Permit repository access to users with the username
161 0ccf3acb 2022-11-16 stsp .Ar identity .
162 0ccf3acb 2022-11-16 stsp The
163 0ccf3acb 2022-11-16 stsp .Ar mode
164 0ccf3acb 2022-11-16 stsp argument must be set to either
165 0ccf3acb 2022-11-16 stsp .Ic ro
166 0ccf3acb 2022-11-16 stsp for read-only access,
167 0ccf3acb 2022-11-16 stsp or
168 0ccf3acb 2022-11-16 stsp .Ic rw
169 0ccf3acb 2022-11-16 stsp for read-write access.
170 0ccf3acb 2022-11-16 stsp Group names may be matched by prepending a colon
171 0ccf3acb 2022-11-16 stsp .Pq Sq \&:
172 0ccf3acb 2022-11-16 stsp to
173 0ccf3acb 2022-11-16 stsp .Ar identity .
174 0ccf3acb 2022-11-16 stsp Numeric IDs are also accepted.
175 9afa3de2 2023-04-04 stsp .It Ic protect Brq Ar ...
176 9afa3de2 2023-04-04 stsp The
177 9afa3de2 2023-04-04 stsp .Cm protect
178 9afa3de2 2023-04-04 stsp directive may be used to protect branches and tags in a repository
179 9afa3de2 2023-04-04 stsp from being overwritten by potentially destructive client-side commands,
180 9afa3de2 2023-04-04 stsp such as when
181 9afa3de2 2023-04-04 stsp .Cm got send -f
182 9afa3de2 2023-04-04 stsp and
183 9afa3de2 2023-04-04 stsp .Cm git push -f
184 9afa3de2 2023-04-04 stsp are used to change the history of a branch.
185 9afa3de2 2023-04-04 stsp .Pp
186 9afa3de2 2023-04-04 stsp To build a set of protected branches and tags, multiple
187 9afa3de2 2023-04-04 stsp .Ic protect
188 9afa3de2 2023-04-04 stsp directives may be specified per repository and
189 9afa3de2 2023-04-04 stsp multiple
190 9afa3de2 2023-04-04 stsp .Ic protect
191 9afa3de2 2023-04-04 stsp directive parameters may be specified within curly braces.
192 9afa3de2 2023-04-04 stsp .Pp
193 9afa3de2 2023-04-04 stsp The available
194 9afa3de2 2023-04-04 stsp .Cm protect
195 9afa3de2 2023-04-04 stsp parameters are as follows:
196 9afa3de2 2023-04-04 stsp .Bl -tag -width Ds
197 9afa3de2 2023-04-04 stsp .It Ic branch Ar name
198 9afa3de2 2023-04-04 stsp Protect the named branch.
199 9afa3de2 2023-04-04 stsp The branch may be created if it does not exist yet.
200 9afa3de2 2023-04-04 stsp Attempts to delete the branch or change its history will be denied.
201 9afa3de2 2023-04-04 stsp .Pp
202 9afa3de2 2023-04-04 stsp If the
203 9afa3de2 2023-04-04 stsp .Ar name
204 9afa3de2 2023-04-04 stsp does not already begin with
205 9afa3de2 2023-04-04 stsp .Dq refs/heads/
206 9afa3de2 2023-04-04 stsp it will be looked up in the
207 9afa3de2 2023-04-04 stsp .Dq refs/heads/
208 9afa3de2 2023-04-04 stsp reference namespace.
209 9afa3de2 2023-04-04 stsp .It Ic branch Ic namespace Ar namespace
210 9afa3de2 2023-04-04 stsp Protect the given reference namespace, assuming that references in
211 9afa3de2 2023-04-04 stsp this namespace represent branches.
212 9afa3de2 2023-04-04 stsp New branches may be created in the namespace.
213 9afa3de2 2023-04-04 stsp Attempts to change the history of branches or delete them will be denied.
214 9afa3de2 2023-04-04 stsp .Pp
215 9afa3de2 2023-04-04 stsp The
216 9afa3de2 2023-04-04 stsp .Ar namespace
217 9afa3de2 2023-04-04 stsp argument must be absolute, starting with
218 9afa3de2 2023-04-04 stsp .Dq refs/ .
219 9afa3de2 2023-04-04 stsp .It Ic tag Ic namespace Ar namespace
220 9afa3de2 2023-04-04 stsp Protect the given reference namespace, assuming that references in
221 9afa3de2 2023-04-04 stsp this namespace represent tags.
222 9afa3de2 2023-04-04 stsp New tags may be created in the namespace.
223 9afa3de2 2023-04-04 stsp Attempts to change or delete existing tags will be denied.
224 9afa3de2 2023-04-04 stsp .Pp
225 a397e3fb 2024-03-28 op The
226 9afa3de2 2023-04-04 stsp .Ar namespace
227 9afa3de2 2023-04-04 stsp argument must be absolute, starting with
228 9afa3de2 2023-04-04 stsp .Dq refs/ .
229 4eb4de73 2022-11-14 op .El
230 9afa3de2 2023-04-04 stsp .Pp
231 9afa3de2 2023-04-04 stsp The special reference namespaces
232 9afa3de2 2023-04-04 stsp .Dq refs/got/
233 9afa3de2 2023-04-04 stsp and
234 9afa3de2 2023-04-04 stsp .Dq refs/remotes/
235 9afa3de2 2023-04-04 stsp do not need to be listed in
236 9afa3de2 2023-04-04 stsp .Nm .
237 9afa3de2 2023-04-04 stsp These namespaces are always protected and even attempts to create new
238 9afa3de2 2023-04-04 stsp references in these namespaces will always be denied.
239 ba97b2d7 2024-03-20 stsp .It Ic notify Brq Ar ...
240 ba97b2d7 2024-03-20 stsp The
241 ba97b2d7 2024-03-20 stsp .Ic notify
242 ba97b2d7 2024-03-20 stsp directive enables notifications about new commits or tags
243 ba97b2d7 2024-03-20 stsp added to the repository.
244 ba97b2d7 2024-03-20 stsp .Pp
245 ba97b2d7 2024-03-20 stsp Notifications via email require an SMTP daemon which accepts mail
246 ba97b2d7 2024-03-20 stsp for forwarding without requiring client authentication or encryption.
247 ba97b2d7 2024-03-20 stsp On
248 ba97b2d7 2024-03-20 stsp .Ox
249 ba97b2d7 2024-03-20 stsp the
250 ba97b2d7 2024-03-20 stsp .Xr smtpd 8
251 ba97b2d7 2024-03-20 stsp daemon can be used for this purpose.
252 ba97b2d7 2024-03-20 stsp The default content of email notifications looks similar to the output of the
253 ba97b2d7 2024-03-20 stsp .Cm got log -d
254 ba97b2d7 2024-03-20 stsp command.
255 ba97b2d7 2024-03-20 stsp .Pp
256 5565365c 2024-03-27 op Notifications via HTTP require a HTTP or HTTPS server which is accepting
257 5565365c 2024-03-27 op POST requests with or without HTTP Basic authentication.
258 5565365c 2024-03-27 op Depending on the use case a custom server-side CGI script may be required
259 5565365c 2024-03-27 op for the processing of notifications.
260 5565365c 2024-03-27 op HTTP notifications can achieve functionality
261 5565365c 2024-03-27 op similar to Git's server-side post-receive hook script with
262 5565365c 2024-03-27 op .Xr gotd 8
263 5565365c 2024-03-27 op by triggering arbitrary post-commit actions via the HTTP server.
264 5565365c 2024-03-27 op .Pp
265 ba97b2d7 2024-03-20 stsp The
266 ba97b2d7 2024-03-20 stsp .Ic notify
267 ba97b2d7 2024-03-20 stsp directive expects parameters which must be enclosed in curly braces.
268 ba97b2d7 2024-03-20 stsp The available parameters are as follows:
269 ba97b2d7 2024-03-20 stsp .Bl -tag -width Ds
270 ba97b2d7 2024-03-20 stsp .It Ic branch Ar name
271 ba97b2d7 2024-03-20 stsp Send notifications about commits to the named branch.
272 ba97b2d7 2024-03-20 stsp The
273 ba97b2d7 2024-03-20 stsp .Ar name
274 ba97b2d7 2024-03-20 stsp will be looked up in the
275 ba97b2d7 2024-03-20 stsp .Dq refs/heads/
276 ba97b2d7 2024-03-20 stsp reference namespace.
277 ba97b2d7 2024-03-20 stsp This directive may be specified multiple times to build a list of
278 ba97b2d7 2024-03-20 stsp branches to send notifications for.
279 ba97b2d7 2024-03-20 stsp If neither a
280 ba97b2d7 2024-03-20 stsp .Ic branch
281 ba97b2d7 2024-03-20 stsp nor a
282 ba97b2d7 2024-03-20 stsp .Ic reference namespace
283 ba97b2d7 2024-03-20 stsp are specified then changes to any reference will trigger notifications.
284 ba97b2d7 2024-03-20 stsp .It Ic reference Ic namespace Ar namespace
285 ba97b2d7 2024-03-20 stsp Send notifications about commits or tags within a reference namespace.
286 ba97b2d7 2024-03-20 stsp This directive may be specified multiple times to build a list of
287 ba97b2d7 2024-03-20 stsp namespaces to send notifications for.
288 ba97b2d7 2024-03-20 stsp If neither a
289 ba97b2d7 2024-03-20 stsp .Ic branch
290 ba97b2d7 2024-03-20 stsp nor a
291 ba97b2d7 2024-03-20 stsp .Ic reference namespace
292 ba97b2d7 2024-03-20 stsp are specified then changes to any reference will trigger notifications.
293 ba97b2d7 2024-03-20 stsp .It Ic email Oo Ic from Ar sender Oc Ic to Ar recipient Oo Ic reply to Ar responder Oc Oo Ic relay Ar hostname Oo Ic port Ar port Oc Oc
294 ba97b2d7 2024-03-20 stsp Send notifications via email to the specified
295 ba97b2d7 2024-03-20 stsp .Ar recipient .
296 ba97b2d7 2024-03-20 stsp This directive may be specified multiple times to build a list of
297 ba97b2d7 2024-03-20 stsp recipients to send notifications to.
298 ba97b2d7 2024-03-20 stsp .Pp
299 ba97b2d7 2024-03-20 stsp The
300 ba97b2d7 2024-03-20 stsp .Ar recipient
301 ba97b2d7 2024-03-20 stsp must be an email addresses that accepts mail.
302 ba97b2d7 2024-03-20 stsp The
303 ba97b2d7 2024-03-20 stsp .Ar sender
304 ba97b2d7 2024-03-20 stsp will be used as the From address.
305 ba97b2d7 2024-03-20 stsp If not specified, the sender defaults to an email address composed of the user
306 ba97b2d7 2024-03-20 stsp account running
307 ba97b2d7 2024-03-20 stsp .Xr gotd 8
308 ba97b2d7 2024-03-20 stsp and the local hostname.
309 ba97b2d7 2024-03-20 stsp .Pp
310 ba97b2d7 2024-03-20 stsp If a
311 ba97b2d7 2024-03-20 stsp .Ar responder
312 ba97b2d7 2024-03-20 stsp is specified via the
313 ba97b2d7 2024-03-20 stsp .Ic reply to
314 ba97b2d7 2024-03-20 stsp directive, the
315 ba97b2d7 2024-03-20 stsp .Ar responder
316 ba97b2d7 2024-03-20 stsp will be used as the Reply-to address.
317 ba97b2d7 2024-03-20 stsp Setting the Reply-to header can be useful if replies should go to a
318 ba97b2d7 2024-03-20 stsp mailing list instead of the
319 ba97b2d7 2024-03-20 stsp .Ar sender ,
320 ba97b2d7 2024-03-20 stsp for example.
321 ba97b2d7 2024-03-20 stsp .Pp
322 ba97b2d7 2024-03-20 stsp By default, mail will be sent to the SMTP server listening on the loopback
323 ba97b2d7 2024-03-20 stsp address 127.0.0.1 on port 25.
324 ba97b2d7 2024-03-20 stsp The
325 ba97b2d7 2024-03-20 stsp .Ic relay
326 ba97b2d7 2024-03-20 stsp and
327 ba97b2d7 2024-03-20 stsp .Ic port
328 ba97b2d7 2024-03-20 stsp directives can be used to specify a different SMTP server address and port.
329 55286da2 2024-04-18 stsp .It Ic url Ar URL Oo Ic user Ar user Ic password Ar password Oo Ic insecure Oc Oc
330 5565365c 2024-03-27 op Send notifications via HTTP.
331 5565365c 2024-03-27 op This directive may be specified multiple times to build a list of
332 5565365c 2024-03-27 op HTTP servers to send notifications to.
333 5565365c 2024-03-27 op .Pp
334 5565365c 2024-03-27 op The notification will be sent as a POST request to the given
335 5565365c 2024-03-27 op .Ar URL ,
336 5565365c 2024-03-27 op which must be a valid HTTP URL and begin with either
337 5565365c 2024-03-27 op .Dq http://
338 5565365c 2024-03-27 op or
339 5565365c 2024-03-27 op .Dq https:// .
340 5565365c 2024-03-27 op If HTTPS is used, sending of notifications will only succeed if
341 5565365c 2024-03-27 op no TLS errors occur.
342 5565365c 2024-03-27 op .Pp
343 5565365c 2024-03-27 op The optional
344 5565365c 2024-03-27 op .Ic user
345 5565365c 2024-03-27 op and
346 5565365c 2024-03-27 op .Ic password
347 5565365c 2024-03-27 op directives enable HTTP Basic authentication.
348 5565365c 2024-03-27 op If used, both a
349 5565365c 2024-03-27 op .Ar user
350 5565365c 2024-03-27 op and a
351 5565365c 2024-03-27 op .Ar password
352 5565365c 2024-03-27 op must be specified.
353 5565365c 2024-03-27 op The
354 5565365c 2024-03-27 op .Ar password
355 5565365c 2024-03-27 op must not be an empty string.
356 55286da2 2024-04-18 stsp Unless the
357 55286da2 2024-04-18 stsp .Ic insecure
358 55286da2 2024-04-18 stsp option is specified the notification target
359 55286da2 2024-04-18 stsp .Ar URL
360 55286da2 2024-04-18 stsp must be a
361 55286da2 2024-04-18 stsp .Dq https://
362 55286da2 2024-04-18 stsp URL to avoid leaking of authentication credentials.
363 5565365c 2024-03-27 op .Pp
364 85d7db14 2024-04-05 stsp The request body contains a JSON object with a
365 85d7db14 2024-04-05 stsp .Dq notifications
366 85d7db14 2024-04-05 stsp property containing an array of notification objects.
367 85d7db14 2024-04-05 stsp Each notification object has a
368 85d7db14 2024-04-05 stsp .Sq type
369 85d7db14 2024-04-05 stsp property.
370 85d7db14 2024-04-05 stsp Depending on the type, each notification object has different fields.
371 85d7db14 2024-04-05 stsp The types are:
372 a397e3fb 2024-03-28 op .Bl -tag -width Ds
373 85d7db14 2024-04-05 stsp .It Dv commit
374 85d7db14 2024-04-05 stsp The commit notification object has the following fields.
375 85d7db14 2024-04-05 stsp Except where noted, all are optional.
376 85d7db14 2024-04-05 stsp .Bl -tag -width Ds
377 85d7db14 2024-04-05 stsp .It Dv short
378 85d7db14 2024-04-05 stsp Boolean, indicates whether the object has all the fields set.
379 85d7db14 2024-04-05 stsp When several commits are batched in a single send operation, not all of
380 85d7db14 2024-04-05 stsp the fields are available for each commit object.
381 c1003102 2024-04-15 op .It Dv repo
382 c1003102 2024-04-15 op The repository name as string.
383 85d7db14 2024-04-05 stsp .It Dv id
384 85d7db14 2024-04-05 stsp The commit ID as string, may be abbreviated.
385 85d7db14 2024-04-05 stsp .It Dv committer
386 85d7db14 2024-04-05 stsp An object with the committer information with the following fields:
387 85d7db14 2024-04-05 stsp .Pp
388 85d7db14 2024-04-05 stsp .Bl -tag -compact -width Ds
389 85d7db14 2024-04-05 stsp .It Dv full
390 85d7db14 2024-04-05 stsp Committer's full name.
391 85d7db14 2024-04-05 stsp .It Dv name
392 85d7db14 2024-04-05 stsp Committer's name.
393 85d7db14 2024-04-05 stsp .It Dv mail
394 85d7db14 2024-04-05 stsp Committer's mail address.
395 85d7db14 2024-04-05 stsp .It Dv user
396 85d7db14 2024-04-05 stsp Committer's username.
397 85d7db14 2024-04-05 stsp This is the only field guaranteed to be set.
398 85d7db14 2024-04-05 stsp .El
399 85d7db14 2024-04-05 stsp .It Dv author
400 85d7db14 2024-04-05 stsp An object with the author information.
401 85d7db14 2024-04-05 stsp Has the same fields as the
402 85d7db14 2024-04-05 stsp .Dv committer
403 85d7db14 2024-04-05 stsp but may be unset.
404 85d7db14 2024-04-05 stsp .It Dv date
405 85d7db14 2024-04-05 stsp String representation of the date as
406 85d7db14 2024-04-05 stsp .Xr strftime 3
407 85d7db14 2024-04-05 stsp .Sq %G-%m-%d
408 85d7db14 2024-04-05 stsp if
409 85d7db14 2024-04-05 stsp .Dv short
410 85d7db14 2024-04-05 stsp is set or
411 85d7db14 2024-04-05 stsp .Sq %a %b %e %X %Y UTC
412 85d7db14 2024-04-05 stsp otherwise.
413 85d7db14 2024-04-05 stsp .It Dv short_message
414 85d7db14 2024-04-05 stsp The first line of the commit message.
415 85d7db14 2024-04-05 stsp This field is always set.
416 85d7db14 2024-04-05 stsp .It Dv message
417 85d7db14 2024-04-05 stsp The complete commit message, may be unset.
418 85d7db14 2024-04-05 stsp .It Dv diffstat
419 85d7db14 2024-04-05 stsp An object with the summarized changes, may be unset.
420 85d7db14 2024-04-05 stsp Contains a
421 85d7db14 2024-04-05 stsp .Dv files
422 85d7db14 2024-04-05 stsp field with an array of objects describing the changes per-file and a
423 85d7db14 2024-04-05 stsp .Dv total
424 85d7db14 2024-04-05 stsp field with the cumulative changes.
425 85d7db14 2024-04-05 stsp The changes per-file contains the following fields:
426 85d7db14 2024-04-05 stsp .Pp
427 85d7db14 2024-04-05 stsp .Bl -tag -compact -width removed
428 85d7db14 2024-04-05 stsp .It Dv action
429 85d7db14 2024-04-05 stsp A string describing the action, can be
430 85d7db14 2024-04-05 stsp .Dq added ,
431 85d7db14 2024-04-05 stsp .Dq deleted ,
432 85d7db14 2024-04-05 stsp .Dq modified ,
433 85d7db14 2024-04-05 stsp .Dq mode changed ,
434 85d7db14 2024-04-05 stsp or
435 85d7db14 2024-04-05 stsp .Dq unknown .
436 85d7db14 2024-04-05 stsp .It Dv file
437 85d7db14 2024-04-05 stsp The file path.
438 85d7db14 2024-04-05 stsp .It Dv added
439 85d7db14 2024-04-05 stsp The number of lines added.
440 85d7db14 2024-04-05 stsp .It Dv removed
441 85d7db14 2024-04-05 stsp The number of lines removed.
442 9afa3de2 2023-04-04 stsp .El
443 85d7db14 2024-04-05 stsp .Pp
444 85d7db14 2024-04-05 stsp The
445 85d7db14 2024-04-05 stsp .Dv total
446 85d7db14 2024-04-05 stsp object contains two fields:
447 85d7db14 2024-04-05 stsp .Dv added
448 85d7db14 2024-04-05 stsp and
449 85d7db14 2024-04-05 stsp .Dv removed
450 85d7db14 2024-04-05 stsp which are the number of added and removed lines respectively.
451 5565365c 2024-03-27 op .El
452 85d7db14 2024-04-05 stsp .It Dv branch-deleted
453 85d7db14 2024-04-05 stsp The branch deleted notifications has the following fields, all guaranteed
454 85d7db14 2024-04-05 stsp to be set:
455 85d7db14 2024-04-05 stsp .Bl -tag -compact -width Ds
456 c1003102 2024-04-15 op .It Dv repo
457 c1003102 2024-04-15 op The repository name as string.
458 85d7db14 2024-04-05 stsp .It Dv ref
459 85d7db14 2024-04-05 stsp The removed branch reference.
460 85d7db14 2024-04-05 stsp .It Dv id
461 85d7db14 2024-04-05 stsp The hash of the commit pointed by the deleted branch.
462 a397e3fb 2024-03-28 op .El
463 85d7db14 2024-04-05 stsp .It Dv tag
464 85d7db14 2024-04-05 stsp The tag notification has the following fields, all guaranteed to be set:
465 85d7db14 2024-04-05 stsp .Bl -tag -width Ds
466 c1003102 2024-04-15 op .It repo
467 c1003102 2024-04-15 op The repository name as string.
468 85d7db14 2024-04-05 stsp .It tag
469 85d7db14 2024-04-05 stsp The tag reference.
470 85d7db14 2024-04-05 stsp .It tagger
471 85d7db14 2024-04-05 stsp The user information, with the same format of the
472 85d7db14 2024-04-05 stsp .Dv committer
473 85d7db14 2024-04-05 stsp field for the
474 85d7db14 2024-04-05 stsp .Dv commit
475 85d7db14 2024-04-05 stsp notification but with all the field guaranteed to be set.
476 85d7db14 2024-04-05 stsp .It Dv date
477 85d7db14 2024-04-05 stsp The tag date.
478 85d7db14 2024-04-05 stsp .It Dv object
479 85d7db14 2024-04-05 stsp The object being tagged.
480 85d7db14 2024-04-05 stsp It contains the fields
481 85d7db14 2024-04-05 stsp .Dv type
482 85d7db14 2024-04-05 stsp with the object type and
483 85d7db14 2024-04-05 stsp .Dv id
484 85d7db14 2024-04-05 stsp with the object id being tagged.
485 85d7db14 2024-04-05 stsp .It Dv message
486 85d7db14 2024-04-05 stsp The tag message.
487 85d7db14 2024-04-05 stsp .El
488 85d7db14 2024-04-05 stsp .El
489 85d7db14 2024-04-05 stsp .El
490 85d7db14 2024-04-05 stsp .El
491 13b2bc37 2022-10-23 stsp .Sh FILES
492 13b2bc37 2022-10-23 stsp .Bl -tag -width Ds -compact
493 13b2bc37 2022-10-23 stsp .It Pa /etc/gotd.conf
494 13b2bc37 2022-10-23 stsp Location of the
495 13b2bc37 2022-10-23 stsp .Nm
496 13b2bc37 2022-10-23 stsp configuration file.
497 13b2bc37 2022-10-23 stsp .El
498 13b2bc37 2022-10-23 stsp .Sh EXAMPLES
499 13b2bc37 2022-10-23 stsp .Bd -literal -offset indent
500 6f854dde 2023-01-04 stsp # Run as the default user:
501 13b2bc37 2022-10-23 stsp user _gotd
502 13b2bc37 2022-10-23 stsp
503 83577462 2023-01-05 stsp # Listen on the default socket:
504 83577462 2023-01-05 stsp listen on "/var/run/gotd.sock"
505 83577462 2023-01-05 stsp
506 13b2bc37 2022-10-23 stsp # This repository can be accessed via ssh://user@example.com/src
507 13b2bc37 2022-10-23 stsp repository "src" {
508 13b2bc37 2022-10-23 stsp path "/var/git/src.git"
509 0ccf3acb 2022-11-16 stsp permit rw flan_hacker
510 0ccf3acb 2022-11-16 stsp permit rw :developers
511 0ccf3acb 2022-11-16 stsp permit ro anonymous
512 9afa3de2 2023-04-04 stsp
513 9afa3de2 2023-04-04 stsp protect branch "main"
514 9afa3de2 2023-04-04 stsp protect tag namespace "refs/tags/"
515 13b2bc37 2022-10-23 stsp }
516 13b2bc37 2022-10-23 stsp
517 13b2bc37 2022-10-23 stsp # This repository can be accessed via
518 13b2bc37 2022-10-23 stsp # ssh://user@example.com/openbsd/ports
519 13b2bc37 2022-10-23 stsp repository "openbsd/ports" {
520 13b2bc37 2022-10-23 stsp path "/var/git/ports.git"
521 0ccf3acb 2022-11-16 stsp permit rw :porters
522 0ccf3acb 2022-11-16 stsp permit ro anonymous
523 0ccf3acb 2022-11-16 stsp deny flan_hacker
524 9afa3de2 2023-04-04 stsp
525 9afa3de2 2023-04-04 stsp protect {
526 9afa3de2 2023-04-04 stsp branch "main"
527 9afa3de2 2023-04-04 stsp tag namespace "refs/tags/"
528 9afa3de2 2023-04-04 stsp }
529 ba97b2d7 2024-03-20 stsp
530 ba97b2d7 2024-03-20 stsp notify {
531 ba97b2d7 2024-03-20 stsp branch "main"
532 ba97b2d7 2024-03-20 stsp reference namespace "refs/tags/"
533 ba97b2d7 2024-03-20 stsp email to openbsd-ports-changes@example.com
534 ba97b2d7 2024-03-20 stsp .\" url https://example.com/notify/ user "flan_announcer" password "secret"
535 ba97b2d7 2024-03-20 stsp }
536 13b2bc37 2022-10-23 stsp }
537 40b85cca 2023-01-03 stsp
538 40b85cca 2023-01-03 stsp # Use a larger request timeout value:
539 2be11cde 2023-01-03 op connection request timeout 2h
540 40b85cca 2023-01-03 stsp
541 40b85cca 2023-01-03 stsp # Some users are granted a higher concurrent connection limit:
542 40b85cca 2023-01-03 stsp connection {
543 40b85cca 2023-01-03 stsp limit user flan_hacker 16
544 40b85cca 2023-01-03 stsp limit user anonymous 32
545 40b85cca 2023-01-03 stsp }
546 13b2bc37 2022-10-23 stsp .Ed
547 13b2bc37 2022-10-23 stsp .Sh SEE ALSO
548 13b2bc37 2022-10-23 stsp .Xr got 1 ,
549 13b2bc37 2022-10-23 stsp .Xr gotsh 1 ,
550 13b2bc37 2022-10-23 stsp .Xr gotd 8