Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
buckket committed Apr 18, 2019
0 parents commit cbf1f03
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .SRCINFO
Original file line number Diff line number Diff line change
@@ -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

38 changes: 38 additions & 0 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Maintainer: buckket <[email protected]>

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}/"
}

26 changes: 26 additions & 0 deletions gotify-arch-defaults.patch
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions gotify-server.service
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions gotify-server.sysusers
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
u gotify - "gotify daemon user" /var/lib/gotify /usr/bin/bash
7 changes: 7 additions & 0 deletions gotify-server.tmpfiles
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit cbf1f03

Please sign in to comment.