diff options
author | midnightix | 2021-06-20 00:04:14 +0800 |
---|---|---|
committer | midnightix | 2021-06-20 00:04:14 +0800 |
commit | 08b5c3af822dca5356b64b82fa7b3b33734bd444 (patch) | |
tree | 655c5b2cc954401b3d253e1243c592d433562c00 | |
download | aur-08b5c3af822dca5356b64b82fa7b3b33734bd444.tar.gz |
create the repository
-rw-r--r-- | .SRCINFO | 31 | ||||
-rw-r--r-- | PKGBUILD | 45 | ||||
-rw-r--r-- | clash-premium-tun.install | 30 | ||||
-rw-r--r-- | config.yaml | 32 |
4 files changed, 138 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..6f0ab129d0a0 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,31 @@ +pkgbase = clash-premium-tun + pkgdesc = A rule-based tunnel in Go + pkgver = 2021.05.08 + pkgrel = 1 + url = https://github.com/Dreamacro/clash + install = clash-premium-tun.install + arch = x86_64 + license = custom + makedepends = git + makedepends = gzip + depends = glibc + depends = clash-geoip + depends = iptables + depends = nftables + depends = systemd + depends = iproute2 + provides = clash + provides = clash-dev + provides = clash-dev-git + conflicts = clash + conflicts = clash-dev + conflicts = clash-dev-git + backup = etc/clash/config.yaml + source = git+https://github.com/Kr328/clash-premium-installer.git#commit=e729951 + source = https://github.com/Dreamacro/clash/releases/download/premium/clash-linux-amd64-2021.05.08.gz + source = config.yaml + sha256sums = SKIP + sha256sums = 82e640ffd2ea50f948fb4899aca9659e46dc0b648b739c431ae4b107554e4301 + sha256sums = 1552736c573d6722ed11654646a7ec2ea30b5ed3f4f2d3e9bbfb61227ad37026 + +pkgname = clash-premium-tun diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..fbbbd1626281 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,45 @@ +# Maintainer: midnightix <midnightix@protonmail.com> + +pkgname=clash-premium-tun +_pkgname=clash +pkgver=2021.05.08 +pkgrel=1 +pkgdesc="A rule-based tunnel in Go" +arch=('x86_64') +url="https://github.com/Dreamacro/clash" +license=('custom') +install=${pkgname}.install +depends=('glibc' 'clash-geoip' 'iptables' 'nftables' 'systemd' 'iproute2') +makedepends=('git' 'gzip') +provides=('clash' 'clash-dev' 'clash-dev-git') +conflicts=('clash' 'clash-dev' 'clash-dev-git') +backup=("etc/clash/config.yaml") +source=("git+https://github.com/Kr328/clash-premium-installer.git#commit=e729951" + "https://github.com/Dreamacro/clash/releases/download/premium/clash-linux-amd64-2021.05.08.gz" + "config.yaml") +sha256sums=('SKIP' + '82e640ffd2ea50f948fb4899aca9659e46dc0b648b739c431ae4b107554e4301' + '1552736c573d6722ed11654646a7ec2ea30b5ed3f4f2d3e9bbfb61227ad37026') + +prepare() { + cd "${srcdir}"/clash-premium-installer/scripts + sed -i "s/srv/etc/g" clash.service + sed -i "s/lib/share/g" clash.service + sed -i "s/lib/share/g" 99-clash.rules +} + +package() { + cd "${srcdir}" + gunzip --force clash-linux-amd64-2021.05.08.gz + install -Dm 755 clash-linux-amd64-2021.05.08 "${pkgdir}"/usr/bin/clash + install -Dm 644 ../config.yaml "${pkgdir}"/etc/clash/config.yaml + cd "${srcdir}"/clash-premium-installer/scripts + install -Dm 644 clash-default "${pkgdir}"/etc/default/clash + install -Dm 755 bypass-proxy-pid "${pkgdir}"/usr/bin/bypass-proxy-pid + install -Dm 755 bypass-proxy "${pkgdir}"/usr/bin/bypass-proxy + install -Dm 700 clean-tun.sh "${pkgdir}"/usr/share/clash/clean-tun.sh + install -Dm 700 setup-tun.sh "${pkgdir}"/usr/share/clash/setup-tun.sh + install -Dm 700 setup-cgroup.sh "${pkgdir}"/usr/share/clash/setup-cgroup.sh + install -Dm 644 99-clash.rules "${pkgdir}"/usr/lib/udev/rules.d/99-clash.rules + install -Dm 644 clash.service "${pkgdir}"/usr/lib/systemd/system/clash.service +} diff --git a/clash-premium-tun.install b/clash-premium-tun.install new file mode 100644 index 000000000000..d269f829dedb --- /dev/null +++ b/clash-premium-tun.install @@ -0,0 +1,30 @@ +post_install() { + systemctl daemon-reload + echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + echo "+ Install successfully +" + echo "+ +" + echo "+ Home directory at /etc/clash +" + echo "+ +" + echo "+ All dns traffic will be redirected to 1.0.0.1:53 +" + echo "+ Please use clash core's 'tun.dns-hijack' to handle it +" + echo "+ +" + echo "+ Use 'systemctl start clash' to start +" + echo "+ Use 'systemctl enable clash' to enable auto-restart on boot +" + echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" +} + +post_upgrade() { + post_install +} + +pre_remove() { + systemctl stop clash + systemctl disable clash + if [ -f /etc/clash/config.yaml ]; then + mv /etc/clash/config.yaml /etc/clash/config.yaml.bak + fi +} + +post_remove() { + systemctl daemon-reload +} diff --git a/config.yaml b/config.yaml new file mode 100644 index 000000000000..7c9ad8e89722 --- /dev/null +++ b/config.yaml @@ -0,0 +1,32 @@ +dns: + enable: true + # ipv6: true + listen: 0.0.0.0:53 + default-nameserver: + - 1.2.4.8 + enhanced-mode: fake-ip + fake-ip-range: 198.18.0.1/16 # Fake IP addresses pool CIDR + # use-hosts: true # lookup hosts and return IP record + + # Hostnames in this list will not be resolved with fake IPs + # i.e. questions to these domain names will always be answered with their + # real IP addresses + # fake-ip-filter: + # - '*.lan' + # - localhost.ptlogin2.qq.com + # Supports UDP, TCP, DoT, DoH. You can specify the port to connect to. + # All DNS questions are sent directly to the nameserver, without proxies + # involved. Clash answers the DNS question with the first result gathered. + nameserver: + - 1.2.4.8 + # When `fallback` is present, the DNS server will send concurrent requests + # to the servers in this section along with servers in `nameservers`. + # The answers from fallback servers are used when the GEOIP country + # is not `CN`. + fallback: + - 8.8.8.8 +tun: + enable: true + stack: system # or gvisor + dns-hijack: + - 198.18.0.2:53 |