diff options
author | sukanka | 2023-02-04 21:06:43 +0800 |
---|---|---|
committer | sukanka | 2023-02-04 21:06:43 +0800 |
commit | 3ecf63ccbb461b05a52658835d433469ba032b92 (patch) | |
tree | 67b832d5b3a87eea84ef6753c04215da3c8ac770 | |
parent | a0849a107a8590a93254f265925963092eb885b3 (diff) | |
download | aur-3ecf63ccbb461b05a52658835d433469ba032b92.tar.gz |
set user for alist
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 14 | ||||
-rw-r--r-- | alist.install | 15 | ||||
-rw-r--r-- | alist.service | 1 | ||||
-rw-r--r-- | alist.sysusers | 2 | ||||
-rw-r--r-- | alist.tmpfiles | 6 |
6 files changed, 34 insertions, 12 deletions
@@ -1,7 +1,7 @@ pkgbase = alist-bin pkgdesc = Another file list program that supports multiple storage pkgver = 3.9.2 - pkgrel = 1 + pkgrel = 3 url = https://github.com/alist-org/alist install = alist.install arch = aarch64 @@ -12,8 +12,12 @@ pkgbase = alist-bin backup = etc/alist/config.json source = alist.service source = config.json - sha256sums = 8b38a0800197e1f1508ebc3357389b1f48f596093091c8aada4e9a05b7e74a3f + source = alist.sysusers + source = alist.tmpfiles + sha256sums = 9c6f848845bb13957678f4898c7fffdcfaafc421c89ba80d8213770e12c0d053 sha256sums = b72f194a7b8855e97eeb76e63e179f38132cc9e6be9daa5b396699c9c11611de + sha256sums = 3658370660806f73c3d9bc5f1b6e2a013c9520d34ffc4462df99f7692473613d + sha256sums = c6b62c4a750ab921c2e8f965e4baeee28855c9a969b00eddd346670f2fdf12de source_aarch64 = alist-3.9.2-aarch64.tar.gz::https://github.com/alist-org/alist/releases/download/v3.9.2/alist-linux-arm64.tar.gz sha256sums_aarch64 = a9d9de6036988150b4413c1f894842071085add54cb3d564e46aee6a6afc7308 source_x86_64 = alist-3.9.2-x86_64.tar.gz::https://github.com/alist-org/alist/releases/download/v3.9.2/alist-linux-amd64.tar.gz @@ -4,20 +4,22 @@ pkgname=alist-bin _pkgname=${pkgname%-bin} pkgver=3.9.2 -pkgrel=1 +pkgrel=3 pkgdesc="Another file list program that supports multiple storage" arch=("aarch64" "x86_64") url="https://github.com/alist-org/alist" license=('AGPL3') provides=(${_pkgname}) backup=("etc/alist/config.json") -source=("alist.service" "config.json") optdepends=('aria2: download by aria2.') +source=("alist.service" "config.json" "alist.sysusers" "alist.tmpfiles") install=alist.install source_aarch64=("$_pkgname-$pkgver-aarch64.tar.gz"::"${url}/releases/download/v${pkgver//_/-}/alist-linux-arm64.tar.gz") source_x86_64=("$_pkgname-$pkgver-x86_64.tar.gz"::"${url}/releases/download/v${pkgver//_/-}/alist-linux-amd64.tar.gz") -sha256sums=('8b38a0800197e1f1508ebc3357389b1f48f596093091c8aada4e9a05b7e74a3f' - 'b72f194a7b8855e97eeb76e63e179f38132cc9e6be9daa5b396699c9c11611de') +sha256sums=('9c6f848845bb13957678f4898c7fffdcfaafc421c89ba80d8213770e12c0d053' + 'b72f194a7b8855e97eeb76e63e179f38132cc9e6be9daa5b396699c9c11611de' + '3658370660806f73c3d9bc5f1b6e2a013c9520d34ffc4462df99f7692473613d' + 'c6b62c4a750ab921c2e8f965e4baeee28855c9a969b00eddd346670f2fdf12de') sha256sums_aarch64=('a9d9de6036988150b4413c1f894842071085add54cb3d564e46aee6a6afc7308') sha256sums_x86_64=('425ac428689f32a77efc5c06ae7155d44852fd92780adb3e4925aa46dd3651ed') @@ -25,6 +27,6 @@ package() { install -Dm755 alist ${pkgdir}/usr/bin/alist install -Dm644 alist.service -t ${pkgdir}/usr/lib/systemd/system/ install -Dm644 config.json -t ${pkgdir}/etc/alist - install -d ${pkgdir}/var/lib/alist - ln -s /etc/alist/config.json ${pkgdir}/var/lib/alist/config.json + install -Dm644 alist.sysusers ${pkgdir}/usr/lib/sysusers.d/alist.conf + install -Dm644 alist.tmpfiles ${pkgdir}/usr/lib/tmpfiles.d/alist.conf } diff --git a/alist.install b/alist.install index a3b24d23d3cb..8e9f0d9aebc8 100644 --- a/alist.install +++ b/alist.install @@ -1,5 +1,12 @@ -post_install(){ - install -d /var/log/alist/ - install -d /var/lib/alist/ - install -d /var/cache/alist/temp +post_upgrade(){ + echo "from alist 3.9.2-3, the alist user is used to run this service" + echo "if you are upgrading from a previous version" + echo "you have to run the following commands in green only once" + + echo -e "\e[32m sudo chown -R alist:alist /var/lib/alist \e[0m" + echo -e "\e[32m sudo chown -R alist:alist /var/log/alist \e[0m" + echo -e "\e[32m sudo chown -R alist:alist /etc/alist \e[0m" + echo -e "\e[32m sudo chown -R alist:alist /var/cache/alist \e[0m" + + echo "and chown any other local files that are served by alist" } diff --git a/alist.service b/alist.service index e17ea630b262..2133b563a711 100644 --- a/alist.service +++ b/alist.service @@ -4,6 +4,7 @@ After=network.target [Service] Type=simple +User=alist WorkingDirectory=/var/lib/alist ExecStart=/usr/bin/alist server --data /var/lib/alist Restart=on-failure diff --git a/alist.sysusers b/alist.sysusers new file mode 100644 index 000000000000..761d215044b9 --- /dev/null +++ b/alist.sysusers @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +u alist - "A file list program" /var/lib/alist diff --git a/alist.tmpfiles b/alist.tmpfiles new file mode 100644 index 000000000000..33ec921c7ca6 --- /dev/null +++ b/alist.tmpfiles @@ -0,0 +1,6 @@ +#Type Path Mode User Group Age Argument +d /var/lib/alist 0755 alist alist - - +d /var/log/alist 0755 alist alist - - +d /var/cache/alist 0755 alist alist - - +d /etc/alist 0755 alist alist - - +L /etc/alist/config.json 0644 alist alist - /var/lib/alist/config.json |