Compare commits

..

No commits in common. "master" and "v0.6.13" have entirely different histories.

11 changed files with 49 additions and 46 deletions

View file

@ -28,7 +28,7 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --clean -p 1 --skip docker,snapcraft
args: release --clean --skip docker,snapcraft
env:
GORELEASER_FORCE_TOKEN: gitea
GITEA_TOKEN: ${{ secrets.PUBLISH_TOKEN }}

View file

@ -33,7 +33,7 @@ jobs:
submodules: recursive
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v3
uses: samuelmeuli/action-snapcraft@v2
- name: Set up Go
uses: actions/setup-go@v5

View file

@ -155,7 +155,7 @@ checksum:
name_template: "checksums.txt"
snapshot:
version_template: "{{ incpatch .Version }}-next"
name_template: "{{ incpatch .Version }}-next"
brews:
- repository:

View file

@ -80,10 +80,10 @@ Provided by [Gitea packages](https://git.froth.zone/sam/-/packages/debian/awl-dn
***Any distro that uses deb/dpkg should also work***
```shell
# Install the repository and GPG keys
curl -JO https://git.froth.zone/packaging/-/packages/debian/git-froth-zone-debian/1-0/files/5937
sudo dpkg -i git-froth-zone-debian_1-0_all.deb
rm git-froth-zone-debian_1-0_all.deb
# Add PGP key
sudo curl https://git.froth.zone/api/packages/sam/debian/repository.key -o /usr/share/keyrings/git-froth-zone-sam.asc
# Add repo
echo "deb [signed-by=/usr/share/keyrings/git-froth-zone-sam.asc] https://git.froth.zone/api/packages/sam/debian sid main" | sudo tee /etc/apt/sources.list.d/git-froth-zone-sam.list
# Update and install
sudo apt update
sudo apt install awl-dns
@ -182,7 +182,7 @@ Want to use email instead? Use our [mailing list](https://lists.sr.ht/~sammefish
### Mirrors
The canonical repository is located on [my personal Forgejo instance](https://git.froth.zone/sam/awl). \
Official mirrors are located on [GitHub](https://github.com/SamTherapy/awl), [GitLab](https://gitlab.com/SamTherapy/awl) and [SourceHut](https://git.sr.ht/~sammefishe/awl).
Official mirrors are located on [GitHub](https://github.com/SamTherapy/awl) and [SourceHut](https://git.sr.ht/~sammefishe/awl/).
Contributions are accepted on all mirrors, but the Forgejo instance is preferred.
## License

14
go.mod
View file

@ -5,11 +5,11 @@ go 1.22.5
require (
dns.froth.zone/dnscrypt v0.0.2
github.com/dchest/uniuri v1.2.0
github.com/miekg/dns v1.1.62
github.com/quic-go/quic-go v0.48.2
github.com/miekg/dns v1.1.61
github.com/quic-go/quic-go v0.45.2
github.com/stefansundin/go-zflag v1.1.1
golang.org/x/net v0.33.0
golang.org/x/sys v0.28.0
golang.org/x/net v0.27.0
golang.org/x/sys v0.22.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools/v3 v3.5.1
)
@ -22,10 +22,10 @@ require (
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
github.com/onsi/ginkgo/v2 v2.19.1 // indirect
go.uber.org/mock v0.4.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/mod v0.19.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/tools v0.23.0 // indirect
)

28
go.sum
View file

@ -16,36 +16,36 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k=
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
github.com/miekg/dns v1.1.62 h1:cN8OuEF1/x5Rq6Np+h1epln8OiyPWV+lROx9LxcGgIQ=
github.com/miekg/dns v1.1.62/go.mod h1:mvDlcItzm+br7MToIKqkglaGhlFMHJ9DTNNWONWXbNQ=
github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs=
github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ=
github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0=
github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA=
github.com/onsi/gomega v1.34.0 h1:eSSPsPNp6ZpsG8X1OVmOTxig+CblTc4AxpPBykhe2Os=
github.com/onsi/gomega v1.34.0/go.mod h1:MIKI8c+f+QLWk+hxbePD4i0LMJSExPaZOVfkoex4cAo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/quic-go/quic-go v0.48.2 h1:wsKXZPeGWpMpCGSWqOcqpW2wZYic/8T3aqiOID0/KWE=
github.com/quic-go/quic-go v0.48.2/go.mod h1:yBgs3rWBOADpga7F+jJsb6Ybg1LSYiQvwWlLX+/6HMs=
github.com/quic-go/quic-go v0.45.2 h1:DfqBmqjb4ExSdxRIb/+qXhPC+7k6+DUNZha4oeiC9fY=
github.com/quic-go/quic-go v0.45.2/go.mod h1:1dLehS7TIR64+vxGR70GDcatWTOtMX2PUtnKsjbTurI=
github.com/stefansundin/go-zflag v1.1.1 h1:XabhzWS588bVvV1z1UctSa6i8zHkXc5W9otqtnDSHw8=
github.com/stefansundin/go-zflag v1.1.1/go.mod h1:HXX5rABl1AoTcZ2jw+CqJ7R8irczaLquGNZlFabZooc=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8=
golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
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.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg=

View file

@ -105,7 +105,7 @@ func TestRealPrint(t *testing.T) {
ShowQuery: true,
},
Request: util.Request{
Server: "https://dns.google/dns-query",
Server: "https://dns.froth.zone/dns-query",
Port: 443,
Type: dns.StringToType["NS"],
Class: 1,

View file

@ -96,7 +96,7 @@ func TestCreateQ(t *testing.T) {
QUIC: true,
Request: util.Request{
Server: "dns.adguard.com",
Server: "dns.froth.zone",
Port: 853,
Type: dns.TypeA,
Name: "example.com.",

View file

@ -5,7 +5,6 @@ package resolvers
import (
"context"
"crypto/tls"
"encoding/binary"
"fmt"
"io"
"strings"
@ -53,7 +52,6 @@ func (resolver *QUICResolver) LookUp(msg *dns.Msg) (resp util.Response, err erro
resolver.opts.Logger.Debug("quic: packing query")
msg.Id = 0
// Compress request to over-the-wire
buf, err := msg.Pack()
if err != nil {
@ -71,7 +69,7 @@ func (resolver *QUICResolver) LookUp(msg *dns.Msg) (resp util.Response, err erro
resolver.opts.Logger.Debug("quic: writing to stream")
_, err = stream.Write(rfc9250prefix(buf))
_, err = stream.Write(buf)
if err != nil {
return resp, fmt.Errorf("doq: quic stream write: %w", err)
}
@ -103,19 +101,10 @@ func (resolver *QUICResolver) LookUp(msg *dns.Msg) (resp util.Response, err erro
resolver.opts.Logger.Debug("quic: unpacking response")
// Unpack response and lop off the first two bytes (RFC 9250 moment)
err = resp.DNS.Unpack(fullRes[2:])
err = resp.DNS.Unpack(fullRes)
if err != nil {
return resp, fmt.Errorf("doq: unpack: %w", err)
}
return
}
// rfc9250prefix adds a two-byte prefix to the input data as per RFC 9250.
func rfc9250prefix(in []byte) []byte {
out := make([]byte, 2+len(in))
binary.BigEndian.PutUint16(out, uint16(len(in)))
copy(out[2:], in)
return out
}

View file

@ -35,6 +35,21 @@ func TestQuic(t *testing.T) {
},
},
},
{
"Valid, Froth",
&util.Options{
QUIC: true,
Logger: util.InitLogger(0),
Request: util.Request{
Server: "dns.froth.zone",
Type: dns.TypeA,
Name: "git.freecumextremist.com",
Port: 853,
Timeout: 750 * time.Millisecond,
Retries: 3,
},
},
},
{
"Bad domain",
&util.Options{
@ -92,7 +107,6 @@ func TestQuic(t *testing.T) {
res util.Response
err error
)
for i := 0; i <= test.opts.Request.Retries; i++ {
res, err = query.CreateQuery(test.opts)
if err == nil {

View file

@ -1,5 +1,5 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base", ":gomod", "group:allNonMajor"],
"extends": ["config:base", ":npm", ":gomod"],
"automerge": true
}