summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO24
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD49
-rw-r--r--dnsproxy.service14
-rw-r--r--dnsproxy.yaml18
5 files changed, 78 insertions, 31 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 167b4210a55b..f0f387c65a4a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,20 @@
pkgbase = dnsproxy
- pkgdesc = A simple DNS proxy server, runing on multiple platform
- pkgver = git+f03234a
+ pkgdesc = Simple DNS proxy with DoH, DoT, DoQ and DNSCrypt support
+ pkgver = 0.49.1
pkgrel = 1
- url = https://github.com/vietor/dnsproxy
- arch = any
- license = GPL
+ url = https://github.com/AdguardTeam/dnsproxy
+ arch = x86_64
+ license = Apache
+ makedepends = go
makedepends = git
- makedepends = make
- source = git+https://github.com/vietor/dnsproxy.git
- md5sums = SKIP
+ conflicts = dnsproxy-bin
+ conflicts = dnsproxy-adguard
+ backup = etc/dnsproxy/dnsproxy.yaml
+ source = dnsproxy.service
+ source = dnsproxy.yaml
+ source = https://github.com/AdguardTeam/dnsproxy/archive/v0.49.1.tar.gz
+ sha256sums = 565eea9808589ecafa81f2229ac1f85b39028e26d488a9a7c0b51afc43d7f42b
+ sha256sums = 72937969cc68182672e945fb26a6e350772a421463a4593c113d2f89af0b922c
+ sha256sums = c587a7e88660c879f738df1ffcbf0402928a0c04ec0f148e385017f176e8ba14
pkgname = dnsproxy
-
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..93aaf34849d0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/src
+/pkg
+*.pkg.tar*
+*.tar.gz
diff --git a/PKGBUILD b/PKGBUILD
index 335a395dc3b9..dc469afd5b47 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,30 +1,35 @@
-# Maintainer: Edward Pacman <micro <dot> fedora AT gmail DOT com>
+# Contributor: Whyme Lyu <callme5long@gmail.com>
+
pkgname=dnsproxy
-pkgver=git+f03234a
+pkgver=0.49.1
pkgrel=1
-pkgdesc="A simple DNS proxy server, runing on multiple platform"
-arch=('any')
-url="https://github.com/vietor/dnsproxy"
-license=('GPL')
-makedepends=('git'
- 'make')
-source=("git+https://github.com/vietor/dnsproxy.git")
-md5sums=("SKIP")
+pkgdesc="Simple DNS proxy with DoH, DoT, DoQ and DNSCrypt support"
+arch=('x86_64')
+url="https://github.com/AdguardTeam/dnsproxy"
+license=('Apache')
+conflicts=('dnsproxy-bin' 'dnsproxy-adguard')
+source=("dnsproxy.service"
+ "dnsproxy.yaml"
+ "https://github.com/AdguardTeam/dnsproxy/archive/v${pkgver}.tar.gz")
+makedepends=("go" "git")
+sha256sums=('565eea9808589ecafa81f2229ac1f85b39028e26d488a9a7c0b51afc43d7f42b'
+ '72937969cc68182672e945fb26a6e350772a421463a4593c113d2f89af0b922c'
+ 'c587a7e88660c879f738df1ffcbf0402928a0c04ec0f148e385017f176e8ba14')
-prepare() {
- cd "$pkgname"
- git submodule init
- git submodule update
-}
+_conf=etc/dnsproxy/dnsproxy.yaml
+backup=($_conf)
-build() {
- cd "$pkgname"
- make
+build(){
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ go build
}
package() {
- cd "$pkgname"
- mkdir -p "$pkgdir/usr/bin"
- cp src/dnsproxy $pkgdir/usr/bin
-}
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ 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.service b/dnsproxy.service
new file mode 100644
index 000000000000..34860ff54250
--- /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 000000000000..b65e46f0b7e1
--- /dev/null
+++ b/dnsproxy.yaml
@@ -0,0 +1,18 @@
+# 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