summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authortxyyh2022-08-06 23:53:17 +0800
committertxyyh2022-08-07 00:19:45 +0800
commit3e686f8fb77a1062c7cc2cc1725c7cbab1ad1d4e (patch)
treeae248d0c52debd0b9dfabe52e8f771d03ce1037e
downloadaur-3e686f8fb77a1062c7cc2cc1725c7cbab1ad1d4e.tar.gz
Initial commit
-rw-r--r--.SRCINFO26
-rw-r--r--PKGBUILD43
-rw-r--r--clash.service13
-rw-r--r--clash@.service14
-rw-r--r--config.yaml73
5 files changed, 169 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..42a90d654e8e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+pkgbase = clash-meta-alpha-git
+ pkgdesc = A rule-based tunnel in Go
+ pkgver = Prerelease.Alpha.r0.g2899a12
+ pkgrel = 1
+ url = https://github.com/MetaCubeX/Clash.Meta
+ arch = x86_64
+ license = GPL3
+ makedepends = git
+ makedepends = go
+ depends = glibc
+ provides = clash
+ provides = clash-dev
+ conflicts = clash
+ conflicts = clash-dev
+ options = !lto
+ backup = etc/clash/config.yaml
+ source = git+https://github.com/MetaCubeX/Clash.Meta.git#branch=Alpha
+ source = config.yaml
+ source = clash.service
+ source = clash@.service
+ sha256sums = SKIP
+ sha256sums = c4af03523b8006d206440163406ee9b4de1a10bb5023fb3194490b8225a5e481
+ sha256sums = e7370a0c60147839d923a61189968a0e781857d036c9e0751b16ddce1fb61b0c
+ sha256sums = 3ba4a71955e8f4676eda68e7c5a1d9c02ad9d8e9fd4bbf8f35487bdc768290ef
+
+pkgname = clash-meta-alpha-git
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..9b5de3a90f00
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer: txyyh <zjh330726@gmail.com>
+
+pkgname=clash-meta-alpha-git
+_pkgname=Clash.Meta
+pkgver=Prerelease.Alpha.r0.g2899a12
+pkgrel=1
+pkgdesc="A rule-based tunnel in Go"
+arch=('x86_64')
+url="https://github.com/MetaCubeX/Clash.Meta"
+license=('GPL3')
+depends=('glibc')
+makedepends=('git' 'go')
+provides=('clash' 'clash-dev')
+conflicts=('clash' 'clash-dev')
+backup=("etc/clash/config.yaml")
+options=('!lto')
+source=("git+${url}.git#branch=Alpha"
+ "config.yaml"
+ "clash.service"
+ "clash@.service")
+sha256sums=('SKIP'
+ 'c4af03523b8006d206440163406ee9b4de1a10bb5023fb3194490b8225a5e481'
+ 'e7370a0c60147839d923a61189968a0e781857d036c9e0751b16ddce1fb61b0c'
+ '3ba4a71955e8f4676eda68e7c5a1d9c02ad9d8e9fd4bbf8f35487bdc768290ef')
+
+pkgver() {
+ cd "${srcdir}"/"${_pkgname}"/
+ git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+build() {
+ cd "${srcdir}"/"${_pkgname}"/
+ make linux-amd64
+}
+
+package() {
+ cd "${srcdir}"/"${_pkgname}"/
+ mv bin/Clash.Meta-linux-amd64 bin/clash
+ install -Dm 755 bin/clash -t "${pkgdir}"/usr/bin/
+ install -Dm 644 "${srcdir}"/config.yaml -t "${pkgdir}"/etc/clash/
+ install -Dm 644 "${srcdir}"/clash.service -t "${pkgdir}"/usr/lib/systemd/system/
+ install -Dm 644 "${srcdir}"/clash@.service -t "${pkgdir}"/usr/lib/systemd/system/
+}
diff --git a/clash.service b/clash.service
new file mode 100644
index 000000000000..9e0daa905b74
--- /dev/null
+++ b/clash.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Clash-Meta Daemon, Another Clash Kernel.
+After=network.target NetworkManager.service systemd-networkd.service iwd.service
+
+[Service]
+Type=exec
+CapabilityBoundingSet=cap_net_admin cap_sys_admin
+AmbientCapabilities=cap_net_admin cap_sys_admin
+Restart=on-abort
+ExecStart=/usr/bin/clash -d /etc/clash
+
+[Install]
+WantedBy=multi-user.target
diff --git a/clash@.service b/clash@.service
new file mode 100644
index 000000000000..bfa55da22955
--- /dev/null
+++ b/clash@.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Clash-Meta Daemon, Another Clash Kernel.
+After=network.target NetworkManager.service systemd-networkd.service iwd.service
+
+[Service]
+Type=exec
+User=%i
+CapabilityBoundingSet=cap_net_admin
+AmbientCapabilities=cap_net_admin
+Restart=on-abort
+ExecStart=/usr/bin/clash
+
+[Install]
+WantedBy=multi-user.target
diff --git a/config.yaml b/config.yaml
new file mode 100644
index 000000000000..4b69b9b7d5cb
--- /dev/null
+++ b/config.yaml
@@ -0,0 +1,73 @@
+# ipv6: false # When set to false, resolver won't translate hostnames to IPv6 addresses
+# tcp-concurrent: true # default false
+# geodata-mode: true
+# external-controller: 127.0.0.1:9090
+# external-ui: dashboard
+# secret: ''
+log-level: info
+
+
+dns:
+ enable: true
+ # listen: 0.0.0.0:53
+ # ipv6: false # when the false, response to AAAA questions will be empty
+
+ # These nameservers are used to resolve the DNS nameserver hostnames below.
+ # Specify IP addresses only
+ enhanced-mode: fake-ip # redir-host # (not recommended)
+ # 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:
+ - tls://1dot1dot1dot1.cloudflare-dns.com # DNS over TLS
+ - https://1.1.1.1/dns-query # DNS over HTTPS
+ - 1.1.1.1 # Cloudflare
+ - 1.0.0.1 # Cloudflare
+
+ # 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:
+ # - tcp://1.1.1.1
+
+ # If IP addresses resolved with servers in `nameservers` are in the specified
+ # subnets below, they are considered invalid and results from `fallback`
+ # servers are used instead.
+ #
+ # IP address resolved with servers in `nameserver` is used when
+ # `fallback-filter.geoip` is true and when GEOIP of the IP address is `CN`.
+ #
+ # If `fallback-filter.geoip` is false, results from `nameserver` nameservers
+ # are always used if not match `fallback-filter.ipcidr`.
+ #
+ # This is a countermeasure against DNS pollution attacks.
+ # fallback-filter:
+ # geoip: true
+ # ipcidr:
+ # - 240.0.0.0/4
+ # domain:
+ # - '+.google.com'
+ # - '+.facebook.com'
+ # - '+.youtube.com'
+
+# Enable the TUN listener
+tun:
+ enable: true
+ stack: system # or gvisor
+ device: Meta
+ dns-hijack:
+ - any:53
+ auto-route: true # auto set global route
+ auto-detect-interface: true # conflict with interface-name
+