Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .SRCINFO
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
pkgbase = gotify-server
pkgdesc = A simple server for sending and receiving messages in real-time per WebSocket.
pkgver = 2.0.14
pkgrel = 3
pkgrel = 4
url = https://gotify.net/
install = gotify-server.install
arch = x86_64
arch = i686
arch = aarch64
Expand All @@ -12,16 +13,16 @@ pkgbase = gotify-server
makedepends = go
makedepends = yarn
depends = glibc
options = emptydirs
backup = etc/gotify/config.yml
source = gotify-server-2.0.14.tar.gz::https://github.com/gotify/server/archive/v2.0.14.tar.gz
source = sysusers.d
source = tmpfiles.d
source = config.yml
source = gotify-server.service
source = config.patch
sha256sums = 986125b92192e404a2f3af5db510d2d651c6301d218cbb66edd6013f8e8153b0
sha256sums = 2052ac82ceb607701bd505c9df4170bb65c14601a4c8dda3c4ee36fd399c3dfa
sha256sums = 6d90cb466122331b983fac2d20a53f82c96db3e340297ec218cf296d0083dbc5
sha256sums = 4023cd8e241accc8e650dd5a93fbad0c3f9c3ca87b1a83d1fd39c83178216dfa
sha256sums = 9c187715b12269ff4bf6768b1e7813daafb5812df1f3bc010c894c7b736743fa
sha256sums = 39fc913f205bbb102ba42ce3d419f2feb0f9143f14ccffd242b3cd5f51a8c0de
sha256sums = 9aa04ff9a2981aa885d4f8df7467c4d7722aa12de7ae27376a4a11b559a0d1e2
sha256sums = 8009ba82fa98bfeeb8c51732d8506afdef4ccfdcd4071be5fcf64af06ae2b1f4

pkgname = gotify-server

32 changes: 20 additions & 12 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
# Maintainer: ml <ml@visu.li>
# @TODO systemd service optimization, systemd socket, ui
# Maintainer: jmattheis <contact AT jmattheis DOT de>
# Contributor: ml <ml@visu.li>
pkgname=gotify-server
pkgver=2.0.14
_commit=e56f7bc4c7efdb61fea88a0b65d501277604cefa
pkgrel=3
pkgrel=4
pkgdesc='A simple server for sending and receiving messages in real-time per WebSocket.'
arch=('x86_64' 'i686' 'aarch64' 'armv7')
url='https://gotify.net/'
license=('MIT')
depends=('glibc')
makedepends=('git' 'go' 'yarn')
backup=('etc/gotify/config.yml')
install="${pkgname}.install"
options=(emptydirs)
source=(
"$pkgname-$pkgver.tar.gz::https://github.com/gotify/server/archive/v${pkgver}.tar.gz"
'sysusers.d'
'tmpfiles.d'
'config.yml'
'gotify-server.service'
'config.patch'
)
sha256sums=('986125b92192e404a2f3af5db510d2d651c6301d218cbb66edd6013f8e8153b0'
'2052ac82ceb607701bd505c9df4170bb65c14601a4c8dda3c4ee36fd399c3dfa'
'6d90cb466122331b983fac2d20a53f82c96db3e340297ec218cf296d0083dbc5'
'4023cd8e241accc8e650dd5a93fbad0c3f9c3ca87b1a83d1fd39c83178216dfa'
'9c187715b12269ff4bf6768b1e7813daafb5812df1f3bc010c894c7b736743fa')
'39fc913f205bbb102ba42ce3d419f2feb0f9143f14ccffd242b3cd5f51a8c0de'
'9aa04ff9a2981aa885d4f8df7467c4d7722aa12de7ae27376a4a11b559a0d1e2'
'8009ba82fa98bfeeb8c51732d8506afdef4ccfdcd4071be5fcf64af06ae2b1f4')

prepare() {
patch -N -p1 -d "server-$pkgver" <config.patch
}

