Comparison

util/prosodyctl/check.lua @ 11799:8c9ec2db1d95

util.prosodyctl.check: Fix to not treat some options as misplaced All 'net' providers generate a _port option which must be in the global section, but this mistakenly also warns about these options as well.
author Kim Alvefur <zash@zash.se>
date Tue, 14 Sep 2021 01:41:59 +0200
parent 11798:ba88060fa145
child 11800:60018637f5d4
comparison
equal deleted inserted replaced
11798:ba88060fa145 11799:8c9ec2db1d95
251 or name:match("_ports?$") or name:match("_interfaces?$") 251 or name:match("_ports?$") or name:match("_interfaces?$")
252 or (name:match("_ssl$") and not name:match("^[cs]2s_ssl$")) then 252 or (name:match("_ssl$") and not name:match("^[cs]2s_ssl$")) then
253 misplaced_options:add(name); 253 misplaced_options:add(name);
254 end 254 end
255 end 255 end
256 -- FIXME These _could_ be misplaced, but we would have to check where the corresponding module is loaded to be sure
257 misplaced_options:exclude(set.new({ "external_service_port", "turn_external_port" }));
256 if not misplaced_options:empty() then 258 if not misplaced_options:empty() then
257 ok = false; 259 ok = false;
258 print(""); 260 print("");
259 local n = it.count(misplaced_options); 261 local n = it.count(misplaced_options);
260 print(" You have "..n.." option"..(n>1 and "s " or " ").."set under "..host.." that should be"); 262 print(" You have "..n.." option"..(n>1 and "s " or " ").."set under "..host.." that should be");