This commit is contained in:
Mike Wilson
2026-01-27 16:28:38 -05:00
parent 9aa85bb01a
commit eb7fe5b277
4 changed files with 102 additions and 0 deletions

67
src/qui/PKGBUILD Normal file
View File

@@ -0,0 +1,67 @@
pkgname=qui
pkgver=1.12.0
pkgrel=1
pkgdesc="A fast, modern web interface for qBittorrent"
arch=('x86_64')
url="https://github.com/autobrr/qui"
license=('GPL')
makedepends=('git' 'go>=1.25' 'nodejs' 'pnpm')
source=(
"$url/archive/refs/tags/v$pkgver.tar.gz"
"${pkgname}.service"
"${pkgname}.sysusers"
"${pkgname}.tmpfiles"
)
sha256sums=('5c7ad8a32ddb9c8e979fa2779f37afae0a429cd536e0047194113af2af969166'
'd52299510cf4845f0514eefd492b01c33bc2cd2819c2be9dc157f50f67462bd2'
'ac49b4d6ae748334f7fa360d8dd58c7cd09ba5e062249666ab380d451b7925dd'
'3bacde8867fbb7b6d566666b635589579c1cc079cd23418284f43a7b37f0c41b')
prepare() {
cd "${pkgname}-${pkgver}"
mkdir -p build/
# Retrieve Go dependencies
export GOPATH="${srcdir}"
# Don't proxy connection through Google
export GOPROXY=direct
go mod download -modcacherw
# Retrieve NodeJS dependencies
cd web
pnpm install
}
build() {
cd "${pkgname}-${pkgver}"
# Build frontend
pnpm --dir web run build
# Set Go flags
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
# Build backend
go build -o build ./cmd/...
}
check() {
cd "$pkgname-$pkgver"
go test ./...
}
package() {
# systemd files
install -Dm755 $pkgname.service "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
install -Dm755 $pkgname.sysusers "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
install -Dm755 $pkgname.tmpfiles "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
cd "$pkgname-$pkgver"
# Binary
install -Dm755 build/$pkgname "$pkgdir/usr/bin/$pkgname"
}

33
src/qui/qui.service Normal file
View File

@@ -0,0 +1,33 @@
[Unit]
Description=Modern alternative webUI for qBittorrent
After=network-online.target
Wants=network-online.target
Documentation=https://github.com/autobrr/qui
[Service]
Type=simple
User=qui
Group=qui
Environment=HOME=/var/lib/qui
WorkingDirectory=/var/lib/qui
ExecStart=/usr/bin/qui serve
Restart=on-failure
ProtectSystem=strict
ReadWritePaths=/var/lib/qui
ProtectHome=yes
PrivateTmp=yes
PrivateDevices=yes
NoNewPrivileges=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectControlGroups=yes
CapabilityBoundingSet=
LockPersonality=yes
MemoryDenyWriteExecute=yes
RestrictAddressFamilies=AF_INET AF_INET6
SystemCallArchitectures=native
SystemCallFilter=@system-service
[Install]
WantedBy=multi-user.target

1
src/qui/qui.sysusers Normal file
View File

@@ -0,0 +1 @@
u qui - "qui user" /var/lib/qui

1
src/qui/qui.tmpfiles Normal file
View File

@@ -0,0 +1 @@
d /var/lib/qui 0750 qui qui