Comparison

prosodyctl @ 9231:3d12b4f41b23

prosodyctl: Also look for options that belong in global section under disabled hosts (fixes #1207) Thanks ivucica
author Kim Alvefur <zash@zash.se>
date Thu, 30 Aug 2018 00:17:54 +0200
parent 8948:3be8799263f3
child 9545:9dc7280dd8dc
comparison
equal deleted inserted replaced
9230:711fea229e48 9231:3d12b4f41b23
862 print(""); 862 print("");
863 print(" You have some deprecated options in the global section:"); 863 print(" You have some deprecated options in the global section:");
864 print(" "..tostring(deprecated_global_options)) 864 print(" "..tostring(deprecated_global_options))
865 ok = false; 865 ok = false;
866 end 866 end
867 for host, options in enabled_hosts() do 867 for host, options in it.filter(function (h) return h ~= "*" end, pairs(configmanager.getconfig())) do
868 local host_options = set.new(it.to_array(it.keys(options))); 868 local host_options = set.new(it.to_array(it.keys(options)));
869 local misplaced_options = set.intersection(host_options, known_global_options); 869 local misplaced_options = set.intersection(host_options, known_global_options);
870 for name in pairs(options) do 870 for name in pairs(options) do
871 if name:match("^interfaces?") 871 if name:match("^interfaces?")
872 or name:match("_ports?$") or name:match("_interfaces?$") 872 or name:match("_ports?$") or name:match("_interfaces?$")
882 print(" in the global section of the config file, above any VirtualHost or Component definitions,") 882 print(" in the global section of the config file, above any VirtualHost or Component definitions,")
883 print(" see https://prosody.im/doc/configure#overview for more information.") 883 print(" see https://prosody.im/doc/configure#overview for more information.")
884 print(""); 884 print("");
885 print(" You need to move the following option"..(n>1 and "s" or "")..": "..table.concat(it.to_array(misplaced_options), ", ")); 885 print(" You need to move the following option"..(n>1 and "s" or "")..": "..table.concat(it.to_array(misplaced_options), ", "));
886 end 886 end
887 end
888 for host, options in enabled_hosts() do
889 local host_options = set.new(it.to_array(it.keys(options)));
887 local subdomain = host:match("^[^.]+"); 890 local subdomain = host:match("^[^.]+");
888 if not(host_options:contains("component_module")) and (subdomain == "jabber" or subdomain == "xmpp" 891 if not(host_options:contains("component_module")) and (subdomain == "jabber" or subdomain == "xmpp"
889 or subdomain == "chat" or subdomain == "im") then 892 or subdomain == "chat" or subdomain == "im") then
890 print(""); 893 print("");
891 print(" Suggestion: If "..host.. " is a new host with no real users yet, consider renaming it now to"); 894 print(" Suggestion: If "..host.. " is a new host with no real users yet, consider renaming it now to");