Comparison

prosodyctl @ 7085:343be83ddfa6

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Sat, 16 Jan 2016 22:44:43 +0100
parent 7082:8b590fc77d91
child 7147:81e54032d14d
child 7190:7a14ea196db3
comparison
equal deleted inserted replaced
7075:47a2deb74b56 7085:343be83ddfa6
874 elseif config["*"]["enabled"] == false then 874 elseif config["*"]["enabled"] == false then
875 print(" No hosts are enabled. Remove enabled = false from the global section or put enabled = true under at least one VirtualHost section") 875 print(" No hosts are enabled. Remove enabled = false from the global section or put enabled = true under at least one VirtualHost section")
876 else 876 else
877 print(" All hosts are disabled. Remove enabled = false from at least one VirtualHost section") 877 print(" All hosts are disabled. Remove enabled = false from at least one VirtualHost section")
878 end 878 end
879 end
880 if not config["*"].modules_enabled then
881 print(" No global modules_enabled is set?");
882 local suggested_global_modules;
883 for host, options in enabled_hosts() do
884 if not options.component_module and options.modules_enabled then
885 suggested_global_modules = set.intersection(suggested_global_modules or set.new(options.modules_enabled), set.new(options.modules_enabled));
886 end
887 end
888 if not suggested_global_modules:empty() then
889 print(" Consider moving these modules into modules_enabled in the global section:")
890 print(" "..tostring(suggested_global_modules / function (x) return ("%q"):format(x) end));
891 end
892 print();
879 end 893 end
880 -- Check for global options under hosts 894 -- Check for global options under hosts
881 local global_options = set.new(it.to_array(it.keys(config["*"]))); 895 local global_options = set.new(it.to_array(it.keys(config["*"])));
882 local deprecated_global_options = set.intersection(global_options, deprecated); 896 local deprecated_global_options = set.intersection(global_options, deprecated);
883 if not deprecated_global_options:empty() then 897 if not deprecated_global_options:empty() then
1078 if target_hosts:contains("localhost") then 1092 if target_hosts:contains("localhost") then
1079 print(" Target 'localhost' cannot be accessed from other servers"); 1093 print(" Target 'localhost' cannot be accessed from other servers");
1080 target_hosts:remove("localhost"); 1094 target_hosts:remove("localhost");
1081 end 1095 end
1082 1096
1083 local modules = set.new(it.to_array(it.values(host_options.modules_enabled))) 1097 local modules = set.new(it.to_array(it.values(host_options.modules_enabled or {})))
1084 + set.new(it.to_array(it.values(config.get("*", "modules_enabled")))) 1098 + set.new(it.to_array(it.values(config.get("*", "modules_enabled") or {})))
1085 + set.new({ config.get(host, "component_module") }); 1099 + set.new({ config.get(host, "component_module") });
1086 1100
1087 if modules:contains("proxy65") then 1101 if modules:contains("proxy65") then
1088 local proxy65_target = config.get(host, "proxy65_address") or host; 1102 local proxy65_target = config.get(host, "proxy65_address") or host;
1089 local A, AAAA = dns.lookup(idna.to_ascii(proxy65_target), "A"), dns.lookup(idna.to_ascii(proxy65_target), "AAAA"); 1103 local A, AAAA = dns.lookup(idna.to_ascii(proxy65_target), "A"), dns.lookup(idna.to_ascii(proxy65_target), "AAAA");