|
@@ -0,0 +1,62 @@
|
|
1
|
+# Line and Sinker
|
|
2
|
+
|
|
3
|
+![Hooks, lines and sinkers](static/las.jpg)
|
|
4
|
+
|
|
5
|
+Line and Sinker (LaS) works with WebHooks from multiple services in order to
|
|
6
|
+bridge them together. Think of it as a personal ifttt instance for development
|
|
7
|
+and infrastructure tooling.
|
|
8
|
+
|
|
9
|
+## Configuration
|
|
10
|
+
|
|
11
|
+All configuration is done using environment variables to facilitate easy
|
|
12
|
+deployment in a docker container.
|
|
13
|
+
|
|
14
|
+Global settings:
|
|
15
|
+
|
|
16
|
+Environment variable | Description
|
|
17
|
+-------------------- | --------------------------------------------------------
|
|
18
|
+ `LAS_BASE_URL` | Base web-facing URL at which LaS is accessible, used to generate hook URLs
|
|
19
|
+ `LAS_SECRET` | Random string used to generate secure hook URLs
|
|
20
|
+
|
|
21
|
+### URL format
|
|
22
|
+
|
|
23
|
+LaS accepts WebHook calls to URLs in the format of
|
|
24
|
+`/hook/<service>/<identifier>/<hash>`, where `<service>` is the service calling
|
|
25
|
+(e.g. GitHub, Jenkins), `<identifier>` is some service-specific identifier for
|
|
26
|
+the hook (e.g. the name of a repository or project), and `<hash>` is a
|
|
27
|
+hex-encoded sha-256 hash of the service, LaS secret, and identifier
|
|
28
|
+concatenated together. The secret prevents anyone that discovers the endpoint
|
|
29
|
+from triggering hooks spuriously or maliciously.
|
|
30
|
+
|
|
31
|
+## Supported services
|
|
32
|
+
|
|
33
|
+### Gitea
|
|
34
|
+
|
|
35
|
+Environment variable | Description
|
|
36
|
+-------------------- | --------------------------------------------------------
|
|
37
|
+ `LAS_GITEA_URL` | Base URL of the Gitea instance to connect to
|
|
38
|
+ `LAS_GITEA_TOKEN` | Application token to use to authenticate to Gitea
|
|
39
|
+
|
|
40
|
+LaS automatically adds itself as a hook for all repositories it has access to
|
|
41
|
+using the given token.
|
|
42
|
+
|
|
43
|
+### Jenkins
|
|
44
|
+
|
|
45
|
+Environment variable | Description
|
|
46
|
+-------------------- | --------------------------------------------------------
|
|
47
|
+ `LAS_JENKINS_URL` | Base URL of the Jenkins instance to connect to
|
|
48
|
+ `LAS_JENKINS_USER` | Username of the Jenkins account to use to connect
|
|
49
|
+ `LAS_JENKINS_PASSWORD` | Password of the Jenkins account to use
|
|
50
|
+
|
|
51
|
+LaS accepts Jenkins webhooks but does not automatically create them. It can
|
|
52
|
+start Jenkins jobs in response to other events.
|
|
53
|
+
|
|
54
|
+### ReportBot
|
|
55
|
+
|
|
56
|
+Environment variable | Description
|
|
57
|
+-------------------- | --------------------------------------------------------
|
|
58
|
+ `LAS_REPORTBOT_ADDRESS` | The host:port combination to send messages to
|
|
59
|
+ `LAS_REPORTBOT_PREFIX` | The text to send to the socket before any messages (e.g. API key)
|
|
60
|
+
|
|
61
|
+LaS can send messages to a ReportBot instance (sending plain text over a TCP
|
|
62
|
+connection with a specified prefix).
|