mirror of
https://github.com/bjc/prosody.git
synced 2025-04-03 21:27:38 +03:00
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
This commit is contained in:
parent
76f00fc2e3
commit
2f37c443b8
4 changed files with 37 additions and 4 deletions
1
spec/scansion/admins.txt
Normal file
1
spec/scansion/admins.txt
Normal file
|
@ -0,0 +1 @@
|
|||
admin@localhost
|
|
@ -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 "{}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue