Skip to content

Commit

Permalink
Merge pull request #153 from projectdiscovery/dev
Browse files Browse the repository at this point in the history
v1.0.2 Release
  • Loading branch information
ehsandeep committed Jun 16, 2022
2 parents 53bacf6 + 5fc442a commit c9f7cc3
Show file tree
Hide file tree
Showing 15 changed files with 178 additions and 274 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -27,12 +27,12 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
10 changes: 5 additions & 5 deletions .github/workflows/dockerhub-push.yml
Expand Up @@ -12,26 +12,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Get Github tag
id: meta
run: |
echo "::set-output name=tag::$(curl --silent "https://api.github.com/repos/projectdiscovery/notify/releases/latest" | jq -r .tag_name)"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-test.yml
Expand Up @@ -10,9 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v3.2.0
with:
version: latest
args: --timeout 5m
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-binary.yml
Expand Up @@ -23,7 +23,7 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
name: "Create release on GitHub"
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v3
with:
args: "release --rm-dist"
version: latest
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,4 +1,4 @@
FROM golang:1.18-alpine as build-env
FROM golang:1.18.3-alpine as build-env
RUN go install -v github.com/projectdiscovery/notify/cmd/notify@latest

FROM alpine:latest
Expand Down
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -59,7 +59,7 @@ This will display help for the tool. Here are all the switches it supports.
| `-v` | Show Verbose output | `notify -v` |
| `-no-color` | Don't Use colors in output | `notify -nc` |
| `-data` | File path to read data from | `notify -i test.txt` |
| `-bulk` | Read and send data in bulk from file. | `notify -bulk` |
| `-bulk` | Read and send data in bulk | `notify -bulk` |
| `-char-limit` | Character limit for message (default 4000) | `notify -cl 2000` |
| `-provider-config` | provider config path | `notify -pc provider.yaml` |
| `-provider` | provider to send the notification to (optional) | `notify -p slack,telegram` |
Expand Down Expand Up @@ -127,6 +127,7 @@ smtp:
smtp_cc:
- to@email.com
smtp_format: "{{data}}"
subject: "Email subject"

custom:
- id: webhook
Expand Down Expand Up @@ -207,8 +208,7 @@ Notify flags can be configured at default config (`$HOME/.config/notify/config.y

## Notes
- As default notify sends notification line by line
- **bulk** flag is supported with data flag.
- stdin/pipe input doesn't support **bulk** posting.
- Use `-bulk` to send notification as entire message/s (messages might be chunked)

## References

Expand All @@ -217,4 +217,4 @@ Notify flags can be configured at default config (`$HOME/.config/notify/config.y
- [Creating Telegram bot](https://core.telegram.org/bots#3-how-do-i-create-a-bot)
- [Creating Pushover Token](https://github.com/containrrr/shoutrrr/blob/main/docs/services/pushover.md)

Notify is made with 🖤 by the [projectdiscovery](https://projectdiscovery.io) team.
Notify is made with 🖤 by the [projectdiscovery](https://projectdiscovery.io) team.
4 changes: 2 additions & 2 deletions cmd/notify/notify.go
Expand Up @@ -54,8 +54,8 @@ func readConfig() {
set.StringVarP(&options.Data, "data", "i", "", "input file to send for notify")
set.NormalizedStringSliceVarP(&options.Providers, "provider", "p", []string{}, "provider to send the notification to (optional)")
set.NormalizedStringSliceVar(&options.IDs, "id", []string{}, "id to send the notification to (optional)")
set.IntVarP(&options.RateLimit, "rate-limit", "rl", 0, "maximum number of HTTP requests to send per second")
set.BoolVar(&options.Bulk, "bulk", false, "enable bulk processing (supported with file input")
set.IntVarP(&options.RateLimit, "rate-limit", "rl", 1, "maximum number of HTTP requests to send per second")
set.BoolVar(&options.Bulk, "bulk", false, "enable bulk processing")
set.IntVarP(&options.CharLimit, "char-limit", "cl", 4000, "max character limit per message")
set.StringVarP(&options.MessageFormat, "msg-format", "mf", "{{data}}", "add custom formatting to message")
set.BoolVar(&options.Silent, "silent", false, "enable silent mode")
Expand Down
29 changes: 10 additions & 19 deletions go.mod
Expand Up @@ -4,41 +4,32 @@ go 1.17

require (
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
github.com/containrrr/shoutrrr v0.4.5-0.20210707101419-8018a476b557
github.com/containrrr/shoutrrr v0.4.5-0.20220522113502-c91dc3cf1279
github.com/json-iterator/go v1.1.12
github.com/oriser/regroup v0.0.0-20210730155327-fca8d7531263
github.com/pkg/errors v0.9.1
github.com/projectdiscovery/fileutil v0.0.0-20220510111557-fba17e05663f
github.com/projectdiscovery/goflags v0.0.7
github.com/projectdiscovery/gologger v1.1.4
go.uber.org/multierr v1.7.0
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
go.uber.org/multierr v1.8.0
go.uber.org/ratelimit v0.2.0
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/cnf/structhash v0.0.0-20201127153200-e1b16c1ebc08 // indirect
github.com/fatih/color v1.12.0 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/google/go-cmp v0.5.4 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/klauspost/compress v1.13.1 // indirect
github.com/fatih/color v1.10.0 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.13 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/onsi/ginkgo v1.16.4 // indirect
github.com/onsi/gomega v1.10.5 // indirect
github.com/projectdiscovery/stringsutil v0.0.0-20210804142656-fd3c28dbaafe // indirect
github.com/projectdiscovery/stringsutil v0.0.0-20220422150559-b54fb5dc6833 // indirect
go.uber.org/atomic v1.7.0 // indirect
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gosrc.io/xmpp v0.5.1 // indirect
nhooyr.io/websocket v1.8.7 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

0 comments on commit c9f7cc3

Please sign in to comment.