summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.net>2025-09-11 21:49:03 +0100
committerLeonardo Bishop <me@leonardobishop.net>2025-09-11 21:49:03 +0100
commitcc8524960dc415ceca957dcec2e2d424c514b621 (patch)
tree13e383abf57b8bf8d0b311662487b8f60c1fa58d
Rename to stash
-rw-r--r--.gitignore6
-rw-r--r--PKGBUILD50
-rw-r--r--config.yaml5
-rw-r--r--stash.service33
-rw-r--r--stash.sysusers1
5 files changed, 95 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d1f3de4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*
+!.gitignore
+!PKGBUILD
+!stash.service
+!stash.sysusers
+!config.yaml
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 0000000..59f1dfc
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+# Maintainer: Leonardo Bishop <me@leonardobishop.net>
+_pkgname=stash
+pkgname="${_pkgname}-git"
+pkgdesc="Saved articles tracker"
+pkgver=r9.1b7c07d
+pkgrel=1
+makedepends=('go' 'make' 'git')
+arch=('x86_64')
+url="https://git.leonardobishop.net/stash/about/"
+license=('AGPL-3.0-or-later')
+conflicts=("${_pkgname}")
+provides=("${_pkgname}=${pkgver}")
+source=(stash::git+https://git.leonardobishop.net/stash/
+ stash.service
+ stash.sysusers
+ config.yaml
+ )
+sha256sums=('SKIP'
+ 'cf9e76a0ff22be285e4e392507310ceba5128f61b973058d9e6b7b5d2e43e50c'
+ '2eb21fe51a69bcff17268f476b8e9f059730660cce4eba1325f71dc1393756da'
+ 'f2f11c1abb5956fb1aa278cb724ff985f033501ed786606c8f85040d74e3007a')
+backup=(etc/stash/config.yaml)
+
+pkgver() {
+ cd "stash"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
+}
+
+prepare() {
+ export GOPATH="$srcdir/build"
+
+ cd "stash"
+ go mod download
+}
+
+build() {
+ export GOPATH="$srcdir/build"
+ export PATH="$PATH:$srcdir/build/bin"
+
+ cd "stash"
+ make
+}
+
+package() {
+ install -Dm755 "$srcdir/stash/stash" "$pkgdir/usr/bin/stash"
+ install -Dm644 "$srcdir/stash.service" "$pkgdir/usr/lib/systemd/system/stash.service"
+ install -Dm644 "$srcdir/stash.sysusers" "$pkgdir/usr/lib/sysusers.d/stash.conf"
+ install -Dm755 -d "${pkgdir}/etc/stash"
+ install -Dm644 "$srcdir/config.yaml" "$pkgdir/etc/stash/config.yaml"
+}
diff --git a/config.yaml b/config.yaml
new file mode 100644
index 0000000..74c2cc3
--- /dev/null
+++ b/config.yaml
@@ -0,0 +1,5 @@
+server:
+ host: 0.0.0.0
+ port: 4000
+
+token: ""
diff --git a/stash.service b/stash.service
new file mode 100644
index 0000000..24a1727
--- /dev/null
+++ b/stash.service
@@ -0,0 +1,33 @@
+[Unit]
+Description=Saved articles tracker
+
+[Service]
+User=history
+Restart=always
+ExecStart=/usr/bin/history
+StateDirectory=history
+ConfigurationDirectory=history
+WorkingDirectory=/var/lib/history
+
+CapabilityBoundingSet=CAP_NET_BIND_SERVICE
+AmbientCapabilities=CAP_NET_BIND_SERVICE
+NoNewPrivileges=true
+SystemCallFilter=@system-service
+SystemCallErrorNumber=EPERM
+
+ProtectSystem=strict
+ProtectHome=true
+PrivateTmp=true
+PrivateDevices=true
+ExecPaths=/usr/bin/history
+
+ProtectKernelTunables=true
+ProtectKernelModules=true
+ProtectKernelLogs=true
+ProtectControlGroups=true
+ProtectClock=true
+RestrictRealtime=true
+RestrictSUIDSGID=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/stash.sysusers b/stash.sysusers
new file mode 100644
index 0000000..51cfc9c
--- /dev/null
+++ b/stash.sysusers
@@ -0,0 +1 @@
+u history - "Saved articles tracker" /var/lib/history