summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Sommer2021-04-20 18:49:14 +0200
committerMarkus Sommer2021-04-20 18:53:11 +0200
commitac8e967648f1774950c4cc44b0c6605ed4cd8c4b (patch)
tree61119f15b3e61bf2eb1d0298e86d37ce995dc8d7
parentbf85c0e8a59c3ee9ef80c716daf3b811725a8346 (diff)
downloadaur-ac8e967648f1774950c4cc44b0c6605ed4cd8c4b.tar.gz
Implement config file via systemd `EnvironmentFile`
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD16
-rw-r--r--server.conf5
-rw-r--r--valheim-server.service3
4 files changed, 19 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b2d98ae0252..d10d879ff06 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = valheim-server
pkgdesc = Dedicated server for the Valheim PC game
pkgver = 0.150.3
- pkgrel = 1
+ pkgrel = 2
url = https://www.valheimgame.com/
arch = x86_64
license = custom:IronGateLicense
@@ -9,12 +9,15 @@ pkgbase = valheim-server
depends = zlib
depends = gcc-libs
depends = lib32-glibc
+ backup = etc/valheim/server.conf
backup = etc/ufw/applications.d/ufw-valheim
source = valheim-server.service
+ source = server.conf
source = ufw-valheim
source = valheim.sysusers
source = valheim.tmpfiles
- sha512sums = 25b73635f8ab8080fecc7cfa578efb49473563e89bc167243b821b1a6eb44d9eac33568df3d50f57d7d9c1d9de0290c22d91523abaa86cca8008503de20704b2
+ sha512sums = b324089a4ef2e3f908daa469050447ae8cde67e49103bbe238d3b54065464e7d4314e2159eaea2c03f01a6de700288b4a4664cfa40f0d880c8858e2680258d03
+ sha512sums = eeb160800a7e4af5ab0cb6cb8ca60ca8d4be74c6d60e8bb936f21c09c449446270c66cee6c55a6a528b9c8c6b8657fdde87b1a8bf54068c45a7e54d2c5d6ec32
sha512sums = 8c07f061baef278ca6b5bc6da111bf650c835c1b06a6c166f48f2fddea7e26b7c21a02628dfd1e9aa369ad16eb7f2387412b81465a4db5210a17e756f16f208a
sha512sums = c7d47a634e3c75a993e7eecef05b85fc1440316f82f88142cac0774ba56f5822463912e74207dfbdf3b419523fa5e1062da70bd5d1df50e1937e37ba44979613
sha512sums = 86830550c1953137b876258db948af319181760a496c69c3580047f58c18746d70d720a2cfb34650a657a5944b41f1d73bf8aa8d003ffa459056755a2edda8af
diff --git a/PKGBUILD b/PKGBUILD
index 55815bb6c19..f5d18fec5f9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,33 +1,30 @@
# Maintainer: Markus Sommer <markus@splork.de>
#
-# The server does not accept a config file, but needs to be configured via startup options
-# To edit the server options, run `systemctl edit --full valheim-server.service` and edit the `ExecStart`-line.
-# this will create a new service file /etc/systemd/sys/valheim-server.service, based on the supplied file in /usr/lib/systemd/system/valheim-server.service with your edits
-# Specifically, you probably want to edit the "-name" and "-password" options
-#
# I created a macro for ufw, because that's what I use, if you have a macro for a different firewall, feel free to email me a patch.
pkgname=valheim-server
pkgver=0.150.3
-pkgrel=1
+pkgrel=2
pkgdesc="Dedicated server for the Valheim PC game"
arch=('x86_64')
url='https://www.valheimgame.com/'
license=('custom:IronGateLicense')
depends=("zlib" "gcc-libs" "lib32-glibc")
makedepends=("steamcmd")
-backup=("etc/ufw/applications.d/ufw-valheim")
+backup=("etc/valheim/server.conf" "etc/ufw/applications.d/ufw-valheim")
source=('valheim-server.service'
+ 'server.conf'
'ufw-valheim'
'valheim.sysusers'
'valheim.tmpfiles')
-sha512sums=('25b73635f8ab8080fecc7cfa578efb49473563e89bc167243b821b1a6eb44d9eac33568df3d50f57d7d9c1d9de0290c22d91523abaa86cca8008503de20704b2'
+sha512sums=('b324089a4ef2e3f908daa469050447ae8cde67e49103bbe238d3b54065464e7d4314e2159eaea2c03f01a6de700288b4a4664cfa40f0d880c8858e2680258d03'
+ 'eeb160800a7e4af5ab0cb6cb8ca60ca8d4be74c6d60e8bb936f21c09c449446270c66cee6c55a6a528b9c8c6b8657fdde87b1a8bf54068c45a7e54d2c5d6ec32'
'8c07f061baef278ca6b5bc6da111bf650c835c1b06a6c166f48f2fddea7e26b7c21a02628dfd1e9aa369ad16eb7f2387412b81465a4db5210a17e756f16f208a'
'c7d47a634e3c75a993e7eecef05b85fc1440316f82f88142cac0774ba56f5822463912e74207dfbdf3b419523fa5e1062da70bd5d1df50e1937e37ba44979613'
'86830550c1953137b876258db948af319181760a496c69c3580047f58c18746d70d720a2cfb34650a657a5944b41f1d73bf8aa8d003ffa459056755a2edda8af')
prepare() {
- steamcmd +login anonymous +force_install_dir "$srcdir/$pkgname" +app_update 896660 +verify +quit
+ steamcmd +login anonymous +force_install_dir "$srcdir/$pkgname" +app_update 896660 validate +quit
}
package() {
@@ -36,6 +33,7 @@ package() {
cp -r $pkgname "$pkgdir/opt/"
install -D -m 0644 valheim-server.service "$pkgdir/usr/lib/systemd/system/valheim-server.service"
+ install -D -m 0644 server.conf "$pkgdir/etc/valheim/server.conf"
install -D -m 0644 ufw-valheim "$pkgdir/etc/ufw/applications.d/ufw-valheim"
install -D -m 0644 valheim.sysusers "$pkgdir/usr/lib/sysusers.d/valheim.conf"
install -D -m 0644 valheim.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/valheim.conf"
diff --git a/server.conf b/server.conf
new file mode 100644
index 00000000000..4c2de0d0ff4
--- /dev/null
+++ b/server.conf
@@ -0,0 +1,5 @@
+NAME="Valheim"
+PASSWORD="secret"
+PORT=2456
+WORLD="world0"
+PUBLIC=1 \ No newline at end of file
diff --git a/valheim-server.service b/valheim-server.service
index 6cf26136c49..dbeb8cb7509 100644
--- a/valheim-server.service
+++ b/valheim-server.service
@@ -7,7 +7,8 @@ Type=simple
User=valheim
Group=valheim
Environment="LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH"
-ExecStart=/opt/valheim-server/valheim_server.x86_64 -name "Valheim" -password "secret" -port 2456 -world "world0" -public 1
+EnvironmentFile=/etc/valheim/server.conf
+ExecStart=/opt/valheim-server/valheim_server.x86_64 -name ${NAME} -password ${PASSWORD} -port ${PORT} -world ${WORLD} -public ${PUBLIC}
WorkingDirectory=/opt/valheim-server
KillSignal=SIGINT
NoNewPrivileges=true