summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortejr <tejr@sqt.wtf>2021-01-23 14:11:07 +1300
committertejr <tejr@sqt.wtf>2021-01-23 14:11:07 +1300
commitd429bfcfed0be8fd0784c231c03aa32431b70bd4 (patch)
tree2eb6ed939926196b8760de16fe7c66bdccd9a13d
parentAdd Lua environment variables to sample (diff)
downloadsoundboard-d429bfcfed0be8fd0784c231c03aa32431b70bd4.tar.gz
soundboard-d429bfcfed0be8fd0784c231c03aa32431b70bd4.zip
Switch to fixed config path
-rw-r--r--Makefile5
-rwxr-xr-xsoundboard2
-rw-r--r--soundboard.service1
3 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index da74b0c..a90c497 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,11 @@
PREFIX = /usr/local/soundboard
WEBROOT = /var/www/html
+CONFDIR = /etc/soundboard
all:
install:
mkdir -p -- $(WEBROOT)
cp -- index.php script.js $(WEBROOT)
mkdir -p -- $(PREFIX)/bin
- cp -- soundboard config.toml $(PREFIX)/bin
+ cp -- soundboard $(PREFIX)/bin
+ mkdir -p -- $(CONFDIR)
+ cp -- config.toml $(CONFDIR)
diff --git a/soundboard b/soundboard
index 6eeba7e..a05e336 100755
--- a/soundboard
+++ b/soundboard
@@ -18,7 +18,7 @@ local function readfile(filename)
return contents
end
-local config = toml.parse(readfile("config.toml"))
+local config = toml.parse(readfile("/etc/soundboard/config.toml"))
local ctx
if config.ws_server.tls.enabled == true then
diff --git a/soundboard.service b/soundboard.service
index d62475c..92b428c 100644
--- a/soundboard.service
+++ b/soundboard.service
@@ -6,7 +6,6 @@ RuntimeDirectory=%p
PermissionsStartOnly=true
Environment=LUA_PATH=/var/lib/soundboard/.luarocks/share/lua/5.1/?.lua;/var/lib/soundboard/.luarocks/share/lua/5.1/?/init.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;./?.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua
Environment=LUA_CPATH=/var/lib/soundboard/.luarocks/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/?.so;./?.so;/usr/lib/x86_64-linux-gnu/lua/5.1/?.so;/usr/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so
-WorkingDirectory=/var/lib/soundboard
ExecStartPre=/bin/cp /etc/letsencrypt/live/soundboard.sqt.wtf/fullchain.pem /etc/letsencrypt/live/soundboard.sqt.wtf/privkey.pem %t/%p
ExecStartPre=/bin/chown soundboard.soundboard %t/%p/fullchain.pem %t/%p/privkey.pem
ExecStart=/usr/local/soundboard/bin/soundboard