aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-01-12 23:47:30 +0100
committerKim Alvefur <zash@zash.se>2016-01-12 23:47:30 +0100
commit527b03ca48588ea5a907b96cc336ccb80843b2d3 (patch)
treeb59356512f9c501edb5a0b98a99fd6dc667f7ab6
parentebf69f75702f72947056cdfd706601c7f69f830e (diff)
downloadprosody-527b03ca48588ea5a907b96cc336ccb80843b2d3.tar.gz
prosody-527b03ca48588ea5a907b96cc336ccb80843b2d3.zip
prosodyctl: check config: Suggest moving modules enabled on all hosts to a global_modules enabled if that is unset
-rwxr-xr-xprosodyctl14
1 files changed, 14 insertions, 0 deletions
diff --git a/prosodyctl b/prosodyctl
index e08c9dd2..1a487fb5 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -877,6 +877,20 @@ function commands.check(arg)
print(" All hosts are disabled. Remove enabled = false from at least one VirtualHost section")
end
end
+ if not config["*"].modules_enabled then
+ print(" No global modules_enabled is set?");
+ local suggested_global_modules;
+ for host, options in enabled_hosts() do
+ if not options.component_module and options.modules_enabled then
+ suggested_global_modules = set.intersection(suggested_global_modules or set.new(options.modules_enabled), set.new(options.modules_enabled));
+ end
+ end
+ if not suggested_global_modules:empty() then
+ print(" Consider moving these modules into modules_enabled in the global section:")
+ print(" "..tostring(suggested_global_modules / function (x) return ("%q"):format(x) end));
+ end
+ print();
+ end
-- Check for global options under hosts
local global_options = set.new(it.to_array(it.keys(config["*"])));
local deprecated_global_options = set.intersection(global_options, deprecated);