Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
buglloc committed Aug 4, 2023
1 parent eac7fe7 commit de6fcd4
Show file tree
Hide file tree
Showing 11 changed files with 290 additions and 298 deletions.
13 changes: 0 additions & 13 deletions cmd/dns-gateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,12 @@ import (
"fmt"
"os"

"github.com/AdguardTeam/urlfilter/rules"
_ "go.uber.org/automaxprocs"

"github.com/buglloc/DNSGateway/internal/commands"
)

// Syntax: https://github.com/AdguardTeam/AdGuardHome/wiki/Hosts-Blocklists#adblock-style
//// examples:
//// ||4.3.2.1.in-addr.arpa^$dnsrewrite=NOERROR;PTR;example.net.
//// ||2.0.0.0.0.0.0.0.4.f.7.0.0.0.0.0.0.0.4.3.0.0.0.0.8.b.6.0.2.0.a.2.ip6.arpa^$dnsrewrite=NOERROR;PTR;example.net.
//// ||ya.ru^$dnsrewrite=NOERROR;A;1.2.3.3
//// ||ya.ru^$dnsrewrite=NOERROR;AAAA;::1
//
//NewNetworkRule

func main() {
rr, err := rules.NewNetworkRule("||ya.ru^$dnsrewrite=NOERROR;AAAA;::1", 0)
fmt.Println(rr.DNSRewrite.RRType, err)
os.Exit(0)
if err := commands.Execute(); err != nil {
_, _ = fmt.Fprintf(os.Stderr, "%v\n", err)
os.Exit(1)
Expand Down
39 changes: 2 additions & 37 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,77 +4,42 @@ go 1.20

require (
github.com/buglloc/certifi v0.9.1
github.com/deepmap/oapi-codegen v1.13.2
github.com/go-resty/resty/v2 v2.7.0
github.com/knadh/koanf/parsers/yaml v0.1.0
github.com/knadh/koanf/providers/env v0.1.0
github.com/knadh/koanf/providers/file v0.1.0
github.com/knadh/koanf/v2 v2.0.1
github.com/labstack/echo/v4 v4.11.1
github.com/miekg/dns v1.1.55
github.com/rs/zerolog v1.30.0
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.4
go.uber.org/automaxprocs v1.5.3
)

require (
github.com/AdguardTeam/golibs v0.10.4 // indirect
github.com/AdguardTeam/urlfilter v0.16.1 // indirect
github.com/alecthomas/participle v0.7.1 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/getkin/kin-openapi v0.118.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.9.1 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/invopop/yaml v0.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/labstack/echo/v4 v4.11.1 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/perimeterx/marshmallow v1.1.4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/tools v0.11.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit de6fcd4

Please sign in to comment.