diff options
author | database64128 | 2022-07-16 08:33:31 -0700 |
---|---|---|
committer | database64128 | 2022-07-16 08:33:31 -0700 |
commit | bf67c044d8d819a417193c3f160b071c0f114ebd (patch) | |
tree | f810cddb6a079641623e599a12e8e214699b6d42 | |
parent | f819577cc524458579fa2f33636f715b944cd86b (diff) | |
download | aur-bf67c044d8d819a417193c3f160b071c0f114ebd.tar.gz |
💌 Initial release
-rw-r--r-- | .SRCINFO | 34 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | PKGBUILD | 110 | ||||
-rw-r--r-- | client.json | 118 | ||||
-rw-r--r-- | config.json | 153 | ||||
-rw-r--r-- | server.json | 56 | ||||
-rw-r--r-- | shadowsocks-go.service | 11 | ||||
-rw-r--r-- | shadowsocks-go@.service | 11 |
8 files changed, 421 insertions, 76 deletions
@@ -1,17 +1,27 @@ -# Generated by mksrcinfo v8 -# å… 1月 28 05:43:30 UTC 2017 pkgbase = shadowsocks-go-git - pkgdesc = Shadowsocks go version - pkgver = 1.2.1.r2.g5c6f652 + pkgdesc = A versatile and efficient proxy platform for secure communications + pkgver = 1.0.0.r0.gfaef828 pkgrel = 1 - url = https://github.com/shadowsocks/shadowsocks-go/ + url = https://github.com/database64128/shadowsocks-go arch = x86_64 - arch = i686 - groups = shadowsocks-go - license = Apache + arch = aarch64 + license = AGPL3 + makedepends = git makedepends = go + provides = shadowsocks-go + conflicts = shadowsocks-go + backup = etc/shadowsocks-go/config.json + source = shadowsocks-go-git::git+https://github.com/database64128/shadowsocks-go.git + source = shadowsocks-go.service + source = shadowsocks-go@.service + source = config.json + source = server.json + source = client.json + b2sums = SKIP + b2sums = 78640d18aa9f343c594f5c2afee139767e1c25642de595b3a4dfae67399f973404502f31dc9f3894df82cf8ff8af7df2e01993f6c61a2434f655e59623d353a9 + b2sums = c6e2c2b21a41c87b0136c07df305d4d031a5b5040baa1a4ea760fb568c3864499a9ac43ea7e82220c895f274eb0e2913bc2fcdff270ca8aa37af4d4f43050a2f + b2sums = 345e7fcc54f63812db25b35aa6bcca5ec156e200148876b8690ad77cad7ca91c9bbdb68f5a3eb7778521af030cd541a04258c968897727530778a6762f512844 + b2sums = b7e547bf2e344fd0c85f4c62d9a61eb61cad20358eee31fd5b5aa55f0ab20e6452ca737b9d0f7faafb40ca18c828b505d8c725dbe974f9273b0e6e254cb466b5 + b2sums = 83a30277645ddac90bf3878b742f1c506a36c2a4dc50025fd7e08e9e200a227c3c468af51a21fc6a7d6f727d5088b689c43282b45869f31131d427d36adab6df -pkgname = shadowsocks-go-server - -pkgname = shadowsocks-go-local - +pkgname = shadowsocks-go-git diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..415f63b5503a --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +pkg/ +src/ +shadowsocks-go-git/ +*.tar.zst @@ -1,74 +1,56 @@ -# Maintainer: Jianfeng Zhang <swordfeng123@gmail.com> https://keybase.io/swordfeng +# Maintainer: database64128 <free122448@hotmail.com> -pkgbase=shadowsocks-go-git -pkgname=('shadowsocks-go-server' 'shadowsocks-go-local') -groups=('shadowsocks-go') -pkgver=1.2.1.r2.g5c6f652 +_pkgname=shadowsocks-go +pkgname=$_pkgname-git +pkgver=1.0.0.r0.gfaef828 pkgrel=1 -pkgdesc="Shadowsocks go version" -arch=('x86_64' 'i686') -url="https://github.com/shadowsocks/shadowsocks-go/" -license=('Apache') -makedepends=('go') -#options=('!strip') -_gourl=github.com/shadowsocks/shadowsocks-go - -prepare() { - GOPATH="$srcdir" go get -d -fix -v -x -u ${_gourl}/cmd/shadowsocks-server - GOPATH="$srcdir" go get -d -fix -v -x -u ${_gourl}/cmd/shadowsocks-local -} +pkgdesc="A versatile and efficient proxy platform for secure communications" +arch=('x86_64' 'aarch64') +url="https://github.com/database64128/$_pkgname" +license=('AGPL3') +makedepends=('git' 'go') +provides=("$_pkgname") +conflicts=("$_pkgname") +backup=("etc/$_pkgname/config.json") +source=( + "$pkgname::git+$url.git" + "$_pkgname.service" + "$_pkgname@.service" + 'config.json' + 'server.json' + 'client.json' +) +b2sums=( + 'SKIP' + '78640d18aa9f343c594f5c2afee139767e1c25642de595b3a4dfae67399f973404502f31dc9f3894df82cf8ff8af7df2e01993f6c61a2434f655e59623d353a9' + 'c6e2c2b21a41c87b0136c07df305d4d031a5b5040baa1a4ea760fb568c3864499a9ac43ea7e82220c895f274eb0e2913bc2fcdff270ca8aa37af4d4f43050a2f' + '345e7fcc54f63812db25b35aa6bcca5ec156e200148876b8690ad77cad7ca91c9bbdb68f5a3eb7778521af030cd541a04258c968897727530778a6762f512844' + 'b7e547bf2e344fd0c85f4c62d9a61eb61cad20358eee31fd5b5aa55f0ab20e6452ca737b9d0f7faafb40ca18c828b505d8c725dbe974f9273b0e6e254cb466b5' + '83a30277645ddac90bf3878b742f1c506a36c2a4dc50025fd7e08e9e200a227c3c468af51a21fc6a7d6f727d5088b689c43282b45869f31131d427d36adab6df' +) pkgver() { - cd "$srcdir/src/${_gourl}" - git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' + cd $pkgname + git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' } build() { - GOPATH="$srcdir" go install ${_gourl}/cmd/shadowsocks-server - GOPATH="$srcdir" go install ${_gourl}/cmd/shadowsocks-local -} - -check() { - GOPATH="$GOPATH:$srcdir" go test -v -x ${_gourl}/... + cd $pkgname + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" + go build -ldflags='-s -w -linkmode=external' ./cmd/$_pkgname } -package_shadowsocks-go-server() { - mkdir -p "$pkgdir/usr/bin" - install -p -m755 "$srcdir/bin/shadowsocks-server" "$pkgdir/usr/bin/" - mkdir -p "$pkgdir/usr/lib/systemd/system" - cat > "$pkgdir/usr/lib/systemd/system/shadowsocks-go-server@.service" <<EOF -[Unit] -Description=Shadowsocks Server Service (Go Version) -After=network.target - -[Service] -Type=simple -#User=nobody -CapabilityBoundingSet=CAP_NET_BIND_SERVICE -ExecStart=/usr/bin/shadowsocks-server -c /etc/shadowsocks/%i.json - -[Install] -WantedBy=multi-user.target -EOF +package() { + install -Dm644 $_pkgname.service "$pkgdir"/usr/lib/systemd/system/$_pkgname.service + install -Dm644 $_pkgname@.service "$pkgdir"/usr/lib/systemd/system/$_pkgname@.service + install -d "$pkgdir"/etc/$_pkgname + install -Dm644 config.json "$pkgdir"/etc/$_pkgname/config.json + install -Dm644 config.json "$pkgdir"/etc/$_pkgname/server.json + install -Dm644 config.json "$pkgdir"/etc/$_pkgname/client.json + cd $pkgname + install -Dm755 $_pkgname "$pkgdir"/usr/bin/$_pkgname } - -package_shadowsocks-go-local() { - mkdir -p "$pkgdir/usr/bin" - install -p -m755 "$srcdir/bin/shadowsocks-local" "$pkgdir/usr/bin/" - mkdir -p "$pkgdir/usr/lib/systemd/system" - cat > "$pkgdir/usr/lib/systemd/system/shadowsocks-go@.service" <<EOF -[Unit] -Description=Shadowsocks Client Service (Go Version) -After=network.target - -[Service] -Type=simple -#User=nobody -CapabilityBoundingSet=CAP_NET_BIND_SERVICE -ExecStart=/usr/bin/shadowsocks-local -c /etc/shadowsocks/%i.json - -[Install] -WantedBy=multi-user.target -EOF -} - diff --git a/client.json b/client.json new file mode 100644 index 000000000000..eb33f7e6a226 --- /dev/null +++ b/client.json @@ -0,0 +1,118 @@ +{ + "servers": [ + { + "name": "socks5", + "listen": ":1080", + "protocol": "socks5", + "enableTCP": true, + "listenerTFO": true, + "enableUDP": true, + "mtu": 1500 + }, + { + "name": "http", + "listen": ":8080", + "protocol": "http", + "enableTCP": true, + "listenerTFO": true + } + ], + "clients": [ + { + "name": "ss-2022", + "endpoint": "[2001:db8:bd63:362c:2071:a0f6:827:ab6a]:20220", + "protocol": "2022-blake3-aes-128-gcm", + "enableTCP": true, + "dialerTFO": true, + "enableUDP": true, + "mtu": 1500, + "psk": "qQln3GlVCZi5iJUObJVNCw==", + "iPSKs": [ + "oE/s2z9Q8EWORAB8B3UCxw==" + ] + }, + { + "name": "direct", + "protocol": "direct", + "enableTCP": true, + "dialerTFO": true, + "enableUDP": true, + "mtu": 1500 + } + ], + "dns": [ + { + "name": "cf-v6", + "addrPort": "[2606:4700:4700::1111]:53", + "tcpClientName": "ss-2022", + "udpClientName": "ss-2022" + } + ], + "router": { + "defaultTCPClientName": "ss-2022", + "defaultUDPClientName": "ss-2022", + "geoLite2CountryDbPath": "Country.mmdb", + "domainSets": [ + { + "name": "category-ads-all", + "path": "ss-go-category-ads-all.txt" + }, + { + "name": "private", + "path": "ss-go-private.txt" + }, + { + "name": "cn", + "path": "ss-go-cn.txt" + }, + { + "name": "geolocation-!cn@cn", + "path": "ss-go-geolocation-!cn@cn.txt" + } + ], + "routes": [ + { + "name": "ads", + "clientName": "reject", + "domainSets": [ + "category-ads-all" + ] + }, + { + "name": "direct", + "clientName": "direct", + "domainSets": [ + "private", + "cn", + "geolocation-!cn@cn" + ], + "prefixes": [ + "0.0.0.0/8", + "10.0.0.0/8", + "100.64.0.0/10", + "127.0.0.0/8", + "169.254.0.0/16", + "172.16.0.0/12", + "192.0.0.0/24", + "192.0.2.0/24", + "192.88.99.0/24", + "192.168.0.0/16", + "198.18.0.0/15", + "198.51.100.0/24", + "203.0.113.0/24", + "224.0.0.0/4", + "240.0.0.0/4", + "255.255.255.255/32", + "::1/128", + "fc00::/7", + "fe80::/10" + ], + "geoIPCountries": [ + "CN" + ] + } + ] + }, + "udpBatchMode": "", + "udpPreferIPv6": true +} diff --git a/config.json b/config.json new file mode 100644 index 000000000000..818c79b2a26d --- /dev/null +++ b/config.json @@ -0,0 +1,153 @@ +{ + "servers": [ + { + "name": "socks5", + "listen": ":1080", + "protocol": "socks5", + "listenerFwmark": 52140, + "enableTCP": true, + "listenerTFO": true, + "enableUDP": true, + "mtu": 1500 + }, + { + "name": "http", + "listen": ":8080", + "protocol": "http", + "listenerFwmark": 52140, + "enableTCP": true, + "listenerTFO": true + }, + { + "name": "tunnel", + "listen": ":53", + "protocol": "direct", + "listenerFwmark": 52140, + "enableTCP": true, + "listenerTFO": true, + "enableUDP": true, + "mtu": 1500, + "tunnelRemoteAddress": "[2606:4700:4700::1111]:53" + }, + { + "name": "ss-2022", + "listen": ":20220", + "protocol": "2022-blake3-aes-128-gcm", + "listenerFwmark": 52140, + "enableTCP": true, + "listenerTFO": true, + "enableUDP": true, + "mtu": 1500, + "psk": "qQln3GlVCZi5iJUObJVNCw==", + "uPSKs": [ + "oE/s2z9Q8EWORAB8B3UCxw==" + ], + "paddingPolicy": "", + "rejectPolicy": "" + } + ], + "clients": [ + { + "name": "ss-2022-a", + "endpoint": "[2001:db8:bd63:362c:2071:a0f6:827:ab6a]:20220", + "protocol": "2022-blake3-aes-128-gcm", + "dialerFwmark": 52140, + "enableTCP": true, + "dialerTFO": true, + "enableUDP": true, + "mtu": 1500, + "psk": "qQln3GlVCZi5iJUObJVNCw==", + "iPSKs": [ + "oE/s2z9Q8EWORAB8B3UCxw==" + ], + "paddingPolicy": "" + }, + { + "name": "ss-2022-b", + "endpoint": "[2001:db8:a2bf:f3ef:903a:4fd1:f986:5934]:20220", + "protocol": "2022-blake3-aes-128-gcm", + "dialerFwmark": 52140, + "enableTCP": true, + "dialerTFO": true, + "enableUDP": true, + "mtu": 1500, + "psk": "QzhDwx0lKZ+0Sustgwtjtw==", + "iPSKs": [ + "McxLxNcqHUb01ZedJfp55g==" + ], + "paddingPolicy": "" + }, + { + "name": "direct", + "protocol": "direct", + "dialerFwmark": 52140, + "enableTCP": true, + "dialerTFO": true, + "enableUDP": true, + "mtu": 1500 + } + ], + "dns": [ + { + "name": "cf-v6", + "addrPort": "[2606:4700:4700::1111]:53", + "tcpClientName": "ss-2022-a", + "udpClientName": "ss-2022-a" + } + ], + "router": { + "disableNameResolutionForIPRules": false, + "defaultTCPClientName": "ss-2022-a", + "defaultUDPClientName": "ss-2022-a", + "geoLite2CountryDbPath": "Country.mmdb", + "domainSets": [ + { + "name": "example", + "path": "ss-go-example.txt" + } + ], + "routes": [ + { + "name": "example", + "network": "udp", + "clientName": "ss-2022-b", + "resolverName": "cf-v6", + "serverNames": [ + "socks5", + "tunnel" + ], + "domains": [ + "example.com" + ], + "domainSets": [ + "example" + ], + "prefixes": [ + "::/0" + ], + "sourcePrefixes": [ + "127.0.0.1/32", + "::1/128" + ], + "ports": [ + "443" + ], + "sourcePorts": [ + 12345, + 54321 + ], + "geoIPCountries": [ + "US" + ], + "invertDomains": false, + "invertPrefixes": false, + "invertPorts": false, + "invertSourcePrefixes": false, + "invertSourcePorts": false, + "invertGeoIPCountries": false + } + ] + }, + "udpBatchMode": "", + "udpPreferIPv6": true +} diff --git a/server.json b/server.json new file mode 100644 index 000000000000..ec261da1f5b7 --- /dev/null +++ b/server.json @@ -0,0 +1,56 @@ +{ + "servers": [ + { + "name": "ss-2022", + "listen": ":20220", + "protocol": "2022-blake3-aes-128-gcm", + "enableTCP": true, + "listenerTFO": true, + "enableUDP": true, + "mtu": 1500, + "psk": "qQln3GlVCZi5iJUObJVNCw==", + "uPSKs": [ + "oE/s2z9Q8EWORAB8B3UCxw==" + ] + } + ], + "dns": [ + { + "name": "systemd-resolved", + "addrPort": "127.0.0.53:53", + "tcpClientName": "direct", + "udpClientName": "direct" + } + ], + "router": { + "routes": [ + { + "name": "private", + "clientName": "reject", + "prefixes": [ + "0.0.0.0/8", + "10.0.0.0/8", + "100.64.0.0/10", + "127.0.0.0/8", + "169.254.0.0/16", + "172.16.0.0/12", + "192.0.0.0/24", + "192.0.2.0/24", + "192.88.99.0/24", + "192.168.0.0/16", + "198.18.0.0/15", + "198.51.100.0/24", + "203.0.113.0/24", + "224.0.0.0/4", + "240.0.0.0/4", + "255.255.255.255/32", + "::1/128", + "fc00::/7", + "fe80::/10" + ] + } + ] + }, + "udpBatchMode": "", + "udpPreferIPv6": true +} diff --git a/shadowsocks-go.service b/shadowsocks-go.service new file mode 100644 index 000000000000..50a567200543 --- /dev/null +++ b/shadowsocks-go.service @@ -0,0 +1,11 @@ +[Unit] +Description=Shadowsocks Go Proxy Platform +After=network-online.target +Wants=network-online.target + +[Service] +LimitNOFILE=524288 +ExecStart=/usr/bin/shadowsocks-go -confPath /etc/shadowsocks-go/config.json -suppressTimestamps + +[Install] +WantedBy=multi-user.target diff --git a/shadowsocks-go@.service b/shadowsocks-go@.service new file mode 100644 index 000000000000..706f204f6452 --- /dev/null +++ b/shadowsocks-go@.service @@ -0,0 +1,11 @@ +[Unit] +Description=Shadowsocks Go Proxy Platform +After=network-online.target +Wants=network-online.target + +[Service] +LimitNOFILE=524288 +ExecStart=/usr/bin/shadowsocks-go -confPath /etc/shadowsocks-go/%i.json -suppressTimestamps + +[Install] +WantedBy=multi-user.target |