Software /
code /
prosody
Comparison
prosodyctl @ 6162:fbc3b195dab8
prosodyctl: Check that there is at least one enabled VirtualHost (or Component) defined
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 02 May 2014 08:56:03 +0200 |
parent | 6161:afcba9737ac3 |
child | 6326:a3b9496673ee |
comparison
equal
deleted
inserted
replaced
6161:afcba9737ac3 | 6162:fbc3b195dab8 |
---|---|
828 if it.count(it.filter("log", pairs(config["*"]))) == 0 then | 828 if it.count(it.filter("log", pairs(config["*"]))) == 0 then |
829 ok = false; | 829 ok = false; |
830 print(""); | 830 print(""); |
831 print(" No global options defined. Perhaps you have put a host definition at the top") | 831 print(" No global options defined. Perhaps you have put a host definition at the top") |
832 print(" of the config file? They should be at the bottom, see http://prosody.im/doc/configure#overview"); | 832 print(" of the config file? They should be at the bottom, see http://prosody.im/doc/configure#overview"); |
833 end | |
834 if it.count(enabled_hosts()) == 0 then | |
835 ok = false; | |
836 print(""); | |
837 if it.count(it.filter("*", pairs(config))) == 0 then | |
838 print(" No hosts are defined, please add at least one VirtualHost section") | |
839 elseif config["*"]["enabled"] == false then | |
840 print(" No hosts are enabled. Remove enabled = false from the global section or put enabled = true under at least one VirtualHost section") | |
841 else | |
842 print(" All hosts are disabled. Remove enabled = false from at least one VirtualHost section") | |
843 end | |
833 end | 844 end |
834 -- Check for global options under hosts | 845 -- Check for global options under hosts |
835 local global_options = set.new(it.to_array(it.keys(config["*"]))); | 846 local global_options = set.new(it.to_array(it.keys(config["*"]))); |
836 local deprecated_global_options = set.intersection(global_options, deprecated); | 847 local deprecated_global_options = set.intersection(global_options, deprecated); |
837 if not deprecated_global_options:empty() then | 848 if not deprecated_global_options:empty() then |