-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
108 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# taken from https://github.com/bxcodec/go-clean-arch/blob/master/.golangci.yaml | ||
|
||
govet: | ||
check-shadowing: true | ||
settings: | ||
printf: | ||
funcs: | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf | ||
golint: | ||
min-confidence: 0.8 | ||
gocyclo: | ||
min-complexity: 20 | ||
maligned: | ||
suggest-new: true | ||
dupl: | ||
threshold: 100 | ||
goconst: | ||
min-len: 2 | ||
min-occurrences: 5 | ||
misspell: | ||
locale: US | ||
lll: | ||
line-length: 160 | ||
# tab width in spaces. Default to 1. | ||
tab-width: 1 | ||
funlen: | ||
lines: 120 | ||
statements: 50 | ||
|
||
linters: | ||
# please, do not use `enable-all`: it's deprecated and will be removed soon. | ||
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint | ||
disable-all: true | ||
enable: | ||
- deadcode | ||
- errcheck | ||
- funlen | ||
- goconst | ||
# - gocritic | ||
- gocyclo | ||
- golint | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- interfacer | ||
- lll | ||
- misspell | ||
- staticcheck | ||
- structcheck | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- varcheck | ||
|
||
run: | ||
# default concurrency is a available CPU number | ||
concurrency: 2 | ||
|
||
skip-dirs: | ||
# - test/testdata_etc | ||
skip-files: | ||
# - .*_test.go | ||
|
||
issues: | ||
exclude-rules: | ||
- path: internal/(cache|renameio)/ | ||
linters: | ||
- lll | ||
- gochecknoinits | ||
- gocyclo | ||
- funlen | ||
- path: .*_test.go | ||
linters: | ||
- funlen | ||
exclude-use-default: false | ||
exclude: | ||
- should have a package comment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM golang:1.12-alpine AS builder | ||
FROM golang:1.19-alpine AS builder | ||
|
||
WORKDIR /src/app | ||
|
||
|
@@ -9,7 +9,7 @@ RUN apk add --no-cache git \ | |
COPY . . | ||
RUN go install | ||
|
||
FROM alpine:latest | ||
FROM alpine:3.16 | ||
LABEL maintainer "Alex Simenduev <[email protected]>" | ||
|
||
ENTRYPOINT ["odfe-alerts-handler"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
An HTTP server which used to handle webhooks triggered by [OpenDistro for Elasticsearch Alerting](https://opendistro.github.io/for-elasticsearch-docs/docs/alerting) | ||
|
||
> Notice, the readme is for `0.2.x` version | ||
> Notice, the readme is for `0.3.x` version | ||
## Why? | ||
|
||
|
@@ -22,25 +22,29 @@ Download latest version for your platform from [releases](https://github.com/bri | |
|
||
## With Docker | ||
|
||
docker run --rm -p 8080:8080 bringg/odfe-alerts-handler --help | ||
```shell | ||
docker run --rm -p 8080:8080 bringg/odfe-alerts-handler --help | ||
``` | ||
|
||
## Usage | ||
|
||
usage: odfe-alerts-handler [<flags>] | ||
|
||
Flags: | ||
-h, --help Show context-sensitive help (also try --help-long and --help-man). | ||
--web.listen-address=":8080" | ||
Address to listen on for incoming HTTP requests. | ||
--smtp.host="localhost" SMTP server hostname. | ||
--smtp.port=25 SMTP server port. | ||
--smtp.username="" SMTP server login username. | ||
--smtp.password="" SMTP server login password. | ||
--smtp.from="opendistro@localhost" | ||
SMTP from address. | ||
--smtp.default-subject="Opendistro Alert fired" | ||
SMTP default subject. | ||
--slack.token="" Slack token for posting messages. | ||
```plain | ||
usage: odfe-alerts-handler [<flags>] | ||
Flags: | ||
-h, --help Show context-sensitive help (also try --help-long and --help-man). | ||
--web.listen-address=":8080" | ||
Address to listen on for incoming HTTP requests. | ||
--smtp.host="localhost" SMTP server hostname. | ||
--smtp.port=25 SMTP server port. | ||
--smtp.username="" SMTP server login username. | ||
--smtp.password="" SMTP server login password. | ||
--smtp.from="opendistro@localhost" | ||
SMTP from address. | ||
--smtp.default-subject="Opendistro Alert fired" | ||
SMTP default subject. | ||
--slack.token="" Slack token for posting messages. | ||
``` | ||
|
||
## Configure ODFE Alerting destinations | ||
|
||
|
@@ -59,7 +63,7 @@ Download latest version for your platform from [releases](https://github.com/bri | |
|
||
```yaml | ||
to: ['[email protected]'] | ||
subject: ['Optional subject param'] | ||
subject: Optional subject param | ||
--- | ||
This is the body of the message | ||
Here you can use the templeting as usual... | ||
|
@@ -86,8 +90,8 @@ Optionally, for `channels` you can omit the leading `#`. | |
## Creating a release | ||
|
||
```shell | ||
RELEASE_TITLE="First release" | ||
RELEASE_VERSION=0.2.0 | ||
RELEASE_TITLE="Module maintenance, and fix slack deprecations" | ||
RELEASE_VERSION=0.3.0 | ||
|
||
git tag -a v${RELEASE_VERSION} -m "${RELEASE_TITLE}" | ||
git push --tags | ||
|