Compare commits

..

11 commits

Author SHA1 Message Date
32cce1f248
[SKIP CI] feat(goreleaser): Target termux too 2023-05-16 18:27:42 +02:00
2695ec7ddb
[SKIP CI] docs(readme): Update packaging location
Signed-off-by: Sam Therapy <sam@samtherapy.net>
2023-05-16 18:27:42 +02:00
ac20b18b98
feat(ci): use my new package utility instead of pages 2023-05-16 18:27:42 +02:00
18b831c84d
feat(goreleaser): Enable APK and RPM
Gitea supports them now so add them!
2023-05-16 18:27:42 +02:00
7427cb0f4a
fix(deps): update module golang.org/x/net to v0.10.0 2023-05-16 18:27:42 +02:00
aaa97bbd84
fix(deps): update module golang.org/x/sys to v0.8.0 2023-05-16 18:27:42 +02:00
6d48d74979
fix(deps): update module github.com/quic-go/quic-go to v0.34.0
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-01 17:39:35 +02:00
9049cfd7c1
fix(deps): update module github.com/miekg/dns to v1.1.54 2023-05-01 17:39:35 +02:00
7429c66e59
fix(gomod): Explicitly require 1.19 2023-05-01 17:39:35 +02:00
83ceb56653
fix(trace): Remove wrong error message
Reverse queries *are* actually supported, so the error message was wrong
Even dig supports it naturally.
2023-05-01 17:39:35 +02:00
ed0cdf6a6f
refactor: move config and cmd to internal
Some checks failed
continuous-integration/drone/push Build is failing
They don't need to be exposed to the outside world
2023-04-18 16:36:37 +02:00
52 changed files with 590 additions and 668 deletions

176
.drone.jsonnet Normal file
View file

@ -0,0 +1,176 @@
// SPDX-License-Identifier: BSD-3-Clause
local testing(version, arch) = {
kind: 'pipeline',
type: 'docker',
name: '%s-%s' % [version, arch],
platform: {
arch: arch,
},
steps: [
{
name: 'lint',
image: 'golangci/golangci-lint',
commands: [
'golangci-lint run ./...',
],
},
{
name: 'cache',
image: 'golang:%s' % [version],
commands: [
'go mod tidy',
],
depends_on: [
'lint',
],
volumes: [
{
name: 'cache',
path: '/go',
},
],
},
{
name: 'test',
image: 'golang:%s' % [version],
commands: [
'make test-ci',
],
depends_on: [
'cache',
],
volumes: [
{
name: 'cache',
path: '/go',
},
],
},
{
name: 'fuzz',
image: 'golang:%s' % [version],
commands: [
'make fuzz-ci',
],
depends_on: [
'cache',
],
volumes: [
{
name: 'cache',
path: '/go',
},
],
},
],
trigger: {
event: {
exclude: [
'tag',
],
},
},
volumes: [
{
name: 'cache',
temp: {},
},
],
};
// "Inspired by" https://goreleaser.com/ci/drone/
local release() = {
kind: 'pipeline',
type: 'docker',
name: 'release',
clone: {
disable: true,
},
trigger: {
event: [
'tag',
],
},
steps: [
{
name: 'clone',
image: 'woodpeckerci/plugin-git',
settings: {
tags: true,
},
},
{
name: 'test',
image: 'golang',
commands: [
'make test-ci',
],
volumes: [
{
name: 'cache',
path: '/go',
},
],
},
{
name: 'release',
image: 'goreleaser/goreleaser',
environment: {
GITEA_TOKEN: {
from_secret: 'GITEA_TOKEN',
},
},
commands: [
'apk add --no-cache scdoc',
'goreleaser release',
],
volumes: [
{
name: 'cache',
path: '/go',
},
],
},
{
name: 'package',
image: 'git.freecumextremist.com/notsam/drone-gitea-push-packages',
settings: {
base_url: 'https://git.froth.zone',
owner: 'sam',
project_name: 'awl',
package_name: 'awl-dns',
username: 'sam',
password: {
from_secret: 'GITEA_TOKEN',
},
architectures: [
'amd64',
'arm64',
'386',
'armv6'
],
package_types: [
'deb',
'apk',
'rpm'
]
},
},
],
volumes: [
{
name: 'cache',
temp: {},
},
],
};
[
testing('1.19', 'amd64'),
testing('1.19', 'arm64'),
testing('1.20', 'amd64'),
testing('1.20', 'arm64'),
release(),
]

View file

@ -1,35 +0,0 @@
name: Forgejo Release
on:
push:
tags:
- "*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Install scdoc
run: apt-get update && apt-get install -y scdoc
- name: Release with GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean -p 1 --skip docker,snapcraft
env:
GORELEASER_FORCE_TOKEN: gitea
GITEA_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
UPLOAD_PACKAGES_SECRET: ${{ secrets.PUBLISH_TOKEN }}

View file

@ -1,14 +0,0 @@
name: Mirror Push
on: push
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url: git@git.sr.ht:~sammefishe/awl
ssh_private_key: ${{ secrets.SRHT_SSH_KEY }}

View file

@ -1,24 +0,0 @@
name: Test
on: push
jobs:
test:
strategy:
fail-fast: true
matrix:
goVer: ["oldstable", "stable"]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goVer }}
- name: Test
run: make test-ci

View file

@ -4,53 +4,32 @@ on:
push:
tags:
- "*"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
release:
runs-on: ubuntu-latest
env:
SNAPCRAFT_STORE_CREDENTIALS : ${{ secrets.SNAPCRAFT_TOKEN }}
steps:
# Workaround a dumb docker problem where everything has to be lowercase
- id: lowercase
run: |
echo IMAGE_NAME=$(echo $IMAGE_NAME | tr '[:upper:]' '[:lower:]') >> "${GITHUB_ENV}"
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v3
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v4
with:
go-version: stable
go-version: '>=1.20.1'
- name: Install scdoc
run: sudo apt-get install -y scdoc
- name: Workaround a dumb Snap bug
run: mkdir -p $HOME/.cache/snapcraft/download && mkdir -p $HOME/.cache/snapcraft/stage-packages
- name: Release with GoReleaser
uses: goreleaser/goreleaser-action@v6
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean --skip=aur,homebrew,nix,scoop
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -7,18 +7,19 @@ jobs:
fail-fast: true
matrix:
platform: [macos, windows]
goVer: ["oldstable", "stable"]
goVer: ["1.19.x", "1.20.x"]
runs-on: ${{ matrix.platform }}-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.goVer }}
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Test
run: make test-ci

