Diff

spec/scansion/prosody.cfg.lua @ 13626:ac60c21015c7

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
author Kim Alvefur <zash@zash.se>
date Thu, 16 Jan 2025 15:05:00 +0100
parent 13494:4c3d6ed9c823
line wrap: on
line diff
--- a/spec/scansion/prosody.cfg.lua	Thu Jan 16 11:35:19 2025 +0000
+++ b/spec/scansion/prosody.cfg.lua	Thu Jan 16 15:05:00 2025 +0100
@@ -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 "{}")