aboutsummaryrefslogtreecommitdiffstats
path: root/spec/scansion
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2025-01-16 15:05:00 +0100
committerKim Alvefur <zash@zash.se>2025-01-16 15:05:00 +0100
commit2f37c443b8df7263529424870f5e810dabc5fa59 (patch)
tree508041feed7bfb000ef947ff69b49c72e877f64e /spec/scansion
parent76f00fc2e3efc9298abf496713b3dfef12b6f174 (diff)
downloadprosody-2f37c443b8df7263529424870f5e810dabc5fa59.tar.gz
prosody-2f37c443b8df7263529424870f5e810dabc5fa59.zip
core.configmanager: Add ways to read config values from files
Inspired by something MattJ said Allows retrieving config values from files which are expected to be relative to the config directory, extending on the ENV_ method of retrieving config values from outside the config file. - FileLine retrieves the first line, stripping any trailing newline - FileContents reads the whole file - FileLines reads lines into an array
Diffstat (limited to 'spec/scansion')
-rw-r--r--spec/scansion/admins.txt1
-rw-r--r--spec/scansion/prosody.cfg.lua2
2 files changed, 2 insertions, 1 deletions
diff --git a/spec/scansion/admins.txt b/spec/scansion/admins.txt
new file mode 100644
index 00000000..db9fa85a
--- /dev/null
+++ b/spec/scansion/admins.txt
@@ -0,0 +1 @@
+admin@localhost
diff --git a/spec/scansion/prosody.cfg.lua b/spec/scansion/prosody.cfg.lua
index 58889fd7..91c86644 100644
--- a/spec/scansion/prosody.cfg.lua
+++ b/spec/scansion/prosody.cfg.lua
@@ -1,6 +1,6 @@
--luacheck: ignore
-admins = { "admin@localhost" }
+admins = FileLines("admins.txt")
network_backend = ENV_PROSODY_NETWORK_BACKEND or "epoll"
network_settings = Lua.require"prosody.util.json".decode(ENV_PROSODY_NETWORK_SETTINGS or "{}")