-
Notifications
You must be signed in to change notification settings - Fork 4
/
snare.1
85 lines (85 loc) · 1.74 KB
/
snare.1
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
.Dd 2020-02-10
.Dt SNARE 1
.Os
.Sh NAME
.Nm snare
.Nd GitHub webhooks runner
.Sh SYNOPSIS
.Nm snare
.Op Fl c Ar config-file
.Op Fl d
.Op Fl v
.Sh DESCRIPTION
.Nm
is a GitHub webhooks daemon.
When
.Nm
receives a webhook event from
a given repository, it authenticates the request, and then executes a
user-defined
.Dq per-repo program
with information about the webhook event.
The
.Dq per-repo program
is run in a freshly created temporary directory which is removed once it has
completed.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl c Ar config-file
is a path to a
.Pa snare.conf
configuration file.
If not specified,
.Nm
assumes the configuration file is located at
.Pa /etc/snare/snare.conf/ .
.It Fl d
tells
.Nm snare
not to daemonise: in other words, `snare` stays in the foreground and logs
errors to stderr.
This can be useful for debugging.
.It Fl v
enables more verbose logging.
.Fl v
may be specified multiple times, with each increasing the quantity of logging.
.El
.Sh INTEGRATION WITH GITHUB
.Nm
runs an HTTP server which GitHub can send webhook requests to.
Configuring a webhook for a given GitHub repository is relatively simple: go to
that repository, then
.Eo “
Settings > Webhooks > Add webhook
.Ec ” .
For
.Dq payload ,
specify
.Dq http://yourmachine.com:port/ ,
specify a
.Dq secret
(which you will then reuse as the
.Sy secret
in
.Xr snare.conf 5 )
and then choose which events you wish
GitHub to deliver.
.Sh HTTPS/TLS
.Nm
runs an HTTP server.
If you wish, as is recommended, to send your
webhooks over an encrypted connection, you will need to run a proxy in front of
.Nm .
.Sh DIAGNOSTICS
When run as a daemon,
.Nm
logs to
.Xr syslogd 8
under the
.Dq daemon
facility.
.Sh SEE ALSO
.Xr snare.conf 5
.Pp
.Lk https://tratt.net/laurie/src/snare