commit 6fffe4d99eabcc29dc520987cc7c668fd98e37a3 Author: Fijxu Date: Sat Apr 8 02:59:47 2023 -0400 Init diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..2fd4c29 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = dnsproxy-git + pkgdesc = Simple DNS proxy with DoH, DoT, DoQ and DNSCrypt support (git version) + pkgver = 0.48.3.r751.f8f22ab + pkgrel = 1 + url = https://github.com/AdguardTeam/dnsproxy + arch = any + license = Apache + makedepends = git + makedepends = go + provides = dnsproxy + conflicts = dnsproxy-bin + conflicts = dnsproxy-adguard + source = dnsproxy-git::git+https://github.com/AdguardTeam/dnsproxy.git + source = dnsproxy.yaml + source = dnsproxy.service + sha256sums = SKIP + sha256sums = 9d8a7088bb101114397dd299c19d690f0356a6787844c2b4ca7358612dd1b594 + sha256sums = 565eea9808589ecafa81f2229ac1f85b39028e26d488a9a7c0b51afc43d7f42b + +pkgname = dnsproxy-git diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..d0c865d --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,40 @@ +# Maintainer: Fijxu zzls xyz> +pkgname=dnsproxy-git +_pkgname=dnsproxy +pkgver=0.48.3.r751.f8f22ab +pkgrel=1 +pkgdesc="Simple DNS proxy with DoH, DoT, DoQ and DNSCrypt support (git version)" +arch=('any') +url="https://github.com/AdguardTeam/dnsproxy" +license=('Apache') +makedepends=('git' 'go') +provides=('dnsproxy') +conflicts=(dnsproxy-bin dnsproxy-adguard) +source=("dnsproxy-git::git+https://github.com/AdguardTeam/dnsproxy.git" + "dnsproxy.yaml" + "dnsproxy.service") +sha256sums=("SKIP" + "9d8a7088bb101114397dd299c19d690f0356a6787844c2b4ca7358612dd1b594" + "565eea9808589ecafa81f2229ac1f85b39028e26d488a9a7c0b51afc43d7f42b") +_conf=etc/dnsproxy/dnsproxy.yaml + +pkgver() { + cd "$srcdir/$_pkgname" + printf "0.48.3.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +build() { + cd "$_pkgname" + go build -mod=vendor -v +} + +# Thanks "5long" for the package(), configuration files and systemd service +package() { + cd "$srcdir/$_pkgname" + install -Dm755 dnsproxy "$pkgdir"/usr/bin/dnsproxy + install -Dm644 LICENSE "$pkgdir"/usr/share/license/dnsproxy/LICENSE + install -Dm644 README.md "$pkgdir"/usr/share/doc/dnsproxy/README.md + install -Dm644 $srcdir/dnsproxy.yaml "$pkgdir/$_conf" + install -Dm644 $srcdir/dnsproxy.service "$pkgdir"/usr/lib/systemd/system/dnsproxy.service +} + diff --git a/dnsproxy-git.install b/dnsproxy-git.install new file mode 100644 index 0000000..fe560b6 --- /dev/null +++ b/dnsproxy-git.install @@ -0,0 +1,7 @@ +post_remove() { + cat << EOF + +==> Edit the /etc/dnsproxy/dnsproxy.yaml file after using or enabling the dnsproxy systemd service. + +EOF +} \ No newline at end of file diff --git a/dnsproxy.service b/dnsproxy.service new file mode 100644 index 0000000..34860ff --- /dev/null +++ b/dnsproxy.service @@ -0,0 +1,14 @@ +[Unit] +Description=Simple DNS proxy with DoH, DoT, and DNSCrypt support +Documentation=https://github.com/AdguardTeam/dnsproxy#readme +After=network.target +Before=network-online.target + +[Service] +AmbientCapabilities=CAP_NET_BIND_SERVICE +CapabilityBoundingSet=CAP_NET_BIND_SERVICE +DynamicUser=yes +ExecStart=/usr/bin/dnsproxy --config-path=/etc/dnsproxy/dnsproxy.yaml + +[Install] +WantedBy=multi-user.target diff --git a/dnsproxy.yaml b/dnsproxy.yaml new file mode 100644 index 0000000..fa4b15e --- /dev/null +++ b/dnsproxy.yaml @@ -0,0 +1,19 @@ +# Any command-line options specified will override the values from the +# config file + +--- +## Required +# upstream: # At least one upstream is required +# - 1.1.1.1:53 + +## Recommended +tls-min-version: 1.2 +http3: true # dnsproxy automatically picks the fastest HTTP(S) protocol +refuse-any: true + +## Optional +# listen-addrs: # Defaults to 0.0.0.0 which is prone to conflict +# - 127.0.0.56 +# cache: true # Caching is disabled by default +# verbose: true # Increase verbosity for debugging +