Initial commit

This commit is contained in:
2026-01-22 19:15:04 -05:00
commit 7941f3da05
5 changed files with 97 additions and 0 deletions

18
.SRCINFO Normal file
View File

@@ -0,0 +1,18 @@
pkgbase = remote-local-storage-git
pkgdesc = Simple wrapper to save and restore localStorage of webapps in server
pkgver = r8.ea930dc
pkgrel = 1
url = https://gitea.balki.me/balki/remote-local-storage
arch = x86_64
license = MPL-2.0
makedepends = git
makedepends = go
conflicts = remote-local-storage
source = git+https://gitea.balki.me/balki/remote-local-storage.git#branch=main
source = remote-local-storage.service
source = remote-local-storage.socket
sha256sums = SKIP
sha256sums = 6bdfbf02c5caef218507087d32cfdedcade0e74f97e099574f3dd8b0d66dfeb6
sha256sums = 4c0a9bc570346857c0132e14eb277dd25ea97cd6d35b560e69f8c60b4bd252c1
pkgname = remote-local-storage-git

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
remote-local-storage/

47
PKGBUILD Normal file
View File

@@ -0,0 +1,47 @@
# Maintainer: Balakrishnan Balasubramanian <aur@balki.me>
# Reference: https://wiki.archlinux.org/index.php?title=Go_package_guidelines#Sample_PKGBUILD
pkgname=remote-local-storage-git
_pkgname=remote-local-storage
pkgver=r8.ea930dc
pkgrel=1
pkgdesc='Simple wrapper to save and restore localStorage of webapps in server'
arch=('x86_64')
url="https://gitea.balki.me/balki/$_pkgname"
license=('MPL-2.0')
conflicts=("${_pkgname}")
makedepends=('git' 'go')
source=("git+$url.git#branch=main" "$_pkgname.service" "$_pkgname.socket")
sha256sums=('SKIP'
'6bdfbf02c5caef218507087d32cfdedcade0e74f97e099574f3dd8b0d66dfeb6'
'4c0a9bc570346857c0132e14eb277dd25ea97cd6d35b560e69f8c60b4bd252c1')
prepare() {
cd "$_pkgname"
mkdir -p build/
}
pkgver() {
cd "$_pkgname"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}
build() {
cd "$_pkgname"
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"
go build -o build ./
}
package() {
cd "$_pkgname"
install -Dm755 build/"$_pkgname" "$pkgdir/usr/bin/$_pkgname"
install -Dm644 README.md -t "$pkgdir/usr/share/doc/$_pkgname"
install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
install -Dm644 "${srcdir}/$_pkgname.service" -t "$pkgdir/usr/lib/systemd/system"
install -Dm644 "${srcdir}/$_pkgname.socket" -t "$pkgdir/usr/lib/systemd/system"
}

View File

@@ -0,0 +1,21 @@
[Unit]
Description=localStorage persistence service for web applications
[Service]
Type=simple
DynamicUser=yes
StateDirectory=remote-local-storage
StateDirectoryMode=0700
WorkingDirectory=/var/lib/remote-local-storage
ExecStart=/usr/bin/remote-local-storage -address "sysd?name=remote-local-storage.socket&idle_timeout=1h"
NoNewPrivileges=yes
CapabilityBoundingSet=
RestrictNamespaces=true
SystemCallFilter=@system-service
ProtectProc=invisible
ProtectHome=true
PrivateNetwork=yes

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Socket activation for remote-local-storage
[Socket]
ListenStream=/run/rls.sock
SocketGroup=caddy
SocketMode=0660
[Install]
WantedBy=sockets.target