summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO28
-rw-r--r--PKGBUILD60
-rw-r--r--config.json143
-rw-r--r--location_asset.patch9
-rw-r--r--vpoint_socks_vmess.json25
-rw-r--r--vpoint_vmess_freedom.json32
-rw-r--r--xray.service8
-rw-r--r--xray.sysusers1
-rw-r--r--xray.tmpfiles1
-rw-r--r--xray@.service7
10 files changed, 44 insertions, 270 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 950a07fe4d76..bb953c57c9a7 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,28 +1,24 @@
pkgbase = xray
- pkgdesc = The best v2ray-core, with XTLS support.
- pkgver = 1.4.1
+ pkgdesc = The best v2ray-core, with XTLS support
+ pkgver = 1.4.2
pkgrel = 1
url = https://github.com/XTLS/Xray-core
arch = x86_64
license = MPL2
makedepends = go
- makedepends = patch
depends = glibc
- depends = v2ray-domain-list-community
- depends = v2ray-geoip
- backup = etc/xray/config.json
- source = xray-1.4.1.tar.gz::https://github.com/XTLS/Xray-core/archive/v1.4.1.tar.gz
- source = config.json
- source = vpoint_socks_vmess.json
- source = vpoint_vmess_freedom.json
+ depends = xray-domain-list-community
+ depends = xray-geoip
+ source = xray-1.4.2.tar.gz::https://github.com/XTLS/Xray-core/archive/v1.4.2.tar.gz
+ source = xray.sysusers
+ source = xray.tmpfiles
source = xray.service
source = xray@.service
- sha512sums = e202b55d258d202a2e1593b0285ff8221298fc994764f321eaea0e7ff18e10a5324d8b909d48a738d62f548da8a56f09cac233de346338327bb5e6c1b9707af3
- sha512sums = 2000211cbf987adaee7f278cc8cb23268965caab3bc46401f9324f2beaad95bec11012f5f4500f1016f4b75f097f3ac96cc5be2da7a6df0261582b3f23b3d78d
- sha512sums = 9914fd3da02511b716951e521ca22006a6e8ad66e64d32cc7dd7dc3544a754174b37e35df6108ca217130f02763265d74f8bc56c4e52b262bdd48dcdb5310eb5
- sha512sums = 532f66fe19196de0cc43df1812d6f32cbca7bbcacaa0cd4141bd80b3121b17eb8b23e0464765cf05a97b11e0213fb688eade83e393e36b3e7ebded6f0925de97
- sha512sums = 1d31e11c3a11090ee2616adfcf77a4a1013793c8f63a41e5293d07e889e34f85223b9f5a0791b649f22ecc5e18e12182b5b074e61aa36f5cd6de523f3c64f95d
- sha512sums = 6582aa9bf988acb2660a7172282768c217ad8335a55ccee916d7786c227bc62cc973d7d6d3b5632260c69eec98c15804c2b52cdd91c5f395d3a0fe36519586b4
+ sha256sums = 565255d8c67b254f403d498b9152fa7bc097d649c50cb318d278c2be644e92cc
+ sha256sums = 801131bf2eb079750f17d3e703e414eab8494db0d512164cdef3cc68cef308b8
+ sha256sums = 2d301e9f2fae728da55f33a15b2c36e90cdb657deafb5d6ab7d74375ce9fdf38
+ sha256sums = 66a8a3280aa5b3ed41b9855ba3de3f884bd2113b4a965cf097fcb31c3a6066ed
+ sha256sums = 05d16acd6e00989ece245bf0df919accae858555c7165a50ce2b3db9c0c5a725
pkgname = xray
diff --git a/PKGBUILD b/PKGBUILD
index 77d094827fbd..d7e5b0359eb6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,41 +1,31 @@
+# Maintainer: Dct Mei <dctxmei@yandex.com>
# Maintainer: AkinoKaede <autmaple@protonmail.com>
# Maintainer: DuckSoft <realducksoft@gmail.com>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: pandada8 <pandada8@gmail.com>
pkgname=xray
-pkgver=1.4.1
+pkgver=1.4.2
pkgrel=1
-pkgdesc="The best v2ray-core, with XTLS support."
+pkgdesc="The best v2ray-core, with XTLS support"
arch=('x86_64')
url="https://github.com/XTLS/Xray-core"
license=('MPL2')
-depends=('glibc' 'v2ray-domain-list-community' 'v2ray-geoip')
-makedepends=('go' 'patch')
-backup=(etc/xray/config.json)
-source=(
- "${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz"
- "config.json"
- "vpoint_socks_vmess.json"
- "vpoint_vmess_freedom.json"
- "xray.service"
- "xray@.service"
-# "location_asset.patch"
-)
-sha512sums=('e202b55d258d202a2e1593b0285ff8221298fc994764f321eaea0e7ff18e10a5324d8b909d48a738d62f548da8a56f09cac233de346338327bb5e6c1b9707af3'
- '2000211cbf987adaee7f278cc8cb23268965caab3bc46401f9324f2beaad95bec11012f5f4500f1016f4b75f097f3ac96cc5be2da7a6df0261582b3f23b3d78d'
- '9914fd3da02511b716951e521ca22006a6e8ad66e64d32cc7dd7dc3544a754174b37e35df6108ca217130f02763265d74f8bc56c4e52b262bdd48dcdb5310eb5'
- '532f66fe19196de0cc43df1812d6f32cbca7bbcacaa0cd4141bd80b3121b17eb8b23e0464765cf05a97b11e0213fb688eade83e393e36b3e7ebded6f0925de97'
- '1d31e11c3a11090ee2616adfcf77a4a1013793c8f63a41e5293d07e889e34f85223b9f5a0791b649f22ecc5e18e12182b5b074e61aa36f5cd6de523f3c64f95d'
- '6582aa9bf988acb2660a7172282768c217ad8335a55ccee916d7786c227bc62cc973d7d6d3b5632260c69eec98c15804c2b52cdd91c5f395d3a0fe36519586b4')
-# '3fc64f9980fb9d5ceedf6c77fa88abcbf9c3ca15189de7f4e5e319d525591d7049676b8a89e9ef1341ed3ba198041539db4fe37338bab4df9f9b7594f77b36b6'
-
-#prepare() {
-# patch "${srcdir}"/"Xray-core-${pkgver}"/common/platform/others.go "${srcdir}"/location_asset.patch
-#}
+depends=('glibc' 'xray-domain-list-community' 'xray-geoip')
+makedepends=('go')
+source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz"
+ "xray.sysusers"
+ "xray.tmpfiles"
+ "xray.service"
+ "xray@.service")
+sha256sums=('565255d8c67b254f403d498b9152fa7bc097d649c50cb318d278c2be644e92cc'
+ '801131bf2eb079750f17d3e703e414eab8494db0d512164cdef3cc68cef308b8'
+ '2d301e9f2fae728da55f33a15b2c36e90cdb657deafb5d6ab7d74375ce9fdf38'
+ '66a8a3280aa5b3ed41b9855ba3de3f884bd2113b4a965cf097fcb31c3a6066ed'
+ '05d16acd6e00989ece245bf0df919accae858555c7165a50ce2b3db9c0c5a725')
build() {
- cd "${srcdir}"/"Xray-core-${pkgver}"
+ cd "${srcdir}"/"Xray-core-${pkgver}"/
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external"
export CGO_LDFLAGS="${LDFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
@@ -44,17 +34,17 @@ build() {
}
check() {
- cd "${srcdir}"/"Xray-core-${pkgver}"
+ cd "${srcdir}"/"Xray-core-${pkgver}"/
go test -p 1 -tags json -v -timeout 30m github.com/xtls/xray-core/core/...
}
package() {
- cd "${srcdir}"
- install -Dm644 xray.service "${pkgdir}"/usr/lib/systemd/system/xray.service
- install -Dm644 xray@.service "${pkgdir}"/usr/lib/systemd/system/xray@.service
- install -Dm644 *.json -t "${pkgdir}"/etc/xray/
-
- cd "${srcdir}"/"Xray-core-${pkgver}"
- install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/xray/LICENSE
- install -Dm755 xray -t "${pkgdir}"/usr/bin/
+ cd "${srcdir}"/"Xray-core-$pkgver"/
+ install -d "${pkgdir}"/etc/xray/
+ install -Dm 755 xray -t "${pkgdir}"/usr/bin/
+ install -Dm 644 LICENSE -t "${pkgdir}"/usr/share/licenses/xray/
+ install -Dm 644 "${srcdir}"/xray.sysusers "${pkgdir}"/usr/lib/sysusers.d/xray.conf
+ install -Dm 644 "${srcdir}"/xray.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/xray.conf
+ install -Dm 644 "${srcdir}"/xray.service -t "${pkgdir}"/usr/lib/systemd/system/
+ install -Dm 644 "${srcdir}"/xray@.service -t "${pkgdir}"/usr/lib/systemd/system/
}
diff --git a/config.json b/config.json
deleted file mode 100644
index 4506bac71993..000000000000
--- a/config.json
+++ /dev/null
@@ -1,143 +0,0 @@
-// Config file of Xray. This file follows standard JSON format, with comments support.
-// Uncomment entries below to satisfy your needs. Also read our manual for more detail at
-{
- "log": {
- // By default, Xray writes access log to stdout.
- // "access": "/path/to/access/log/file",
-
- // By default, Xray write error log to stdout.
- // "error": "/path/to/error/log/file",
-
- // Log level, one of "debug", "info", "warning", "error", "none"
- "loglevel": "warning"
- },
- // List of inbound proxy configurations.
- "inbounds": [{
- // Port to listen on. You may need root access if the value is less than 1024.
- "port": 1080,
-
- // IP address to listen on. Change to "0.0.0.0" to listen on all network interfaces.
- "listen": "127.0.0.1",
-
- // Tag of the inbound proxy. May be used for routing.
- "tag": "socks-inbound",
-
- // Protocol name of inbound proxy.
- "protocol": "socks",
-
- // Settings of the protocol. Varies based on protocol.
- "settings": {
- "auth": "noauth",
- "udp": false,
- "ip": "127.0.0.1"
- },
-
- // Enable sniffing on TCP connection.
- "sniffing": {
- "enabled": true,
- // Target domain will be overriden to the one carried by the connection, if the connection is HTTP or HTTPS.
- "destOverride": ["http", "tls"]
- }
- }],
- // List of outbound proxy configurations.
- "outbounds": [{
- // Protocol name of the outbound proxy.
- "protocol": "freedom",
-
- // Settings of the protocol. Varies based on protocol.
- "settings": {},
-
- // Tag of the outbound. May be used for routing.
- "tag": "direct"
- },{
- "protocol": "blackhole",
- "settings": {},
- "tag": "blocked"
- }],
-
- // Transport is for global transport settings. If you have multiple transports with same settings
- // (say mKCP), you may put it here, instead of in each individual inbound/outbounds.
- //"transport": {},
-
- // Routing controls how traffic from inbounds are sent to outbounds.
- "routing": {
- "domainStrategy": "IPOnDemand",
- "rules":[
- {
- // Blocks access to private IPs. Remove this if you want to access your router.
- "type": "field",
- "ip": ["geoip:private"],
- "outboundTag": "blocked"
- },
- {
- // Blocks major ads.
- "type": "field",
- "domain": ["geosite:category-ads"],
- "outboundTag": "blocked"
- }
- ]
- },
-
- // Dns settings for domain resolution.
- "dns": {
- // Static hosts, similar to hosts file.
- "hosts": {
- // Match v2ray.com to another domain on CloudFlare. This domain will be used when querying IPs for v2ray.com.
- "domain:v2ray.com": "www.vicemc.net",
-
- // The following settings help to eliminate DNS poisoning in mainland China.
- // It is safe to comment these out if this is not the case for you.
- "domain:github.io": "pages.github.com",
- "domain:wikipedia.org": "www.wikimedia.org",
- "domain:shadowsocks.org": "electronicsrealm.com"
- },
- "servers": [
- "1.1.1.1",
- {
- "address": "114.114.114.114",
- "port": 53,
- // List of domains that use this DNS first.
- "domains": [
- "geosite:cn"
- ]
- },
- "8.8.8.8",
- "localhost"
- ]
- },
-
- // Policy controls some internal behavior of how Xray handles connections.
- // It may be on connection level by user levels in 'levels', or global settings in 'system.'
- "policy": {
- // Connection policys by user levels
- "levels": {
- "0": {
- "uplinkOnly": 0,
- "downlinkOnly": 0
- }
- },
- "system": {
- "statsInboundUplink": false,
- "statsInboundDownlink": false,
- "statsOutboundUplink": false,
- "statsOutboundDownlink": false
- }
- },
-
- // Stats enables internal stats counter.
- // This setting can be used together with Policy and Api.
- //"stats":{},
-
- // Api enables gRPC APIs for external programs to communicate with Xray instance.
- //"api": {
- //"tag": "api",
- //"services": [
- // "HandlerService",
- // "LoggerService",
- // "StatsService"
- //]
- //},
-
- // You may add other entries to the configuration, but they will not be recognized by Xray.
- "other": {}
-}
diff --git a/location_asset.patch b/location_asset.patch
deleted file mode 100644
index 7bf4aaff8679..000000000000
--- a/location_asset.patch
+++ /dev/null
@@ -1,9 +0,0 @@
-@@ -30,6 +30,8 @@
- defPath,
- filepath.Join("/usr/local/share/xray/", file),
- filepath.Join("/usr/share/xray/", file),
-+ filepath.Join("/usr/local/share/v2ray/", file),
-+ filepath.Join("/usr/share/v2ray/", file),
- } {
- if _, err := os.Stat(p); os.IsNotExist(err) {
- continue
diff --git a/vpoint_socks_vmess.json b/vpoint_socks_vmess.json
deleted file mode 100644
index 789cd270af2a..000000000000
--- a/vpoint_socks_vmess.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "log": {
- "loglevel": "warning"
- },
- "inbounds": [{
- "port": 1080,
- "listen": "127.0.0.1",
- "protocol": "socks",
- "settings": {
- "auth": "noauth",
- "udp": false,
- "ip": "127.0.0.1"
- }
- }],
- "outbounds": [{
- "protocol": "freedom",
- "settings": {},
- "tag": "direct"
- }],
- "policy": {
- "levels": {
- "0": {"uplinkOnly": 0}
- }
- }
-}
diff --git a/vpoint_vmess_freedom.json b/vpoint_vmess_freedom.json
deleted file mode 100644
index de51e9f240fc..000000000000
--- a/vpoint_vmess_freedom.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "inbounds": [{
- "port": 10086,
- "protocol": "vmess",
- "settings": {
- "clients": [
- {
- "id": "23ad6b10-8d1a-40f7-8ad0-e3e35cd38297",
- "level": 1,
- "alterId": 64
- }
- ]
- }
- }],
- "outbounds": [{
- "protocol": "freedom",
- "settings": {}
- },{
- "protocol": "blackhole",
- "settings": {},
- "tag": "blocked"
- }],
- "routing": {
- "rules": [
- {
- "type": "field",
- "ip": ["geoip:private"],
- "outboundTag": "blocked"
- }
- ]
- }
-}
diff --git a/xray.service b/xray.service
index 77889293c647..2c24daa71b2a 100644
--- a/xray.service
+++ b/xray.service
@@ -1,16 +1,14 @@
[Unit]
Description=Xray Service
-Documentation=https://github.com/xtls
After=network.target nss-lookup.target
[Service]
-User=nobody
+User=xray
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
-ExecStart=/usr/bin/xray run -config /etc/xray/config.json
-Restart=on-failure
-RestartPreventExitStatus=23
+ExecStart=/usr/bin/xray run -confdir /etc/xray/
+Restart=on-abort
[Install]
WantedBy=multi-user.target
diff --git a/xray.sysusers b/xray.sysusers
new file mode 100644
index 000000000000..0260d2dc7bb2
--- /dev/null
+++ b/xray.sysusers
@@ -0,0 +1 @@
+u xray - "Xray Service" - -
diff --git a/xray.tmpfiles b/xray.tmpfiles
new file mode 100644
index 000000000000..896975f1587a
--- /dev/null
+++ b/xray.tmpfiles
@@ -0,0 +1 @@
+d /var/log/xray 0700 xray xray - -
diff --git a/xray@.service b/xray@.service
index c7563486d112..a024fb1a9fca 100644
--- a/xray@.service
+++ b/xray@.service
@@ -1,17 +1,14 @@
[Unit]
Description=Xray Service
-Documentation=https://github.com/xtls
After=network.target nss-lookup.target
[Service]
-User=nobody
+User=xray
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
ExecStart=/usr/bin/xray run -config /etc/xray/%i.json
-Restart=on-failure
-RestartPreventExitStatus=23
+Restart=on-abort
[Install]
WantedBy=multi-user.target
-