diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..871cbf8 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,24 @@ +pkgbase = gotify-server-bin + pkgdesc = A simple server for sending and receiving messages + pkgver = 2.0.5 + pkgrel = 1 + url = https://github.com/gotify/server + arch = x86_64 + license = MIT + provides = gotify-server + conflicts = gotify-server + source = https://github.com/gotify/server/releases/download/v2.0.5/gotify-linux-amd64.zip + source = https://raw.githubusercontent.com/gotify/server/v2.0.5/config.example.yml + source = gotify-arch-defaults.patch + source = gotify-server.tmpfiles + source = gotify-server.sysusers + source = gotify-server.service + sha256sums = 21e7ffcd607e86d0a6a1dd9f68494534ec0562bdb112840f38a2dd10eb127c38 + sha256sums = 2c469de4161ac354004d801b0d70395b710dc38739a57fa0c832314d0aab34ca + sha256sums = eface4b7901b849cf97fb62c691e37b0bf1dd80e947a3da193379bcf7e92c7b0 + sha256sums = 14bd1a9270b089b99d9bbe8ebdd0c208c3f74c7347a792d508ffce75b0e1c641 + sha256sums = 4fbff6e5ade1ec96cff61b4bc933ef7771f63b6df5c8e43323a8fe4d341a5a4d + sha256sums = bcfa3f4cc7ffa44a41ea7247ca4bf879bea6e6e1da79f85ed9bb4141b8501028 + +pkgname = gotify-server-bin + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..53afa3a --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,38 @@ +# Maintainer: buckket + +pkgname=gotify-server-bin +_pkgname=gotify-server +pkgver=2.0.5 +pkgrel=1 +pkgdesc='A simple server for sending and receiving messages' +arch=('x86_64') +url='https://github.com/gotify/server' +license=('MIT') +provides=('gotify-server') +conflicts=('gotify-server') +source=("$url/releases/download/v${pkgver}/gotify-linux-amd64.zip" + "https://raw.githubusercontent.com/gotify/server/v${pkgver}/config.example.yml" + 'gotify-arch-defaults.patch' + 'gotify-server.tmpfiles' + 'gotify-server.sysusers' + 'gotify-server.service') +sha256sums=('21e7ffcd607e86d0a6a1dd9f68494534ec0562bdb112840f38a2dd10eb127c38' + '2c469de4161ac354004d801b0d70395b710dc38739a57fa0c832314d0aab34ca' + 'eface4b7901b849cf97fb62c691e37b0bf1dd80e947a3da193379bcf7e92c7b0' + '14bd1a9270b089b99d9bbe8ebdd0c208c3f74c7347a792d508ffce75b0e1c641' + '4fbff6e5ade1ec96cff61b4bc933ef7771f63b6df5c8e43323a8fe4d341a5a4d' + 'bcfa3f4cc7ffa44a41ea7247ca4bf879bea6e6e1da79f85ed9bb4141b8501028') + +prepare() { + patch --follow-symlinks --forward --strip=1 --input="${srcdir}/gotify-arch-defaults.patch" +} + +package() { + install -Dm755 gotify-linux-amd64 "${pkgdir}/usr/bin/${_pkgname}" + install -D config.example.yml "${pkgdir}/etc/gotify/config.yml" + install -Dm644 ${_pkgname}.service -t "${pkgdir}"/usr/lib/systemd/system/ + install -Dm644 ${_pkgname}.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/${_pkgname}.conf + install -Dm644 ${_pkgname}.sysusers "${pkgdir}"/usr/lib/sysusers.d/${_pkgname}.conf + install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${_pkgname}/" +} + diff --git a/gotify-arch-defaults.patch b/gotify-arch-defaults.patch new file mode 100644 index 0000000..a0bc11c --- /dev/null +++ b/gotify-arch-defaults.patch @@ -0,0 +1,26 @@ +--- a/config.example.yml ++++ b/config.example.yml +@@ -15,7 +15,7 @@ + letsencrypt: + enabled: false # if the certificate should be requested from letsencrypt + accepttos: false # if you accept the tos from letsencrypt +- cache: data/certs # the directory of the cache from letsencrypt ++ cache: /var/lib/gotify/certs # the directory of the cache from letsencrypt + hosts: # the hosts for which letsencrypt should request certificates + - mydomain.tld + - myotherdomain.tld +@@ -31,11 +31,11 @@ + + database: # for database see (configure database section) + dialect: sqlite3 +- connection: data/gotify.db ++ connection: /var/lib/gotify/gotify.db + + defaultuser: # on database creation, gotify creates an admin user + name: admin # the username of the default user + pass: admin # the password of the default user + passstrength: 10 # the bcrypt password strength (higher = better but also slower) +-uploadedimagesdir: data/images # the directory for storing uploaded images +-pluginsdir: data/plugins # the directory where plugin resides ++uploadedimagesdir: /var/lib/gotify/images # the directory for storing uploaded images ++pluginsdir: /var/lib/gotify/plugins # the directory where plugin resides diff --git a/gotify-server.service b/gotify-server.service new file mode 100644 index 0000000..9be9d8e --- /dev/null +++ b/gotify-server.service @@ -0,0 +1,31 @@ +[Unit] +Description=gotify +After=network.target + +[Service] +User=gotify +Group=gotify +Type=simple +WorkingDirectory=~ +StateDirectory=gotify +StateDirectoryMode=0750 +Environment=USER=gotify HOME=/var/lib/gotify +ExecStart=/usr/bin/gotify-server +PrivateUsers=true +PrivateDevices=true +PrivateTmp=true +ProtectHome=true +ProtectSystem=strict +ProtectControlGroups=yes +ProtectKernelTunables=true +ProtectKernelModules=yes +ReadWritePaths=/etc/gotify/config.yml +LockPersonality=true +MemoryDenyWriteExecute=true +RestrictRealtime=true +SystemCallArchitectures=native +SystemCallFilter=@system-service + +[Install] +WantedBy=multi-user.target + diff --git a/gotify-server.sysusers b/gotify-server.sysusers new file mode 100644 index 0000000..1400ab2 --- /dev/null +++ b/gotify-server.sysusers @@ -0,0 +1 @@ +u gotify - "gotify daemon user" /var/lib/gotify /usr/bin/bash diff --git a/gotify-server.tmpfiles b/gotify-server.tmpfiles new file mode 100644 index 0000000..b45cdc3 --- /dev/null +++ b/gotify-server.tmpfiles @@ -0,0 +1,7 @@ +d /var/lib/gotify 0750 +d /var/lib/gotify/images 0750 +d /var/lib/gotify/plugins 0750 +d /var/lib/gotify/certs 0750 +Z /var/lib/gotify - gotify gotify +z /etc/gotify 0755 root gotify +z /etc/gotify/config.yml 0660 root gotify