prosodyctl check: Point out items in the modules_enabled list that incorrectly includ...
authorKim Alvefur <zash@zash.se>
Thu, 3 Dec 2015 15:15:59 +0000 (16:15 +0100)
committerKim Alvefur <zash@zash.se>
Thu, 3 Dec 2015 15:15:59 +0000 (16:15 +0100)
prosodyctl

index dcfe693091eedb9c928369afd4aedc51300cfbed..4826b83da3c492e0bfe392f1e04f25ba2802ebf5 100755 (executable)
@@ -913,9 +913,18 @@ function commands.check(arg)
                                print("     For more information see: http://prosody.im/doc/dns");
                        end
                end
+               local all_modules = set.new(config["*"].modules_enabled);
                local all_options = set.new(it.to_array(it.keys(config["*"])));
                for host in enabled_hosts() do
                        all_options:include(set.new(it.to_array(it.keys(config[host]))));
+                       all_modules:include(set.new(config[host].modules_enabled));
+               end
+               for mod in all_modules do
+                       if mod:match("^mod_") then
+                               print("");
+                               print("    Modules in modules_enabled should not have the 'mod_' prefix included.");
+                               print("    Change '"..mod.."' to '"..mod:match("^mod_(.*)").."'.");
+                       end
                end
                local ssl = dependencies.softreq"ssl";
                if not ssl then