summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaruue Icymoon2023-09-02 11:41:32 +0800
committerHaruue Icymoon2023-09-02 11:41:32 +0800
commit6d85479120461e917245df7ca8f72deef522ba47 (patch)
treed8d7e6ce3b75974e9e396f27c39595649c899e7a
parent2905ba07f63fe9befbf28e2911a2ed2ab828e314 (diff)
downloadaur-6d85479120461e917245df7ca8f72deef522ba47.tar.gz
update: 2.0.0
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD15
-rw-r--r--hysteria-server@.service2
-rw-r--r--hysteria.install42
-rw-r--r--hysteria@.service2
5 files changed, 61 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 78b50ffb0a03..b40952447450 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,21 +1,23 @@
pkgbase = hysteria-bin
pkgdesc = A feature-packed network utility optimized for networks of poor quality (Binary Release)
- pkgver = 1.3.5
+ pkgver = 2.0.0
pkgrel = 1
url = https://hysteria.network/
install = hysteria.install
arch = x86_64
- license = GPL3
+ license = MIT
provides = hysteria
conflicts = hysteria
- source = hysteria-1.3.5-1-linux-amd64::https://github.com/apernet/hysteria/releases/download/v1.3.5/hysteria-linux-amd64
+ source = hysteria-2.0.0-1-linux-amd64::https://github.com/apernet/hysteria/releases/download/app/v2.0.0/hysteria-linux-amd64
+ source = hysteria-2.0.0-1-LICENSE.md::https://raw.githubusercontent.com/apernet/hysteria/app/v2.0.0/LICENSE.md
source = hysteria@.service
source = hysteria-server@.service
source = sysusers.conf
source = tmpfiles.conf
- sha256sums = 41dc8bc3fff6fc1f031666eb294f10b481b80b66229d7c6aca88398d0fba839d
- sha256sums = e5816c4c66ae564ab927e1460b4f1f89d7bbd5b957634723ef24a82eaf814d06
- sha256sums = f79262911516c65a0574c12df5415c62b264e15c2d437635b6b10ef9689e0b94
+ sha256sums = 13c073e6c98cacda2492faa1edb997a30282b57b99429d9f4b25530bdf23f04f
+ sha256sums = b279cfdac4db4b077f0660b5d8156d50a8bc7bd410036dc356499af43c4e84f5
+ sha256sums = 5d421ca1e73c69317261afd6405f3759c47fd2a3c69674cbbadf80bd433bd4db
+ sha256sums = 98b7a3bcfe9278f196ff922b31d4b5363fd83d42e9dbd4a813e093a4d429511a
sha256sums = 44f1cb2fedfc94dc396ceb215e62237dbc8c74c035c45a3430c1f3748d266dd9
sha256sums = 1e93d9f2b312eaf02ac00229106cd796e0cd54a9a468a0a8d3ae843399c1c310
diff --git a/PKGBUILD b/PKGBUILD
index 14f68579b96f..bebc3a06f084 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,23 +3,25 @@
pkgname=hysteria-bin
_pkgbase=hysteria
-pkgver=1.3.5
+pkgver=2.0.0
pkgrel=1
pkgdesc='A feature-packed network utility optimized for networks of poor quality (Binary Release)'
arch=('x86_64')
url='https://hysteria.network/'
-license=('GPL3')
+license=('MIT')
provides=('hysteria')
conflicts=('hysteria')
install=$_pkgbase.install
-source=("$_pkgbase-$pkgver-$pkgrel-linux-amd64::https://github.com/apernet/$_pkgbase/releases/download/v$pkgver/hysteria-linux-amd64"
+source=("$_pkgbase-$pkgver-$pkgrel-linux-amd64::https://github.com/apernet/hysteria/releases/download/app/v$pkgver/hysteria-linux-amd64"
+ "$_pkgbase-$pkgver-$pkgrel-LICENSE.md::https://raw.githubusercontent.com/apernet/hysteria/app/v$pkgver/LICENSE.md"
'hysteria@.service'
'hysteria-server@.service'
'sysusers.conf'
'tmpfiles.conf')
-sha256sums=('41dc8bc3fff6fc1f031666eb294f10b481b80b66229d7c6aca88398d0fba839d'
- 'e5816c4c66ae564ab927e1460b4f1f89d7bbd5b957634723ef24a82eaf814d06'
- 'f79262911516c65a0574c12df5415c62b264e15c2d437635b6b10ef9689e0b94'
+sha256sums=('13c073e6c98cacda2492faa1edb997a30282b57b99429d9f4b25530bdf23f04f'
+ 'b279cfdac4db4b077f0660b5d8156d50a8bc7bd410036dc356499af43c4e84f5'
+ '5d421ca1e73c69317261afd6405f3759c47fd2a3c69674cbbadf80bd433bd4db'
+ '98b7a3bcfe9278f196ff922b31d4b5363fd83d42e9dbd4a813e093a4d429511a'
'44f1cb2fedfc94dc396ceb215e62237dbc8c74c035c45a3430c1f3748d266dd9'
'1e93d9f2b312eaf02ac00229106cd796e0cd54a9a468a0a8d3ae843399c1c310')
@@ -29,5 +31,6 @@ package() {
install -Dm644 "$srcdir/tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/hysteria.conf"
install -Dm644 "$srcdir/hysteria@.service" "$pkgdir/usr/lib/systemd/system/hysteria@.service"
install -Dm644 "$srcdir/hysteria-server@.service" "$pkgdir/usr/lib/systemd/system/hysteria-server@.service"
+ install -Dm644 "$srcdir/$_pkgbase-$pkgver-$pkgrel-LICENSE.md" "$pkgdir/usr/share/licenses/hysteria/LICENSE.md"
install -dm755 "$pkgdir/etc/hysteria"
}
diff --git a/hysteria-server@.service b/hysteria-server@.service
index feef97d32187..1ef1d6fc4031 100644
--- a/hysteria-server@.service
+++ b/hysteria-server@.service
@@ -5,7 +5,7 @@ After=network.target
[Service]
Type=simple
-ExecStart=/usr/bin/hysteria server --config %i.json --no-check
+ExecStart=/usr/bin/hysteria server --config %i.yaml --disable-update-check
WorkingDirectory=/etc/hysteria
User=hysteria
Group=hysteria
diff --git a/hysteria.install b/hysteria.install
index c65a115cd556..ee08d7d7a30c 100644
--- a/hysteria.install
+++ b/hysteria.install
@@ -1,13 +1,41 @@
_hysteria_user="hysteria"
_hysteria_homedir="/var/lib/hysteria"
+has_command() {
+ local _command=$1
+ type -P "$_command" > /dev/null 2>&1
+}
+tput() {
+ if has_command tput; then
+ command tput "$@"
+ fi
+}
all_off="$(tput sgr0)"
bold="${all_off}$(tput bold)"
+red="${bold}$(tput setaf 1)"
blue="${bold}$(tput setaf 4)"
yellow="${bold}$(tput setaf 3)"
note() {
printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n"
}
+warn() {
+ printf "${blue}==>${red} WARN:${bold} $1${all_off}\n"
+}
+
+has_prefix() {
+ local _s="$1"
+ local _prefix="$2"
+
+ if [[ -z "$_prefix" ]]; then
+ return 0
+ fi
+
+ if [[ -z "$_s" ]]; then
+ return 1
+ fi
+
+ [[ "x$_s" != "x${_s#"$_prefix"}" ]]
+}
_hysteria_ensure_usermod() {
local _origin_homedir=$(eval echo ~"$_hysteria_user")
@@ -19,10 +47,24 @@ _hysteria_ensure_usermod() {
fi
}
+_hysteria_incompatible_upgrade_warning() {
+ note "Hysteria is upgraded to the Hysteria 2."
+ warn "Hysteria 2 uses a completely redesigned protocol & config, which is NOT compatible with the version 1.x.x in any way."
+ warn "If you do not intend to migrate to Hysteria 2, please downgrade this package to version 1.3.5."
+ warn "Alternatively, there is also a \"hysteria${red}1${bold}\" and \"hysteria${red}1${bold}-bin\" package in the AUR, which provides the final version of Hysteria v1 and can be installed side by side with this package."
+}
+
post_install() {
_hysteria_ensure_usermod
}
post_upgrade() {
+ local _new_version="$1"
+ local _old_version="$2"
+
post_install
+
+ if has_prefix "$_new_version" "2." && has_prefix "$_old_version" "1."; then
+ _hysteria_incompatible_upgrade_warning
+ fi
}
diff --git a/hysteria@.service b/hysteria@.service
index e25bdfdf70e4..012e9b7f8178 100644
--- a/hysteria@.service
+++ b/hysteria@.service
@@ -5,7 +5,7 @@ After=network.target
[Service]
Type=simple
-ExecStart=/usr/bin/hysteria client --config %i.json --no-check
+ExecStart=/usr/bin/hysteria client --config %i.yaml --disable-update-check
WorkingDirectory=/etc/hysteria
User=hysteria
Group=hysteria