build() {
cd "server-$pkgver"
(
cd ui
yarn --non-interactive --frozen-lockfile
yarn --non-interactive --frozen-lockfile build
NODE_ENV=production yarn --non-interactive --frozen-lockfile build
)
go run github.com/gobuffalo/packr/packr
local build_date=$(date "+%F-%T" -d "@${SOURCE_DATE_EPOCH}")
Expand All @@ -45,16 +50,19 @@ build() {

check() {
cd "server-$pkgver"
# https://github.com/gotify/server/pull/279
rm -vf config/config_test.go
go test -v ./...
}

package() {
install -Dm644 sysusers.d "$pkgdir/usr/lib/sysusers.d/gotify.conf"
install -Dm644 tmpfiles.d "$pkgdir/usr/lib/tmpfiles.d/gotify.conf"
install -Dm644 config.yml "$pkgdir/etc/gotify/config.yml"
install -Dm644 gotify-server.service "$pkgdir/usr/lib/systemd/system/gotify-server.service"
# required for StandardOutput in gotify-server.service
install -dm755 "$pkgdir/var/log/gotify"

cd "server-$pkgver"
install -Dm755 "$pkgname" "$pkgdir/usr/bin/$pkgname"
install -Dm644 config.example.yml "$pkgdir/etc/gotify/config.yml"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
36 changes: 36 additions & 0 deletions config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff -ura package.orig/config.example.yml package.new/config.example.yml
--- package.orig/config.example.yml 2020-03-08 14:59:02.828681120 +0100
+++ package.new/config.example.yml 2020-03-12 02:30:06.273495477 +0100
@@ -3,7 +3,7 @@

server:
listenaddr: "" # the address to bind on, leave empty to bind on all addresses
- port: 80 # the port the HTTP server will listen on
+ port: 9071 # the port the HTTP server will listen on

ssl:
enabled: false # if https should be enabled
@@ -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
41 changes: 0 additions & 41 deletions config.yml

This file was deleted.

12 changes: 12 additions & 0 deletions gotify-server.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
post_install() {
echo 'Default login is admin:admin'
echo 'Change it in /etc/gotify/config.yml or the web ui before exposing the service!'
}

post_upgrade() {
if [[ $(vercmp '2.0.14-4' "$2") -eq 1 ]]; then
echo 'Default port for gotify-server has changed with version "2.0.14-4"'
echo 'old port: 8080'
echo 'new port: 9071'
fi
}
34 changes: 34 additions & 0 deletions gotify-server.service
Original file line number Diff line number Diff line change
@@ -1,12 +1,46 @@
[Unit]
Description=Gotify Server
After=network.target
ConditionPathIsDirectory=%L/gotify

[Service]
Type=simple
User=gotify
Group=gotify
ExecStart=/usr/bin/gotify-server

ConfigurationDirectory=gotify
LogsDirectory=gotify
StateDirectory=gotify
StateDirectoryMode=0700
StandardOutput=append:%L/gotify/server.log

UMask=0027
CapabilityBoundingSet=
AmbientCapabilities=
LockPersonality=true
MemoryDenyWriteExecute=true
NoNewPrivileges=true
PrivateDevices=true
PrivateTmp=true
PrivateUsers=true
ProtectClock=true
ProtectControlGroups=true
ProtectHome=true
ProtectHostname=true
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectSystem=strict
RemoveIPC=true
RestrictAddressFamilies=AF_INET AF_INET6
RestrictNamespaces=true
RestrictRealtime=true
RestrictSUIDSGID=true
SystemCallArchitectures=native
SystemCallErrorNumber=EPERM
SystemCallFilter=@system-service
SystemCallFilter=~@privileged @resources

[Install]
WantedBy=multi-user.target
2 changes: 1 addition & 1 deletion sysusers.d
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
u gotify - - /var/lib/gotify
u gotify - -
g gotify - -
1 change: 0 additions & 1 deletion tmpfiles.d

This file was deleted.