From 7941f3da05b6543f3575e676d1d77169906af75e Mon Sep 17 00:00:00 2001 From: Balakrishnan Balasubramanian Date: Thu, 22 Jan 2026 19:15:04 -0500 Subject: [PATCH] Initial commit --- .SRCINFO | 18 ++++++++++++++ .gitignore | 1 + PKGBUILD | 47 ++++++++++++++++++++++++++++++++++++ remote-local-storage.service | 21 ++++++++++++++++ remote-local-storage.socket | 10 ++++++++ 5 files changed, 97 insertions(+) create mode 100644 .SRCINFO create mode 100644 .gitignore create mode 100644 PKGBUILD create mode 100644 remote-local-storage.service create mode 100644 remote-local-storage.socket diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..d7edb83 --- /dev/null +++ b/.SRCINFO @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3bdd095 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +remote-local-storage/ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..088fc67 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,47 @@ +# Maintainer: Balakrishnan Balasubramanian + +# 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" +} diff --git a/remote-local-storage.service b/remote-local-storage.service new file mode 100644 index 0000000..960c6d6 --- /dev/null +++ b/remote-local-storage.service @@ -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 \ No newline at end of file diff --git a/remote-local-storage.socket b/remote-local-storage.socket new file mode 100644 index 0000000..3a6075b --- /dev/null +++ b/remote-local-storage.socket @@ -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 \ No newline at end of file