Browse Source

change room id's

Andreas Peters 1 year ago
parent
commit
d761d6f1da
4 changed files with 24 additions and 15 deletions
  1. 1
    0
      README.md
  2. 1
    0
      app.go
  3. 12
    6
      config.yaml.sample
  4. 10
    9
      services/wekan/wekan.go

+ 1
- 0
README.md View File

@@ -91,3 +91,4 @@ go get github.com/aws/aws-sdk-go
91 91
 ### v0.0.3
92 92
 
93 93
 - add travis webhook support (fork from the original project)
94
+- add wekan webhook support (is a fork of the travis version)

+ 1
- 0
app.go View File

@@ -20,6 +20,7 @@ import (
20 20
 	_ "./services/invoice"
21 21
 	_ "./services/pentest"
22 22
 	_ "./services/travisci"
23
+	_ "./services/wekan"
23 24
 	"./types"
24 25
 	"github.com/AVENTER-UG/util"
25 26
 	"github.com/matrix-org/dugong"

+ 12
- 6
config.yaml.sample View File

@@ -127,10 +127,16 @@ services:
127 127
     Config:
128 128
       Rooms:
129 129
         "!someroom:id":
130
-          Boards
131
-            "1"
132
-            "2"
130
+          Boards:
131
+            "1":
132
+              template: ""
133
+            "2":
134
+              template: ""
133 135
         "!someroom:id":
134
-          Boards
135
-            "3"
136
-            "5"            
136
+          Boards:
137
+            "3":
138
+              template: ""
139
+            "5":
140
+              template: ""
141
+            
142
+            

+ 10
- 9
services/wekan/wekan.go View File

@@ -1,4 +1,4 @@
1
-// Package travisci implements a Service capable of processing webhooks from Travis-CI.
1
+// Package wekan implements a Service capable of processing webhooks from Wekan
2 2
 package wekan
3 3
 
4 4
 import (
@@ -13,7 +13,7 @@ import (
13 13
 	log "github.com/sirupsen/logrus"
14 14
 )
15 15
 
16
-// ServiceType of the Travis-CI service.
16
+// ServiceType of the Wekan service.
17 17
 const ServiceType = "wekan"
18 18
 
19 19
 // DefaultTemplate contains the template that will be used if none is supplied.
@@ -24,10 +24,10 @@ const DefaultTemplate = (`%{boardsitory}#%{build_number} (%{branch} - %{commit}
24 24
 
25 25
 var httpClient = &http.Client{}
26 26
 
27
-// Service contains the Config fields for the Travis-CI service.
27
+// Service contains the Config fields for the Wekan service.
28 28
 //
29
-// This service will send notifications into a Matrix room when Travis-CI sends
30
-// webhook events to it. It requires a public domain which Travis-CI can reach.
29
+// This service will send notifications into a Matrix room when Wekan sends
30
+// webhook events to it. It requires a public domain which Wekan can reach.
31 31
 // Notices will be sent as the service user ID.
32 32
 //
33 33
 // Example JSON request:
@@ -35,8 +35,7 @@ var httpClient = &http.Client{}
35 35
 //       rooms: {
36 36
 //           "!ewfug483gsfe:localhost": {
37 37
 //               boards: {
38
-//                   "matrix-org/go-neb": {
39
-//                       template: "%{boardsitory}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}\nBuild details : %{build_url}"
38
+//                   "1" {
40 39
 //                   }
41 40
 //               }
42 41
 //           }
@@ -50,11 +49,13 @@ type Service struct {
50 49
 	// A map from Matrix room ID to Github-style owner/board boardsitories.
51 50
 	Rooms map[string]struct {
52 51
 		// A map of "boardID's" to configuration information
53
-		Boards map[string]struct{} `json:"boards"`
52
+		Boards map[string]struct {
53
+			Template string `json:"template"`
54
+		} `json:"boards"`
54 55
 	} `json:"rooms"`
55 56
 }
56 57
 
57
-// The payload from Travis-CI
58
+// The payload from Wekan
58 59
 type webhookNotification struct {
59 60
 	ID          string `json:"cardId"`
60 61
 	Text        string `json:"text"`

Loading…
Cancel
Save