4
.gitignore vendored
View file

@ -23,7 +23,7 @@ coverage/*
!coverage/.gitkeep
awl
docs/awl.1
docs/awl.1.gz
doc/awl.1
doc/awl.1.gz
.dccache

4
.gitmodules vendored
View file

@ -1,3 +1,3 @@
[submodule "docs/wiki"]
path = docs/wiki
[submodule "doc/wiki"]
path = doc/wiki
url = ../awl.wiki

View file

@ -1,4 +1,3 @@
version: 2
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
before:
@ -6,7 +5,7 @@ before:
- make clean
- go mod tidy
# Make manpages
- docs/makeman.sh
- doc/makeman.sh
# Vendor dependencies
- go mod vendor
@ -18,26 +17,21 @@ builds:
- plan9_amd64
- freebsd_amd64
universal_binaries:
- replace: true
archives:
- files:
- LICENSE
- LICENCE
- completions/**
- docs/awl.1.gz
- doc/awl.1.gz
name_template: >-
{{ .ProjectName }}_
{{- if eq .Os "darwin" }}MacOS_
{{- else if eq .Os "freebsd" }}FreeBSD_
{{- else }}{{- title .Os }}_{{ end }}
{{- if eq .Arch "386" }}i386
{{- else if eq .Arch "mips64" }}mips64_hardfloat
{{- else if eq .Arch "mips64le" }}mips64le_hardfloat
{{- else }}{{ .Arch }}{{ end -}}
{{- .Arch }}
format_overrides:
- goos: windows
format: zip
rlcp: true
- files:
- vendor/**
id: vendor
@ -45,156 +39,20 @@ archives:
name_template: "{{ .ProjectName }}-{{ .Version }}-deps"
meta: true
wrap_in_directory: "{{ .ProjectName }}"
rlcp: true
nfpms:
- id: packages
package_name: awl-dns
vendor: Sam Therapy <sam@samtherapy.net>
maintainer: Sam Therapy <sam@samtherapy.net>
homepage: https://dns.froth.zone/awl
description: |-
Command-line DNS query tool.
Awl supports DNS-over-[UDP,TCP,HTTPS,QUIC] and DNSCrypt.
license: BSD-3-Clause
section: utils
bindir: /usr/bin
formats:
- apk
- archlinux
- deb
- rpm
contents:
- src: completions/bash.bash
dst: /usr/share/bash-completion/completions/awl
- src: docs/awl.1.gz
dst: /usr/share/man/man1/awl.1.gz
- src: LICENSE
dst: /usr/share/docs/awl/copyright
- src: completions/fish.fish
dst: /usr/share/fish/vendor_completions.d/awl.fish
# DEB only
- src: completions/zsh.zsh
dst: /usr/share/zsh/vendor-completions/_awl
packager: deb
# Alpine .apk only
- src: completions/zsh.zsh
dst: /usr/share/zsh/site-functions/_awl
packager: apk
# RPM only
- src: completions/zsh.zsh
dst: /usr/share/zsh/site-functions/_awl
packager: rpm
deb:
lintian_overrides:
- statically-linked-binary
- changelog-file-missing-in-native-package
overrides:
deb:
file_name_template: >-
{{- .PackageName }}_
{{- .Version }}_
{{- if eq .Arch "386" }}i386
{{- else if eq .Arch "arm" }}armel
{{- else }}{{ .Arch }}{{ end -}}
rpm:
file_name_template: >-
{{- .PackageName }}-
{{- .Version }}-
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i686
{{- else if eq .Arch "arm" }}armhfp
{{- else if eq .Arch "arm64" }}aarch64
{{- else }}{{ .Arch }}{{ end -}}
- id: termux
package_name: awl-dns
vendor: Sam Therapy <sam@samtherapy.net>
maintainer: Sam Therapy <sam@samtherapy.net>
homepage: https://dns.froth.zone/awl
description: |-
Command-line DNS query tool.
Awl supports DNS-over-[UDP,TCP,HTTPS,QUIC] and DNSCrypt.
license: BSD-3-Clause
section: utils
formats:
- termux.deb
file_name_template: >-
{{- .PackageName }}_
{{- .Version }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i686
{{- else if eq .Arch "arm" }}arm
{{- else if eq .Arch "arm64" }}aarch64
{{- else }}{{ .Arch }}{{ end -}}
snapcrafts:
-
name: awl-dns
grade: stable
publish: true
summary: A command-line DNS query tool
description: |-
Awl is a command-line DNS query tool.
Awl supports DNS-over-[UDP,TCP,HTTPS,QUIC] and DNSCrypt.
confinement: strict
license: BSD-3-Clause
base: bare
apps:
awl-dns:
command: awl
plugs:
- network
completer: completions/bash.bash
dockers:
-
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:latest"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}:{{ .Tag }}"
universal_binaries:
- replace: true
checksum:
name_template: "checksums.txt"
snapshot:
version_template: "{{ incpatch .Version }}-next"
brews:
- repository:
owner: packaging
name: homebrew
homepage: https://dns.froth.zone/awl
description: A DNS query tool
license: BSD-3-Clause
# custom_block: |
# head "https://git.froth.zone/sam/awl.git"
install: |-
bin.install "awl"
bash_completion.install "completions/bash.bash" => "awl"
zsh_completion.install "completions/zsh.zsh" => "_awl"
fish_completion.install "completions/fish.fish" => "awl.fish"
man1.install "docs/awl.1.gz"
nix:
- repository:
owner: packaging
name: nur
homepage: https://dns.froth.zone/awl
description: A DNS query client
license: bsd3
extra_install: |-
installManPage ./docs/awl.1.gz
installShellCompletion ./completions/*
scoops:
- repository:
owner: packaging
name: scoop
directory: bucket
homepage: https://dns.froth.zone/awl
description: A DNS query client
license: BSD-3-Clause
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
groups:
- title: "Dependency Updates"
regexp: "^.*fix\\(deps\\)*:+.*$"
@ -207,6 +65,7 @@ changelog:
order: 1
- title: "Other"
order: 999
filters:
exclude:
- "^test:"
@ -214,23 +73,69 @@ changelog:
- "typo"
- "^ci:"
uploads:
- name: packages
method: PUT
mode: archive
exts:
brews:
- tap:
owner: sam
name: homebrew
homepage: https://dns.froth.zone/awl
description: A DNS query tool
license: BSD-3-Clause
# custom_block: |
# head "https://git.froth.zone/sam/awl.git"
install: |-
bin.install "awl"
bash_completion.install "completions/bash.bash" => "awl"
zsh_completion.install "completions/zsh.zsh" => "_awl"
fish_completion.install "completions/fish.fish" => "awl.fish"
man1.install "doc/awl.1.gz"
scoops:
- bucket:
owner: sam
name: scoop
folder: bucket
homepage: https://dns.froth.zone/awl
description: A DNS query client
license: BSD-3-Clause
nfpms:
- id: packages
maintainer: Sam <sam@samtherapy.net>
homepage: https://dns.froth.zone/awl
package_name: awl-dns
description: |-
Command-line DNS query tool.
Awl supports DNS-over-[UDP,TCP,HTTPS,QUIC] and DNSCrypt.
license: BSD-3-Clause
bindir: /usr/bin
section: utils
formats:
- deb
- rpm
- apk
- termux.deb
username: sam
target: >-
https://git.froth.zone/api/packages/sam/
{{- if eq .ArtifactExt "deb" }}debian/pool/sid/main/upload
{{- else if eq .ArtifactExt "termux.deb" }}debian/pool/termux/main/upload
{{- else if eq .ArtifactExt "rpm" }}rpm/upload
{{- else if eq .ArtifactExt "apk" }}alpine/edge/main{{ end -}}
custom_artifact_name: true # Truncate the artifact name from the upload URL
contents:
- src: completions/bash.bash
dst: /usr/share/bash-completion/completions/awl
- src: completions/zsh.zsh
dst: /usr/share/zsh/vendor-completions/_awl
packager: deb
- src: completions/zsh.zsh
dst: /usr/share/zsh/site-functions/_awl
packager: apk
- src: completions/zsh.zsh
dst: /usr/share/zsh/site-functions/_awl
packager: rpm
- src: completions/fish.fish
dst: /usr/share/fish/vendor_completions.d/awl.fish
- src: doc/awl.1.gz
dst: /usr/share/man/man1/awl.1.gz
- src: LICENCE
dst: /usr/share/doc/awl/copyright
deb:
lintian_overrides:
- statically-linked-binary
- changelog-file-missing-in-native-package
gitea_urls:
api: https://git.froth.zone/api/v1

View file

@ -1,3 +0,0 @@
FROM scratch
ENTRYPOINT ["/awl"]
COPY awl /

View file

@ -22,7 +22,7 @@ install:
else
install: all
install -$(INSTALLFLAGS)m755 $(PROG) $(DESTDIR)$(PREFIX)/$(BIN)/$(PROG)
install -$(INSTALLFLAGS)m644 docs/$(PROG).1 $(DESTDIR)$(MAN)/man1/$(PROG).1
install -$(INSTALLFLAGS)m644 doc/$(PROG).1 $(DESTDIR)$(MAN)/man1/$(PROG).1
# completions need to go in one specific place :)
install -$(INSTALLFLAGS)m644 completions/bash.bash $(DESTDIR)$(PREFIX)/$(SHARE)/bash-completion/completions/$(PROG)
install -$(INSTALLFLAGS)m644 completions/fish.fish $(DESTDIR)$(PREFIX)/$(SHARE)/fish/vendor_completions.d/$(PROG).fish

View file

@ -1,11 +1,11 @@
Copyright 2022 Sam Therapy, Gregward Bulon
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
Copyright 2022 Sam Therapy, Gregward Bulon
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -9,7 +9,7 @@ EXE := $(PROG)
.PHONY: install
install: all
install -Dm755 $(PROG) $(DESTDIR)$(PREFIX)/$(BIN)/$(PROG)
install -Dm644 docs/$(PROG).1 $(DESTDIR)$(MAN)/man1/$(PROG).1
install -Dm644 doc/$(PROG).1 $(DESTDIR)$(MAN)/man1/$(PROG).1
# completions need to go in one specific place :)
install -Dm644 completions/bash.bash $(DESTDIR)$(PREFIX)$(SHARE)/bash-completion/completions/$(PROG)
install -Dm644 completions/fish.fish $(DESTDIR)$(PREFIX)$(SHARE)/fish/vendor_completions.d/$(PROG).fish

246
README.md
View file

@ -1,194 +1,98 @@
<!-- markdownlint-disable MD033 -->
# <img src="./docs/img/awl-text.png" width="50%" title="awl logo" alt="awl">
# awl
> awl *(noun)*: A pointed tool for making small holes in wood or leather
[![Build Status](https://ci.git.froth.zone/api/badges/sam/awl/status.svg)](https://ci.git.froth.zone/sam/awl)
A command-line DNS lookup tool that supports DNS queries over UDP, TCP, TLS, HTTPS, DNSCrypt, and QUIC.
`awl` is a command-line DNS client, much like
[`drill`](https://github.com/NLnetLabs/ldns),
[`dig`](https://bind9.readthedocs.io/en/v9_18_3/manpages.html#dig-dns-lookup-utility),
[`dog`](https://github.com/ogham/dog),
[`doggo`](https://github.com/mr-karan/doggo), or
[`q`](https://github.com/natesales/q).
[![Gitea Release](https://img.shields.io/gitea/v/release/sam/awl?gitea_url=https%3A%2F%2Fgit.froth.zone&display_name=release&style=for-the-badge)](https://git.froth.zone/sam/awl)
[![Last Commit](https://img.shields.io/gitea/last-commit/sam/awl?gitea_url=https%3A%2F%2Fgit.froth.zone&style=for-the-badge)](https://git.froth.zone/sam/awl/commits/branch/master)
[![License](https://img.shields.io/github/license/samtherapy/awl?style=for-the-badge)](https://spdx.org/licenses/BSD-3-Clause.html)
[![Go Report](https://goreportcard.com/badge/dns.froth.zone/awl?style=for-the-badge)](https://goreportcard.com/report/dns.froth.zone/awl)
`awl` is designed to be a drop-in replacement for the venerable dig, but support
newer RFC query types, such as DNS-over-HTTPS and DNS-over-QUIC.
Awl is designed to be a drop-in replacement for [dig](https://bind9.readthedocs.io/en/v9_18_3/manpages.html#dig-dns-lookup-utility).
## Usage
## Examples
- [Feature wiki](https://git.froth.zone/sam/awl/wiki/Supported)
- [Manpage](https://git.froth.zone/sam/awl/wiki/awl.1)
```shell
# Query a domain over UDP
awl example.com
## Building and installing
# Query a domain over HTTPS, print only the results
awl example.com +https --short
### From releases
# Query a domain over TLS, print as JSON
awl example.com +tls +json
```
Grab a prebuilt binary from the
[release](https://git.froth.zone/sam/awl/releases) section.
For more and the usage, see the [manpage](https://git.froth.zone/sam/awl/wiki/awl.1).
### Package Managers
## Installing
- AUR: [awl-dns-git](https://aur.archlinux.org/packages/awl-dns-git)
- Debian/Ubuntu (any .deb consuming distro should work):
On any platform, with [Go](https://go.dev) installed, run the following command to install:
```sh
# Add PGP key
sudo curl https://git.froth.zone/api/packages/sam/debian/repository.key -o /usr/share/keyrings/git-froth-zone.asc
# Add repo
echo "deb [signed-by=/usr/share/keyrings/git-froth-zone.asc] https://git.froth.zone/api/packages/sam/debian sid main" | sudo tee /etc/apt/sources.list.d/git-froth-zone.list
sudo apt update
sudo apt install awl-dns
```
```shell
- Fedora (any .rpm consuming distro should work):
```sh
dnf config-manager --add-repo https://git.froth.zone/api/packages/sam/rpm/sam.repo
dnf install awl-dns
```
- Alpine (any .apk consuming distro should work):
```sh
echo "https://git.froth.zone/api/packages/sam/alpine/edge/main" | sudo tee -a /etc/apk/repositories
sudo curl -JO https://git.froth.zone/api/packages/sam/alpine/key --output-dir /etc/apk/keys
sudo apk add awl-dns
```
- Homebrew:
```sh
brew install SamTherapy/tap/awl
```
- Scoop:
```pwsh
scoop bucket add froth https://git.froth.zone/sam/scoop.git
scoop install awl
```
### From source
Dependencies:
- [Go](https://go.dev/) >= 1.18
- GNU/BSD make or Plan 9 mk (if using the makefile/mkfile)
- [scdoc](https://git.sr.ht/~sircmpwn/scdoc) (optional, for man page)
Using `go install`:
```sh
go install dns.froth.zone/awl@latest
```
### Packaging
Using the makefile:
Alternatively, many package managers are supported:
<details>
<summary>Linux</summary>
#### Distro-specific
<details>
<summary>Alpine Linux</summary>
Provided by [Gitea packages](https://git.froth.zone/sam/-/packages/alpine/awl-dns) \
***Any distro that uses apk should also work***
```shell
# Add the repository
echo "https://git.froth.zone/api/packages/sam/alpine/edge/main" | tee -a /etc/apk/repositories
# Get the signing key
curl -JO https://git.froth.zone/api/packages/sam/alpine/key --output-dir /etc/apk/keys
# Install
apk add awl-dns
```sh
make && sudo make install
```
</details>
<details>
<summary>Arch</summary>
AUR package available as [awl-dns-git](https://aur.archlinux.org/packages/awl-dns-git/)
```shell
yay -S awl-dns-git ||
paru -S awl-dns-git
```
</details>
<details>
<summary>Debian / Ubuntu</summary>
Provided by [Gitea packages](https://git.froth.zone/sam/-/packages/debian/awl-dns/) \
***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
# Update and install
sudo apt update
sudo apt install awl-dns
```
</details>
<details>
<summary>Fedora / RHEL / SUSE</summary>
Provided by [Gitea packages](https://git.froth.zone/sam/-/packages/rpm/awl-dns/) \
***Any distro that uses rpm/dnf might also work, I've never tried it***
```shell
# Add the repository
dnf config-manager --add-repo https://git.froth.zone/api/packages/sam/rpm.repo ||
zypper addrepo https://git.froth.zone/api/packages/sam/rpm.repo
# Install
dnf install awl-dns ||
zypper install awl-dns
```
</details>
<details>
<summary>Gentoo</summary>
```shell
# Add the ebuild repository
eselect repository add froth-zone git https://git.froth.zone/packaging/portage.git
emaint sync -r froth-zone
# Install
emerge -av net-dns/awl
```
</details>
#### Distro-agnostic
<details>
<summary><a href="https://brew.sh" nofollow>Homebrew</a></summary>
```shell
brew install SamTherapy/tap/awl
```
</details>
<details>
<summary>Snap</summary>
Snap package available as [awl-dns](https://snapcraft.io/awl-dns)
```shell
snap install awl-dns ||
sudo snap install awl-dns
```
</details>
</details>
<hr />
<details>
<summary>macOS</summary>
<details open>
<summary><a href="https://brew.sh" nofollow>Homebrew</a></summary>
```shell
brew install SamTherapy/tap/awl
```
</details>
</details>
<hr />
<details>
<summary>Windows</summary>
<details open>
<summary><a href="https://scoop.sh" nofollow>Scoop</a></summary>
```pwsh
scoop bucket add froth https://git.froth.zone/packages/scoop.git
scoop install awl
```
</details>
</details>
## Contributing
Please see the [CONTRIBUTING.md](./docs/CONTRIBUTING.md) file for more information.
Send a [pull request](https://git.froth.zone/sam/awl/pulls) our way. Prefer
emails? Send a patch to the
[mailing list](https://lists.sr.ht/~sammefishe/awl-dev).
TL;DR: If you like the project, spread the word! If you want to contribute, [use the issue tracker](https://git.froth.zone/sam/awl/issues) or [open a pull request](https://git.froth.zone/sam/awl/pulls).
Want to use email instead? Use our [mailing list](https://lists.sr.ht/~sammefishe/awl-devel)!
Found a bug or want a new feature? Create an issue
[here](https://git.froth.zone/sam/awl/issues).
### Mirrors
### Licence
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).
Contributions are accepted on all mirrors, but the Forgejo instance is preferred.
## License
[BSD-3-Clause](https://spdx.org/licenses/BSD-3-Clause.html)
### Credits
- Awl image taken from [Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Awl.tif), imaged is licensed CC0.
Revised BSD, See [LICENCE](./LICENCE)

View file

@ -259,4 +259,4 @@ This man page is probably not complete.
Likely numerous more, report them either to the tracker
_https://git.froth.zone/sam/awl/issues_ or via email
_~sammefishe/awl-develop@lists.sr.ht_
_~sammefishe/awl-dev@lists.sr.ht_

7
doc/makeman.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
set -e
rm -f doc/awl.1.gz
scdoc <doc/awl.1.scd >doc/awl.1
gzip -9 -n doc/awl.1

View file

View file

@ -1 +0,0 @@
/dev/null

View file

@ -1,57 +0,0 @@
# Contributing to awl
First off, thank you! We appreciate your interest in wanting to contribute to awl.
> If you like the project, spread the word! Help us grow by sharing the project with anyone you thing might be interested. Here are some ways you can help:
>
> - Star the project on GitHub
> - Share the project on social media
> - Tell your friends about the project
## How to contribute
If you want to contribute to awl, you can do so by:
- [Reporting a bug](#reporting-a-bug)
- [Requesting a feature](#requesting-a-feature)
- [Submitting a pull request](#submitting-a-pull-request)
### Reporting a bug
If you find a bug in awl, please [open an issue](https://git.froth.zone/sam/awl/issues) on the project's issue tracker. When reporting a bug, please include as much information as possible, such as:
- The version of awl you are using
- The operating system you are using
- The steps to reproduce the bug
- Any error messages you received
### Requesting a feature
If you have an idea for a feature you would like to see in awl, please [open an issue](https://git.froth.zone/sam/awl/issues) on the project's issue tracker. When requesting a feature, please include as much information as possible, such as:
- A description of the feature
- Why you think the feature would be useful
- Any other relevant information
### Submitting a pull request
If you would like to contribute code to awl, you can do so by submitting a pull request. To submit a pull request, follow these steps:
1. Fork the project on Git
2. Create a new branch for your changes
3. Make your changes
4. Push your changes to your fork
5. [Open a pull request](https://git.froth.zone/sam/awl/pulls) on the project's Git repository
When submitting a pull request, please include as much information as possible, such as:
- A description of the changes you made
- Why you made the changes
- Any other relevant information
Alternatively, you can also contribute by sending an email to the project's [mailing list](https://lists.sr.ht/~sammefishe/awl-devel). For more information about using Git over email, refer to [git-send-email.io](https://git-send-email.io/)
#### Code Style
Before submitting a pull request, please run `make lint` to ensure your code adheres to the project's code style.
Make sure that you have `golangci-lint` installed, that is our linter of choice.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 505 KiB

View file

@ -1,7 +0,0 @@
#!/bin/sh
set -e
rm -f docs/awl.1.gz
scdoc <docs/awl.1.scd >docs/awl.1
gzip -9 -n docs/awl.1

40
go.mod
View file

@ -1,31 +1,33 @@
module dns.froth.zone/awl
go 1.22.5
go 1.19
require (
dns.froth.zone/dnscrypt v0.0.2
dns.froth.zone/dnscrypt v0.0.1
github.com/dchest/uniuri v1.2.0
github.com/miekg/dns v1.1.62
github.com/quic-go/quic-go v0.48.1
github.com/miekg/dns v1.1.54
github.com/quic-go/quic-go v0.34.0
github.com/stefansundin/go-zflag v1.1.1
golang.org/x/net v0.31.0
golang.org/x/sys v0.27.0
golang.org/x/net v0.10.0
golang.org/x/sys v0.8.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools/v3 v3.5.1
gotest.tools/v3 v3.4.0
)
require (
github.com/AdguardTeam/golibs v0.25.1 // indirect
github.com/AdguardTeam/golibs v0.13.2 // indirect
github.com/ameshkov/dnsstamps v1.0.3 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/google/go-cmp v0.6.0 // indirect
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.29.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.9.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/tools v0.23.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20230406165453-00490a63f317 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/onsi/ginkgo/v2 v2.9.2 // indirect
github.com/quic-go/qtls-go1-19 v0.3.2 // indirect
github.com/quic-go/qtls-go1-20 v0.2.2 // indirect
golang.org/x/crypto v0.8.0 // indirect
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/tools v0.8.0 // indirect
)

137
go.sum
View file

@ -1,60 +1,103 @@
dns.froth.zone/dnscrypt v0.0.2 h1:ytqjic/Qway4OuLw8ee0ubxdNzy+F3igUGDrEVwyLls=
dns.froth.zone/dnscrypt v0.0.2/go.mod h1:QZ0HAm7mWe8wz1dTqbKmTZhlr06x5qpe6ZCTPJ7uY30=
github.com/AdguardTeam/golibs v0.25.1 h1:po5dBbFCoZAySsbsMN/ZRB0WTLYDA1d8BxPgvriu/EA=
github.com/AdguardTeam/golibs v0.25.1/go.mod h1:HaTyS2wCbxFudjht9N/+/Qf1b5cMad2BAYSwe7DPCXI=
dns.froth.zone/dnscrypt v0.0.1 h1:plShBpr4lwQC9LNy6aUtKj4cyB1XSCrjutrUHdGIxtA=
dns.froth.zone/dnscrypt v0.0.1/go.mod h1:QZ0HAm7mWe8wz1dTqbKmTZhlr06x5qpe6ZCTPJ7uY30=
github.com/AdguardTeam/golibs v0.13.2 h1:BPASsyQKmb+b8VnvsNOHp7bKfcZl9Z+Z2UhPjOiupSc=
github.com/AdguardTeam/golibs v0.13.2/go.mod h1:7ylQLv2Lqsc3UW3jHoITynYk6Y1tYtgEMkR09ppfsN8=
github.com/ameshkov/dnsstamps v1.0.3 h1:Srzik+J9mivH1alRACTbys2xOxs0lRH9qnTA7Y1OYVo=
github.com/ameshkov/dnsstamps v1.0.3/go.mod h1:Ii3eUu73dx4Vw5O4wjzmT5+lkCwovjzaEZZ4gKyIH5A=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dchest/uniuri v1.2.0 h1:koIcOUdrTIivZgSLhHQvKgqdWZq5d7KdMEWF1Ud6+5g=
github.com/dchest/uniuri v1.2.0/go.mod h1:fSzm4SLHzNZvWLvWJew423PhAzkpNQYq+uNLq4kxhkY=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
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/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/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/pprof v0.0.0-20230406165453-00490a63f317 h1:hFhpt7CTmR3DX+b4R19ydQFtofxT0Sv3QsKNMVQYTMQ=
github.com/google/pprof v0.0.0-20230406165453-00490a63f317/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/miekg/dns v1.1.54 h1:5jon9mWcb0sFJGpnI99tOMhCPyJ+RPVz5b63MQG0VWI=
github.com/miekg/dns v1.1.54/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY=
github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU=
github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts=
github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
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.1 h1:y/8xmfWI9qmGTc+lBr4jKRUWLGSlSigv847ULJ4hYXA=
github.com/quic-go/quic-go v0.48.1/go.mod h1:yBgs3rWBOADpga7F+jJsb6Ybg1LSYiQvwWlLX+/6HMs=
github.com/quic-go/qtls-go1-19 v0.3.2 h1:tFxjCFcTQzK+oMxG6Zcvp4Dq8dx4yD3dDiIiyc86Z5U=
github.com/quic-go/qtls-go1-19 v0.3.2/go.mod h1:ySOI96ew8lnoKPtSqx2BlI5wCpUVPT05RMAlajtnyOI=
github.com/quic-go/qtls-go1-20 v0.2.2 h1:WLOPx6OY/hxtTxKV1Zrq20FtXtDEkeY00CGQm8GEa3E=
github.com/quic-go/qtls-go1-20 v0.2.2/go.mod h1:JKtK6mjbAVcUTN/9jZpvLbGxvdWIKS8uT7EiStoU1SM=
github.com/quic-go/quic-go v0.34.0 h1:OvOJ9LFjTySgwOTYUZmNoq0FzVicP8YujpV0kB7m2lU=
github.com/quic-go/quic-go v0.34.0/go.mod h1:+4CVgVppm0FNjpG3UcX8Joi/frKOH7/ciD5yGcwOO1g=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
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.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
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.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=
golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
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=
golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI=
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ=
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y=
golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o=
gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g=

View file

@ -6,7 +6,7 @@ import (
"testing"
"time"
cli "dns.froth.zone/awl/cmd"
cli "dns.froth.zone/awl/internal/cmd"
"dns.froth.zone/awl/pkg/util"
"gotest.tools/v3/assert"
)
@ -104,7 +104,7 @@ func TestVersion(t *testing.T) {
_, err := cli.ParseCLI(args, "test")
assert.ErrorIs(t, err, util.ErrNotError)
assert.ErrorType(t, err, util.ErrNotError)
}
func TestTimeout(t *testing.T) {

View file

@ -5,7 +5,7 @@ package cli_test
import (
"testing"
cli "dns.froth.zone/awl/cmd"
cli "dns.froth.zone/awl/internal/cmd"
"dns.froth.zone/awl/pkg/util"
"gotest.tools/v3/assert"
)

View file

@ -7,7 +7,7 @@ import (
"math/rand"
"strings"
"dns.froth.zone/awl/conf"
"dns.froth.zone/awl/internal/conf"
"dns.froth.zone/awl/pkg/util"
"github.com/miekg/dns"
"golang.org/x/net/idna"
@ -35,11 +35,6 @@ func ParseMiscArgs(args []string, opts *util.Options) error {
opts.HTTPS = true
opts.Request.Server = arg
opts.Logger.Info("DNS-over-HTTPS implicitly set")
_, endpoint, isSplit := strings.Cut(arg, "/")
if isSplit {
opts.HTTPSOptions.Endpoint = "/" + endpoint
}
case strings.HasPrefix(arg, "quic://"):
opts.QUIC = true
opts.Request.Server = strings.TrimPrefix(arg, "quic://")
@ -83,6 +78,7 @@ func ParseMiscArgs(args []string, opts *util.Options) error {
opts.Logger.Info(arg, "detected as a domain name")
opts.Request.Name, err = idna.ToASCII(arg)
if err != nil {
return fmt.Errorf("unicode to punycode: %w", err)
}
@ -98,6 +94,7 @@ func ParseMiscArgs(args []string, opts *util.Options) error {
opts.Logger.Info(arg, "is unknown. Assuming domain")
opts.Request.Name, err = idna.ToASCII(arg)
if err != nil {
return fmt.Errorf("unicode to punycode: %w", err)
}
@ -130,7 +127,7 @@ func ParseMiscArgs(args []string, opts *util.Options) error {
case opts.HTTPS:
opts.Request.Server = "https://dns.cloudflare.com"
case opts.QUIC:
opts.Request.Server = "dns.froth.zone"
opts.Request.Server = "dns.adguard.com"
default:
var err error
resolv, err := conf.GetDNSConfig()

View file

@ -3,10 +3,9 @@
package cli_test
import (
"strings"
"testing"
cli "dns.froth.zone/awl/cmd"
cli "dns.froth.zone/awl/internal/cmd"
"dns.froth.zone/awl/pkg/util"
"github.com/miekg/dns"
"gotest.tools/v3/assert"
@ -90,7 +89,7 @@ func TestDefaultServer(t *testing.T) {
{"DNSCrypt", "sdns://AQMAAAAAAAAAETk0LjE0MC4xNC4xNDo1NDQzINErR_JS3PLCu_iZEIbq95zkSV2LFsigxDIuUso_OQhzIjIuZG5zY3J5cHQuZGVmYXVsdC5uczEuYWRndWFyZC5jb20"},
{"TLS", "dns.google"},
{"HTTPS", "https://dns.cloudflare.com"},
{"QUIC", "dns.froth.zone"},
{"QUIC", "dns.adguard.com"},
}
for _, test := range tests {
@ -129,7 +128,6 @@ func TestFlagSetting(t *testing.T) {
{"@sdns://AQMAAAAAAAAAETk0LjE0MC4xNC4xNDo1NDQzINErR_JS3PLCu_iZEIbq95zkSV2LFsigxDIuUso_OQhzIjIuZG5zY3J5cHQuZGVmYXVsdC5uczEuYWRndWFyZC5jb20", "sdns://AQMAAAAAAAAAETk0LjE0MC4xNC4xNDo1NDQzINErR_JS3PLCu_iZEIbq95zkSV2LFsigxDIuUso_OQhzIjIuZG5zY3J5cHQuZGVmYXVsdC5uczEuYWRndWFyZC5jb20", "DNSCrypt"},
{"@tls://dns.google", "dns.google", "TLS"},
{"@https://dns.cloudflare.com/dns-query", "https://dns.cloudflare.com/dns-query", "HTTPS"},
{"@https://dns.example.net/a", "https://dns.example.net/a", "HTTPS with a set path"},
{"@quic://dns.adguard.com", "dns.adguard.com", "QUIC"},
{"@tcp://dns.froth.zone", "dns.froth.zone", "TCP"},
{"@udp://dns.example.com", "dns.example.com", "UDP"},
@ -146,23 +144,23 @@ func TestFlagSetting(t *testing.T) {
err := cli.ParseMiscArgs([]string{test.in}, opts)
assert.NilError(t, err)
switch {
case strings.HasPrefix(test.over, "DNSCrypt"):
switch test.over {
case "DNSCrypt":
assert.Assert(t, opts.DNSCrypt)
assert.Equal(t, opts.Request.Server, test.expected)
case strings.HasPrefix(test.over, "TLS"):
case "TLS":
assert.Assert(t, opts.TLS)
assert.Equal(t, opts.Request.Server, test.expected)
case strings.HasPrefix(test.over, "HTTPS"):
case "HTTPS":
assert.Assert(t, opts.HTTPS)
assert.Equal(t, opts.Request.Server, test.expected)
case strings.HasPrefix(test.over, "QUIC"):
case "QUIC":
assert.Assert(t, opts.QUIC)
assert.Equal(t, opts.Request.Server, test.expected)
case strings.HasPrefix(test.over, "TCP"):
case "TCP":
assert.Assert(t, opts.TCP)
assert.Equal(t, opts.Request.Server, test.expected)
case strings.HasPrefix(test.over, "UDP"):
case "UDP":
assert.Assert(t, true)
assert.Equal(t, opts.Request.Server, test.expected)
}

View file

@ -7,7 +7,7 @@ import (
"runtime"
"testing"
"dns.froth.zone/awl/conf"
"dns.froth.zone/awl/internal/conf"
"gotest.tools/v3/assert"
)

View file

@ -9,7 +9,7 @@ import (
"runtime"
"testing"
"dns.froth.zone/awl/conf"
"dns.froth.zone/awl/internal/conf"
"gotest.tools/v3/assert"
)

View file

@ -7,7 +7,7 @@ import (
"runtime"
"testing"
"dns.froth.zone/awl/conf"
"dns.froth.zone/awl/internal/conf"
"gotest.tools/v3/assert"
)

View file

@ -10,7 +10,7 @@ import (
"strings"
"time"
cli "dns.froth.zone/awl/cmd"
cli "dns.froth.zone/awl/internal/cmd"
"dns.froth.zone/awl/pkg/query"
"dns.froth.zone/awl/pkg/util"
"github.com/miekg/dns"

8
mkfile
View file

@ -1,12 +1,10 @@
# SPDX-License-Identifier: BSD-3-Clause
# Plan 9 mkfile
</$objtype/mkfile
GO = go
PROG = awl
VERSION = `{awk '{print substr($0,0,8)}' .git/refs/heads/master}
GOFLAGS = -ldflags=-s -ldflags=-w -ldflags=-X=main.version=$VERSION -trimpath
GOFLAGS = -ldflags=-s -ldflags=-w -ldflags=-X=main.version=PLAN9 -trimpath
CGO_ENABLED = 0
@ -17,7 +15,7 @@ $PROG:
install:V:
$GO install $GOFLAGS .
# cp docs/$PROG.1 /sys/man/1/$PROG
# cp doc/$PROG.1 /sys/man/1/$PROG
test:V:
$GO test -v -cover ./...

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

@ -4,7 +4,6 @@ package query_test
import (
"testing"
"time"
"dns.froth.zone/awl/pkg/query"
"dns.froth.zone/awl/pkg/util"
@ -101,7 +100,6 @@ func TestCreateQ(t *testing.T) {
Type: dns.TypeA,
Name: "example.com.",
Retries: 3,
Timeout: time.Second,
},
Display: util.Display{
Comments: true,

View file

@ -61,7 +61,7 @@ type Answer struct {
// EDNS0 is for all EDNS options.
//
// RFC: https://datatracker.ietf.org/docs/draft-peltan-edns-presentation-format/
// RFC: https://datatracker.ietf.org/doc/draft-peltan-edns-presentation-format/
//
//nolint:govet,tagliatelle
type EDNS0 struct {

View file

@ -1,14 +1,12 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build !gccgo
package resolvers
import (
"context"
"crypto/tls"
"encoding/binary"
"fmt"
"io"
"strings"
"time"
"dns.froth.zone/awl/pkg/util"
@ -33,27 +31,18 @@ func (resolver *QUICResolver) LookUp(msg *dns.Msg) (resp util.Response, err erro
NextProtos: []string{"doq"},
}
// Make sure that TLSHost is ALWAYS set
if resolver.opts.TLSHost == "" {
tls.ServerName = strings.Split(resolver.opts.Request.Server, ":")[0]
}
conf := new(quic.Config)
conf.HandshakeIdleTimeout = resolver.opts.Request.Timeout
resolver.opts.Logger.Debug("quic: making query")
ctx, cancel := context.WithTimeout(context.Background(), resolver.opts.Request.Timeout)
defer cancel()
connection, err := quic.DialAddr(ctx, resolver.opts.Request.Server, tls, conf)
connection, err := quic.DialAddr(resolver.opts.Request.Server, tls, conf)
if err != nil {
return resp, fmt.Errorf("doq: dial: %w", err)
}
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 +60,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 +92,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

@ -0,0 +1,26 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build gccgo
// TODO: Whenever gccgo supports quic-go, delete this
package resolvers
import (
"errors"
"dns.froth.zone/awl/pkg/util"
"github.com/miekg/dns"
)
// QUICResolver is for DNS-over-QUIC queries.
type QUICResolver struct {
opts *util.Options
}
var _ Resolver = (*QUICResolver)(nil)
var errNotImplemented = errors.New("DNS-over-QUIC not supported when running gccgo!")
// LookUp cannot be used with gccgo because gccgo does not (and likely will not) support generics.
func (resolver *QUICResolver) LookUp(msg *dns.Msg) (util.Response, error) {
return util.Response{}, errNotImplemented
}

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

@ -62,6 +62,7 @@ func (resolver *StandardResolver) LookUp(msg *dns.Msg) (resp util.Response, err
msg.Extra = resp.DNS.Extra
resp.DNS, resp.RTT, err = dnsClient.Exchange(msg, resolver.opts.Request.Server)
if err != nil {
return resp, fmt.Errorf("badcookie: DNS exchange: %w", err)
}

View file

@ -31,11 +31,7 @@ func LoadResolver(opts *util.Options) (resolver Resolver, err error) {
opts.Request.Server = "https://" + opts.Request.Server
}
// Make sure that the endpoint is defaulted to /dns-query
if !strings.HasSuffix(opts.Request.Server, opts.HTTPSOptions.Endpoint) {
opts.Request.Server += opts.HTTPSOptions.Endpoint
}
opts.Request.Server += opts.HTTPSOptions.Endpoint
resolver = &HTTPSResolver{
opts: opts,
}

View file

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

41
snap/snapcraft.yaml Normal file
View file

@ -0,0 +1,41 @@
# You may ask yourself, why make a snap?
# why not?
name: awl
base: core20
adopt-info: awl
license: BSD-3-Clause
summary: A command-line DNS query tool.
description: |
awl is a command line DNS tool, much like dig and drill.
grade: devel
confinement: strict
architectures:
- build-on: amd64
- build-on: arm64
- build-on: s390x
- build-on: ppc64el
- build-on: armhf
parts:
awl:
build-packages:
- scdoc
plugin: go
source-type: git
source: https://git.froth.zone/sam/awl
override-pull: |
snapcraftctl pull
snapcraftctl set-version "$(git describe --always | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || echo 'UNKNOWN')"
override-build: |
HASH=$(git describe --always | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || echo 'UNKNOWN')+snap make
PREFIX=$SNAPCRAFT_PART_INSTALL make install
apps:
awl:
command: bin/awl
completer: share/bash-completion/completions/awl
plugs:
- network

View file

@ -23,19 +23,19 @@ MAN ?= $(PREFIX)/$(SHARE)/man
PROG ?= awl
# hehe
all: $(PROG) docs/$(PROG).1
all: $(PROG) doc/$(PROG).1
$(PROG): $(SOURCES)
$(GO) build -o $(EXE) $(GOFLAGS) .
docs/$(PROG).1: docs/$(PROG).1.scd
doc/$(PROG).1: doc/$(PROG).1.scd
$(SCDOC) <$? >$@
docs/wiki/$(PROG).1.md: docs/$(PROG).1
doc/wiki/$(PROG).1.md: doc/$(PROG).1
pandoc --from man --to gfm -o $@ $?
## update_doc: update documentation (requires pandoc)
update_doc: docs/wiki/$(PROG).1.md
update_doc: doc/wiki/$(PROG).1.md
.PHONY: fmt
fmt:
@ -87,9 +87,8 @@ cover: coverage/cover.html
clean:
$(GO) clean
# Ignore errors if you remove something that doesn't exist
rm -f docs/$(PROG).1
rm -f doc/$(PROG).1
rm -f coverage/cover*
rm -rf vendor
## help: Prints this help message
.PHONY: help