Matthew Wild
22acb5626f
configmanager: Emit config warning when referencing non-existent value
9 months ago
Kim Alvefur
6b1e056142
core.configmanager: Pass name and line number in context
...
Delays the string interpolation until the warning is logged, which may
slightly lower memory usage.
Allows retrieving the filename and line number easily.
10 months ago
Kim Alvefur
5e41daac79
core.configmanager: Fix reporting delayed warnings from global section
...
A Credential in the global section would be stored at
delayed_warnings["*/secret"], but get("example.com","secret") would look
for delayed_warnings["example.com/secret"]
Storing the warnings in the config itself has the unfortunate
side-effect that the config now contains util.error objects, which may
be awkward if something bypasses get(). Should rawget() also do this
filtering? getconfig() too?
Currently this only affects prosodyctl, so maybe it won't be much of a
problem.
10 months ago
Kim Alvefur
9eedb15c6f
core.configmanager: Remove dependency on 'prosody' global for Credential
...
Minimizing dependencies on global state is nice, as it makes using
configmanager outside of Prosody easier.
10 months ago
Kim Alvefur
e91c540eea
core.configmanager: Delay reporting warnings about Credential until use
...
Too much noise to use Credential if you get a pile of warnings every
time you touch prosodyctl for anything. This way warnings should be
printed only if e.g used by prosodyctl check config or a module command.
11 months ago
Kim Alvefur
2d4ea8ac9b
core.configmanager: Remove compat
...
I have updated my config now, have you? :)
11 months ago
Kim Alvefur
97884eb956
util.startup: Rename credentials path variable too
11 months ago
Kim Alvefur
059d6457e0
core.configmanager: Rename Secret to Credential
...
To match the variable name and what systemd calls them.
11 months ago
Kim Alvefur
41a360ce2a
core.configmanager: Add function for getting secrets from separate files
...
Idea is to enable easily retrieving of secret values from files outside
of the config, e.g. via the method used by systemd credentials.
CREDENTIALS_DIRECTORY is expected to be set by the process manager
invoking Prosody, so being unset and unavailable from prosodyctl is
going to be normal and a warning is reported in that case. Care will
have to be taken to make it clear that prosodyctl check will not work
with such values. An error is thrown if the directory is unavailable
when running under Prosody.
11 months ago
Kim Alvefur
2f37c443b8
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
11 months ago
Matthew Wild
0f493bd245
configmanager: Clearer errors when providing unexpected values after VirtualHost ( fixes #1735 , thanks arawaks)
4 years ago
Matthew Wild
a52c531dc5
configmanager: Add method to report loaded config files (part of #1729 fix)
4 years ago
Matthew Wild
9bd1726821
configmanager: Fix linter issues
2 years ago
Matthew Wild
7a288248f0
configmanager: Support for appending to existing config options
...
...and some other useful operations
2 years ago
Matthew Wild
cc0f973628
configmanager: Make _G accessible via `Lua` variable, deprecate direct access
2 years ago
Matthew Wild
c2d0d411d4
configmanager: Allow referencing previously-set options in the config file
2 years ago
Kim Alvefur
d47a7bb3bd
core: Prefix module imports with prosody namespace
3 years ago
Kim Alvefur
67177ce287
core.configmanager: Remove COMPAT for old config format from 2013
4 years ago
Matthew Wild
c482490bff
configmanager: Update error message to say 'VirtualHost' instead of 'Host'
4 years ago
Kim Alvefur
f563584fca
core.configmanager: Handle nameprep validation errors
6 years ago
Kim Alvefur
4b69a96d83
core.configmanager: Ensure Hosts are given names
...
Prevents traceback from nameprep(nil)
6 years ago
João Duarte
32b5c6feeb
core.configmanager: Removed code related to complement_lua_path
6 years ago
João Duarte
2af161560a
core.configmanager: Added support to 'complement_lua_path'
6 years ago
Matthew Wild
c9cc5d4a6e
configmanager: Allow referencing environment variables in the config as as ENV_<name>
7 years ago
Kim Alvefur
7e64fa124a
configmanager: Move firing of the 'config-reloaded' event into util.startup ( fixes #1117 )
8 years ago
Kim Alvefur
43b814a83b
vairious: Add annotation when an empty environment is set [luacheck]
8 years ago
Kim Alvefur
ab47caa72f
configmanager: Remove unused local [luacheck]
9 years ago
Emmanuel Gil Peyrot
eb231e9eab
configmanager: Remove support for multiple parsers, fixes #852 .
9 years ago
Kim Alvefur
1ecc3a7918
core: Split some very long lines [luacheck]
9 years ago
Matthew Wild
f96b8f343a
configmanager: Refactor function to avoid re-declaring local variable [luacheck]
11 years ago
Matthew Wild
3de0d3e049
configmanager: Rename unused function arguments [luacheck]
11 years ago
Matthew Wild
55f7842f8a
configmanager: Rename variable to avoid name conflicts [luacheck]
11 years ago
Matthew Wild
0558bfbcb7
configmanager: Rename unused function argument [luacheck]
11 years ago
Matthew Wild
9dcab34382
configmanager: Remove unnecessary function localizations [luacheck]
11 years ago
Matthew Wild
c9c311b940
configmanager: Rename variable to avoid name conflict [luacheck]
11 years ago
Matthew Wild
7523668ad0
configmanager: Rename variable to avoid name conflict [luacheck]
11 years ago
Kim Alvefur
27265c20e2
core.*: Remove use of module() function
11 years ago
Matthew Wild
fa962495db
configmanager: nameprep VirtualHost and Component names
12 years ago
Kim Alvefur
eeacb3cb6f
configmanager: Delay importing LuaFileSystem until needed by an Include line
12 years ago
Kim Alvefur
084761b5ef
core.configmanager: Move path utility functions into util.paths
12 years ago
Kim Alvefur
e7c0815019
configmanager: Fix checking of absolute paths on Windows
13 years ago
Florian Zeitz
1d833bb807
Remove all trailing whitespace
13 years ago
Matthew Wild
245f460991
configmanager: Some cleanup, remove unused variables and imports
13 years ago
Kim Alvefur
869da6c240
configmanager: Fix so unset variables are searched for in the global section
13 years ago
Matthew Wild
ee5a8c9543
configmanager, hostmanager, prosody: Almost complete removal of section-related code, and the infamous 'core' section. Still backwards-compatible with API users.
13 years ago
Matthew Wild
3c5b09b7f1
configmanager: Fix include of relative files via Include directive in config
13 years ago
Matthew Wild
7dfdcd5e09
configmanager: Pass through warnings from included files
7 years ago
Matthew Wild
1e6c93ec05
configmanager: Emit warning for duplicated config options
7 years ago
Matthew Wild
76ebc7778e
configmanager: Add support for returning warnings
7 years ago
Florian Zeitz
d49b9bc2ab
Eliminate direct setfenv usage
14 years ago