diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 4d3867e..0000000 --- a/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM alpine:3.4 -MAINTAINER Jan Broer - -ADD https://github.com/janeczku/go-dnsmasq/releases/download/1.0.7/go-dnsmasq-min_linux-amd64 /go-dnsmasq -RUN chmod +x /go-dnsmasq - -ENV DNSMASQ_LISTEN=0.0.0.0 -EXPOSE 53 53/udp -ENTRYPOINT ["/go-dnsmasq"] diff --git a/Dockerfile.build b/Dockerfile.build deleted file mode 100644 index d87d9a7..0000000 --- a/Dockerfile.build +++ /dev/null @@ -1,24 +0,0 @@ -FROM golang:1.5 - -# TODO: Vendor these `go get` commands using Godep. -RUN \ - go get github.com/mitchellh/gox && \ - go get github.com/aktau/github-release && \ - go get github.com/pwaller/goupx && \ - go get github.com/codegangsta/cli && \ - go get github.com/coreos/go-systemd/activation && \ - go get github.com/miekg/dns && \ - go get github.com/rcrowley/go-metrics && \ - go get github.com/rcrowley/go-metrics/stathat && \ - go get github.com/Sirupsen/logrus && \ - go get github.com/stathat/go - -ENV USER root - -ADD . /go/src/github.com/janeczku/go-dnsmasq - -COPY scripts/upx /usr/local/bin/ - -RUN chmod +x /usr/local/bin/upx - -WORKDIR /go/src/github.com/janeczku/go-dnsmasq diff --git a/README.md b/README.md index cbe8f53..1283c04 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,9 @@ # go-dnsmasq -[![Latest Version](https://img.shields.io/github/release/janeczku/go-dnsmasq.svg?maxAge=60)][release] -[![Github All Releases](https://img.shields.io/github/downloads/janeczku/go-dnsmasq/total.svg?maxAge=86400)]() -[![Docker Pulls](https://img.shields.io/docker/pulls/janeczku/go-dnsmasq.svg?maxAge=86400)][hub] -[![License](https://img.shields.io/github/license/janeczku/go-dnsmasq.svg?maxAge=86400)]() +[![Latest Version](https://img.shields.io/github/release/claranet/go-dnsmasq.svg?maxAge=60)][release] +[![Github All Releases](https://img.shields.io/github/downloads/claranet/go-dnsmasq/total.svg?maxAge=86400)]() +[![License](https://img.shields.io/github/license/claranet/go-dnsmasq.svg?maxAge=86400)]() -[release]: https://github.com/janeczku/go-dnsmasq/releases -[hub]: https://hub.docker.com/r/janeczku/go-dnsmasq/ +[release]: https://github.com/claranet/go-dnsmasq/releases go-dnsmasq is a lightweight (1.2 MB) DNS caching server/forwarder with minimal filesystem and runtime overhead. @@ -87,7 +85,7 @@ Set to your StatHat account email address #### Run from the command line -Download the binary for your OS from the [releases page](https://github.com/janeczku/go-dnsmasq/releases/latest). +Download the binary for your OS from the [releases page](https://github.com/claranet/go-dnsmasq/releases/latest). go-dnsmasq is available in two versions. The minimal version (`go-dnsmasq-min`) has a lower memory footprint but doesn't have caching, stats reporting and systemd support. diff --git a/control/control.go b/control/control.go index 7ce8f31..ffe4c47 100644 --- a/control/control.go +++ b/control/control.go @@ -5,8 +5,8 @@ import ( "fmt" "net/http" - "github.com/janeczku/go-dnsmasq/server" - "github.com/janeczku/go-dnsmasq/cache" + "github.com/claranet/go-dnsmasq/server" + "github.com/claranet/go-dnsmasq/cache" log "github.com/sirupsen/logrus" ) diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..42c6f9d --- /dev/null +++ b/go.mod @@ -0,0 +1,20 @@ +module github.com/claranet/go-dnsmasq + +go 1.21.6 + +require ( + github.com/codegangsta/cli v1.20.0 + github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf + github.com/miekg/dns v1.1.61 + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 + github.com/sirupsen/logrus v1.9.3 +) + +require ( + github.com/stathat/go v1.0.0 // indirect + golang.org/x/mod v0.18.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/tools v0.22.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..d748c2d --- /dev/null +++ b/go.sum @@ -0,0 +1,30 @@ +github.com/codegangsta/cli v1.20.0 h1:iX1FXEgwzd5+XN6wk5cVHOGQj6Q3Dcp20lUeS4lHNTw= +github.com/codegangsta/cli v1.20.0/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkbQ3slBdOA= +github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU= +github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs= +github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/stathat/go v1.0.0 h1:HFIS5YkyaI6tXu7JXIRRZBLRvYstdNZm034zcCeaybI= +github.com/stathat/go v1.0.0/go.mod h1:+9Eg2szqkcOGWv6gfheJmBBsmq9Qf5KDbzy8/aYYR0c= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/hostsfile/hostsfile.go b/hostsfile/hostsfile.go index 50bd013..56e7bb6 100644 --- a/hostsfile/hostsfile.go +++ b/hostsfile/hostsfile.go @@ -2,6 +2,8 @@ // Use of this source code is governed by The MIT License (MIT) that can be // found in the LICENSE file. +// Fork 2024 maintaining MIT License (MIT) + // Package hosts provides address lookups from local hostfile (usually /etc/hosts). package hosts diff --git a/hostsfile/utils.go b/hostsfile/utils.go index a3c2428..a5386f5 100644 --- a/hostsfile/utils.go +++ b/hostsfile/utils.go @@ -2,6 +2,8 @@ // Use of this source code is governed by The MIT License (MIT) that can be // found in the LICENSE file. +// Fork 2024 maintaining MIT License (MIT) + package hosts import ( diff --git a/main.go b/main.go index 20d0c85..ffd5485 100644 --- a/main.go +++ b/main.go @@ -2,7 +2,9 @@ // Use of this source code is governed by The MIT License (MIT) that can be // found in the LICENSE file. -package main // import "github.com/janeczku/go-dnsmasq" +// Fork 2024 maintaining MIT License (MIT) + +package main import ( "fmt" @@ -21,11 +23,11 @@ import ( "github.com/codegangsta/cli" "github.com/miekg/dns" - "github.com/janeczku/go-dnsmasq/hostsfile" - "github.com/janeczku/go-dnsmasq/resolvconf" - "github.com/janeczku/go-dnsmasq/server" - "github.com/janeczku/go-dnsmasq/control" - "github.com/janeczku/go-dnsmasq/stats" + "github.com/claranet/go-dnsmasq/hostsfile" + "github.com/claranet/go-dnsmasq/resolvconf" + "github.com/claranet/go-dnsmasq/server" + "github.com/claranet/go-dnsmasq/control" + "github.com/claranet/go-dnsmasq/stats" ) // set at build time @@ -48,7 +50,7 @@ func init() { func main() { app := cli.NewApp() app.Name = "go-dnsmasq" - app.Usage = "Lightweight caching DNS server and forwarder\n Website: http://github.com/janeczku/go-dnsmasq" + app.Usage = "Lightweight caching DNS server and forwarder\n Website: http://github.com/janeczku/go-dnsmasq, http://github.com/claranet/go-dnsmasq" app.UsageText = "go-dnsmasq [global options]" app.Version = Version app.Author, app.Email = "", "" diff --git a/scripts/build b/scripts/build index 9f2f2e0..aca0cf8 100755 --- a/scripts/build +++ b/scripts/build @@ -25,7 +25,7 @@ git checkout master sleep 2 docker run --rm \ - -v `pwd`:/go/src/github.com/janeczku/go-dnsmasq \ + -v `pwd`:/go/src/github.com/claranet/go-dnsmasq \ ${BUILD_IMAGE_NAME} \ gox \ -os "$GOOS" \ diff --git a/scripts/build-min b/scripts/build-min index 1e4647a..f25c678 100755 --- a/scripts/build-min +++ b/scripts/build-min @@ -25,7 +25,7 @@ git checkout minimal sleep 2 docker run --rm \ - -v `pwd`:/go/src/github.com/janeczku/go-dnsmasq \ + -v `pwd`:/go/src/github.com/claranet/go-dnsmasq \ ${BUILD_IMAGE_NAME} \ gox \ -os "$GOOS" \ diff --git a/scripts/build-remote b/scripts/build-remote index 6dd7989..87914af 100755 --- a/scripts/build-remote +++ b/scripts/build-remote @@ -14,7 +14,7 @@ BUILD_CONTAINER=$(docker run -d \ -arch "$GOARCH" \ -output="go-dnsmasq_{{.OS}}-{{.Arch}}" \ -tags="netgo" \ - -ldflags="-w -s -X github.com/janeczku/go-dnsmasq/main.Version `git describe --tags`") + -ldflags="-w -s -X github.com/claranet/go-dnsmasq/main.Version `git describe --tags`") cleanup_container() { docker rm -v ${BUILD_CONTAINER} } @@ -36,4 +36,4 @@ for f in $(docker run --rm ${BUILT_IMAGE} sh -c 'echo go-dnsmasq_*'); do echo " "${f} docker cp ${BUILD_CONTAINER}:/go/src/github.com/docker/machine/${f} ./ done -echo Done \ No newline at end of file +echo Done diff --git a/scripts/release b/scripts/release index e31f4ab..1e7206b 100755 --- a/scripts/release +++ b/scripts/release @@ -28,16 +28,16 @@ scripts/build-min $VERSION # UPX compression echo "Packing binaries with UPX..." for BINARY in go-dnsmasq*_linux*; do - docker run --rm -v `pwd`:/go/src/github.com/janeczku/go-dnsmasq \ + docker run --rm -v `pwd`:/go/src/github.com/claranet/go-dnsmasq \ go-dnsmasq-build goupx $BINARY done for BINARY in go-dnsmasq*_darwin*; do - docker run --rm -v `pwd`:/go/src/github.com/janeczku/go-dnsmasq \ + docker run --rm -v `pwd`:/go/src/github.com/claranet/go-dnsmasq \ go-dnsmasq-build upx $BINARY done echo "Generating file hashs..." -docker run --rm -v `pwd`:/go/src/github.com/janeczku/go-dnsmasq go-dnsmasq-build ./scripts/generate-sums +docker run --rm -v `pwd`:/go/src/github.com/claranet/go-dnsmasq go-dnsmasq-build ./scripts/generate-sums echo "Uploading release..." docker run --rm -e GITHUB_TOKEN go-dnsmasq-build github-release release \ --user janeczku \ @@ -47,7 +47,7 @@ docker run --rm -e GITHUB_TOKEN go-dnsmasq-build github-release release \ --description "" \ --pre-release for BINARY in go-dnsmasq*_*; do - docker run --rm -e GITHUB_TOKEN -v `pwd`:/go/src/github.com/janeczku/go-dnsmasq \ + docker run --rm -e GITHUB_TOKEN -v `pwd`:/go/src/github.com/claranet/go-dnsmasq \ go-dnsmasq-build github-release upload \ --user janeczku \ --repo go-dnsmasq \ diff --git a/server/config.go b/server/config.go index 9d58ab9..b04baec 100644 --- a/server/config.go +++ b/server/config.go @@ -2,6 +2,8 @@ // Use of this source code is governed by The MIT License (MIT) that can be // found in the LICENSE file. +// Fork 2024 maintaining MIT License (MIT) + package server import ( diff --git a/server/forwarding.go b/server/forwarding.go index 949c0e4..74fff71 100644 --- a/server/forwarding.go +++ b/server/forwarding.go @@ -2,6 +2,8 @@ // Use of this source code is governed by The MIT License (MIT) that can be // found in the LICENSE file. +// Fork 2024 maintaining MIT License (MIT) + package server import ( diff --git a/server/server.go b/server/server.go index af3972e..51c11e2 100644 --- a/server/server.go +++ b/server/server.go @@ -3,6 +3,8 @@ // Use of this source code is governed by The MIT License (MIT) that can be // found in the LICENSE file. +// Fork 2024 maintaining MIT License (MIT) + package server import ( @@ -14,7 +16,7 @@ import ( log "github.com/sirupsen/logrus" "github.com/coreos/go-systemd/activation" - "github.com/janeczku/go-dnsmasq/cache" + "github.com/claranet/go-dnsmasq/cache" "github.com/miekg/dns" ) diff --git a/server/server_test.go b/server/server_test.go index df1eee0..6fd27cc 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -15,7 +15,7 @@ package server "time" "github.com/miekg/dns" - "github.com/janeczku/go-dnsmasq/cache" + "github.com/claranet/go-dnsmasq/cache" ) // Keep global port counter that increments with 10 for each diff --git a/stats/graphite.go b/stats/graphite.go index 80e5e54..2d723b1 100644 --- a/stats/graphite.go +++ b/stats/graphite.go @@ -13,7 +13,7 @@ import ( "github.com/rcrowley/go-metrics" "github.com/rcrowley/go-metrics/stathat" - "github.com/janeczku/go-dnsmasq/server" + "github.com/claranet/go-dnsmasq/server" log "github.com/sirupsen/logrus" )