Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ver2.2.0 #28

Merged
merged 15 commits into from
Oct 22, 2023
60 changes: 60 additions & 0 deletions .github/workflows/build-binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: "build binary"

on:
release:
types: [created]

jobs:
release-linux-amd64:
name: release linux/amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: apt update && apt install libpcap-dev -y
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: linux
goarch: amd64
project_path: "."
binary_name: "dtap"
extra_files: LICENSE README.md
release-linux-arm64:
name: release linux/arm64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: apt update && apt install libpcap-dev -y
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: linux
project_path: "."
binary_name: "dtap"
extra_files: LICENSE README.md
release-darwin-amd64:
name: release darwin/amd64
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: darwin
goarch: amd64
project_path: "."
binary_name: "dtap"
extra_files: LICENSE README.md
release-darwin-arm64:
name: release darwin/arm64
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: darwin
goarch: arm64
project_path: "."
binary_name: "dtap"
extra_files: LICENSE README.md
30 changes: 0 additions & 30 deletions .github/workflows/go-release.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- run: sudo apt update && sudo apt install -y libpcap-dev
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Test
run: go test -v ./...
run: |
go install github.com/onsi/ginkgo/v2/ginkgo
ginkgo run --label-filter='!privileged' ./...
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM golang:1.21-alpine as base
WORKDIR /build
RUN apk --update --no-cache add git gcc musl-dev
RUN apk --update --no-cache add git gcc musl-dev libpcap-dev
COPY go.mod .
COPY go.sum .
RUN go mod download

FROM base as builder
WORKDIR /build
COPY . .
RUN go build
RUN go build -ldflags '-extldflags=-static'

FROM alpine:3.18

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ checks:
golangci-lint run

test:
go test ./...
ginkgo run ./...

build:
go build
Expand Down
1 change: 1 addition & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- [nats](https://pkg.go.dev/github.com/mimuret/dtap/v2/pkg/plugin/input/nats#Nats)
- [tcp](https://pkg.go.dev/github.com/mimuret/dtap/v2/pkg/plugin/input/tcp#TCPSocket)
- [unix](https://pkg.go.dev/github.com/mimuret/dtap/v2/pkg/plugin/input/unix#UnixSocket)
- [pcap](https://pkg.go.dev/github.com/mimuret/dtap/v2/pkg/plugin/input/pcap#PCAP)

## output plugins

Expand Down
15 changes: 15 additions & 0 deletions example/pcap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
LogLevel: debug
Inputs:
- Name: "pcap"
ID: "input_pcap_0"
Device: "en0"
LogLevel: "info"
ClientQueryEnabled: true
ClientResponseEnabled: true
ResolverResponseEnabled: true
ResolverQueryEnabled: true
OutputGroups:
- Name: "og0"
Outputs:
- Name: "stdout"
ID: "og0_stdout_0"
32 changes: 17 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ module github.com/mimuret/dtap/v2

go 1.21

require go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 // indirect

require github.com/nats-io/nats-server/v2 v2.9.23

require (
github.com/Shopify/sarama v1.30.0
github.com/dangkaka/go-kafka-avro v0.0.0-20181108134201-d57aece51a15
Expand All @@ -10,13 +14,13 @@ require (
github.com/fluent/fluent-logger-golang v1.9.0
github.com/go-kit/log v0.2.1
github.com/goccy/go-json v0.10.2
github.com/google/gopacket v1.1.19
github.com/grafana/loki v1.6.2-0.20230120172107-15b382294ed1
github.com/linkedin/goavro v2.1.0+incompatible
github.com/miekg/dns v1.1.55
github.com/mimuret/dnsutils v1.10.0
github.com/nats-io/nats-server/v2 v2.9.21
github.com/miekg/dns v1.1.56
github.com/mimuret/dnsutils v1.11.0
github.com/nats-io/nats.go v1.28.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/ginkgo/v2 v2.13.0
github.com/onsi/gomega v1.27.10
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.16.0
Expand Down Expand Up @@ -56,7 +60,6 @@ require (
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
Expand All @@ -69,13 +72,15 @@ require (
github.com/go-openapi/strfmt v0.21.3 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/validate v0.22.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/googleapis v1.4.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/gogo/status v1.1.1 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20221102093814-76f304f74e5e // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/grafana/dskit v0.0.0-20230109170026-7242706251b9 // indirect
github.com/grafana/regexp v0.0.0-20221005093135-b4c2bcb0a4b6 // indirect
Expand Down Expand Up @@ -117,10 +122,9 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/nats-io/jwt/v2 v2.4.1 // indirect
github.com/nats-io/jwt/v2 v2.5.0 // indirect
github.com/nats-io/nkeys v0.4.4 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e // indirect
github.com/opentracing-contrib/go-stdlib v1.0.0 // indirect
Expand All @@ -140,7 +144,7 @@ require (
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/testify v1.8.1 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/tinylib/msgp v1.1.6 // indirect
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
Expand All @@ -150,25 +154,23 @@ require (
go.etcd.io/etcd/client/pkg/v3 v3.5.4 // indirect
go.etcd.io/etcd/client/v3 v3.5.4 // indirect
go.mongodb.org/mongo-driver v1.11.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 // indirect
go.opentelemetry.io/otel v1.11.1 // indirect
go.opentelemetry.io/otel/metric v0.33.0 // indirect
go.opentelemetry.io/otel/trace v1.11.1 // indirect
go.opentelemetry.io/otel v1.18.0 // indirect
go.opentelemetry.io/otel/metric v1.18.0 // indirect
go.opentelemetry.io/otel/trace v1.18.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/goleak v1.2.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.3 // indirect
golang.org/x/tools v0.13.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c // indirect
google.golang.org/grpc v1.50.1 // indirect
gopkg.in/linkedin/goavro.v1 v1.0.5 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading