Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions actions/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type SlackAction struct {
Name string
AquaServer string
Url string
TlsVerify bool
slackLayout layout.LayoutProvider
}

Expand Down
1 change: 1 addition & 0 deletions cfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ actions:
type: slack
enable: false
url: https://hooks.slack.com/services/TAAAA/BBB/<key>
tls-verify: false # Enable skip TLS Verification. Default: false.

- name: ms-team
type: teams
Expand Down
1 change: 1 addition & 0 deletions deploy/helm/postee/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ posteeConfig: |
type: slack
enable: false
url: https://hooks.slack.com/services/TAAAA/BBB/<key>
tls-verify: false # Enable skip TLS Verification. Default: false.

- name: ms-team
type: teams
Expand Down
1 change: 1 addition & 0 deletions deploy/kubernetes/postee.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ data:
enable: false
url: >-
https://hooks.slack.com/services/xxxxxxx/xxxxxxx/xxxxxxx
tls-verify: false # Enable skip TLS Verification. Default: false.
- type: teams
name: my-teams
enable: false
Expand Down
1 change: 1 addition & 0 deletions router/builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func buildSlackAction(sourceSettings *ActionSettings, aqua string) *actions.Slac
Name: sourceSettings.Name,
AquaServer: aqua,
Url: sourceSettings.Url,
TlsVerify: sourceSettings.TlsVerify,
}
}

Expand Down
7 changes: 6 additions & 1 deletion slack/sendtoslack.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@ package slack_api

import (
"bytes"
"crypto/tls"
"fmt"
"io/ioutil"
"log"
"net/http"
)

func SendToUrl(url string, data []byte) error {
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport: tr}
r := bytes.NewReader(data)
resp, err := http.Post(url, "application/json", r)
resp, err := client.Post(url, "application/json", r)
if err != nil {
log.Printf("Slack API error: %v", err)
return err
Expand Down