diff options
author | Haruue Icymoon | 2022-10-29 19:32:07 +0800 |
---|---|---|
committer | Haruue Icymoon | 2022-10-29 19:32:07 +0800 |
commit | 39746c570add3a929a62ea86b4a386080996a113 (patch) | |
tree | 3c9eb86ffd8e2d103ed2b203614435a26d7e6da3 | |
parent | cd3e3fda86995394d2c93a58261f637039f4e667 (diff) | |
download | aur-39746c570add3a929a62ea86b4a386080996a113.tar.gz |
fix: acme not work for permission denied
ref: hysteria@128ba143178adbf6acfd447160540db17cd8f4cf
-rw-r--r-- | .SRCINFO | 9 | ||||
-rw-r--r-- | PKGBUILD | 10 | ||||
-rw-r--r-- | hysteria.install | 28 | ||||
-rw-r--r-- | sysusers.conf | 2 | ||||
-rw-r--r-- | tmpfiles.conf | 1 |
5 files changed, 43 insertions, 7 deletions
@@ -1,19 +1,22 @@ pkgbase = hysteria-bin pkgdesc = A feature-packed network utility optimized for networks of poor quality (Binary Release) pkgver = 1.2.2 - pkgrel = 1 + pkgrel = 2 url = https://github.com/HyNetwork/hysteria + install = hysteria.install arch = x86_64 license = GPL3 provides = hysteria conflicts = hysteria - source = hysteria-1.2.2-1-linux-amd64::https://github.com/HyNetwork/hysteria/releases/download/v1.2.2/hysteria-linux-amd64 + source = hysteria-1.2.2-2-linux-amd64::https://github.com/HyNetwork/hysteria/releases/download/v1.2.2/hysteria-linux-amd64 source = hysteria@.service source = hysteria-server@.service source = sysusers.conf + source = tmpfiles.conf sha256sums = 573a4b7d7ddc93566f2ecf0556520334111dcf16174ac36d54dae28f7f9e3160 sha256sums = 61ef8c91f417d83411d89295495e0c926ded7ed02302e7a0efa123d564e12f7e sha256sums = 5a0fb1185e7bff6e05ec8ecb8a45b269fd4c7fa562ab107954ab87642a71f8d0 - sha256sums = abaab463035e67c1e1728e5378b8f4a50960bf80d5005e02b3b2c9468f06150d + sha256sums = 44f1cb2fedfc94dc396ceb215e62237dbc8c74c035c45a3430c1f3748d266dd9 + sha256sums = 1e93d9f2b312eaf02ac00229106cd796e0cd54a9a468a0a8d3ae843399c1c310 pkgname = hysteria-bin @@ -4,25 +4,29 @@ pkgname=hysteria-bin _pkgbase=hysteria pkgver=1.2.2 -pkgrel=1 +pkgrel=2 pkgdesc='A feature-packed network utility optimized for networks of poor quality (Binary Release)' arch=('x86_64') url='https://github.com/HyNetwork/hysteria' license=('GPL3') provides=('hysteria') conflicts=('hysteria') +install=$_pkgbase.install source=("$_pkgbase-$pkgver-$pkgrel-linux-amd64::https://github.com/HyNetwork/$_pkgbase/releases/download/v$pkgver/hysteria-linux-amd64" 'hysteria@.service' 'hysteria-server@.service' - 'sysusers.conf') + 'sysusers.conf' + 'tmpfiles.conf') sha256sums=('573a4b7d7ddc93566f2ecf0556520334111dcf16174ac36d54dae28f7f9e3160' '61ef8c91f417d83411d89295495e0c926ded7ed02302e7a0efa123d564e12f7e' '5a0fb1185e7bff6e05ec8ecb8a45b269fd4c7fa562ab107954ab87642a71f8d0' - 'abaab463035e67c1e1728e5378b8f4a50960bf80d5005e02b3b2c9468f06150d') + '44f1cb2fedfc94dc396ceb215e62237dbc8c74c035c45a3430c1f3748d266dd9' + '1e93d9f2b312eaf02ac00229106cd796e0cd54a9a468a0a8d3ae843399c1c310') package() { install -Dm755 "$srcdir/$_pkgbase-$pkgver-$pkgrel-linux-amd64" "${pkgdir}/usr/bin/${_pkgbase}" install -Dm644 "$srcdir/sysusers.conf" "$pkgdir/usr/lib/sysusers.d/hysteria.conf" + 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 -dm755 "$pkgdir/etc/hysteria" diff --git a/hysteria.install b/hysteria.install new file mode 100644 index 000000000000..c65a115cd556 --- /dev/null +++ b/hysteria.install @@ -0,0 +1,28 @@ +_hysteria_user="hysteria" +_hysteria_homedir="/var/lib/hysteria" + +all_off="$(tput sgr0)" +bold="${all_off}$(tput bold)" +blue="${bold}$(tput setaf 4)" +yellow="${bold}$(tput setaf 3)" +note() { + printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n" +} + +_hysteria_ensure_usermod() { + local _origin_homedir=$(eval echo ~"$_hysteria_user") + # in the old version, homedir is not specified in the sysusers.conf + # and therefore set to / by default. + if [[ "$_origin_homedir" == "/" ]]; then + usermod -d "$_hysteria_homedir" "$_hysteria_user" + note "The homedir of user $_hysteria_user has been changed from $_origin_homedir to $_hysteria_homedir" + fi +} + +post_install() { + _hysteria_ensure_usermod +} + +post_upgrade() { + post_install +} diff --git a/sysusers.conf b/sysusers.conf index bc24d1db1711..26de80fc5ac0 100644 --- a/sysusers.conf +++ b/sysusers.conf @@ -1 +1 @@ -u hysteria - "Hysteria" +u hysteria - "Hysteria" /var/lib/hysteria diff --git a/tmpfiles.conf b/tmpfiles.conf new file mode 100644 index 000000000000..5813c3bad5c2 --- /dev/null +++ b/tmpfiles.conf @@ -0,0 +1 @@ +d /var/lib/hysteria 0750 hysteria hysteria |