Merge 0.10->trunk
authorKim Alvefur <zash@zash.se>
Sun, 12 Jun 2016 18:06:30 +0000 (20:06 +0200)
committerKim Alvefur <zash@zash.se>
Sun, 12 Jun 2016 18:06:30 +0000 (20:06 +0200)
1  2 
prosodyctl

diff --combined prosodyctl
index 4a6ce44efd68acfe4b33fea8250e119cc9eb97cb,226ff2cf48b370ea991b3a63228191074243c5bf..15d40f26a7b66e16bb88010b6587be5d6f8b01a9
@@@ -103,7 -103,7 +103,7 @@@ d
                        print("A sample config file is included in the Prosody download called prosody.cfg.lua.dist");
                        print("Copy or rename it to prosody.cfg.lua and edit as necessary.");
                end
 -              print("More help on configuring Prosody can be found at http://prosody.im/doc/configure");
 +              print("More help on configuring Prosody can be found at https://prosody.im/doc/configure");
                print("Good luck!");
                print("**************************");
                print("");
@@@ -168,7 -168,7 +168,7 @@@ if ok and pposix the
        pposix.setenv("PROSODY_CONFIG", ENV_CONFIG);
  else
        print("Error: Unable to load pposix module. Check that Prosody is installed correctly.")
 -      print("For more help send the below error to us through http://prosody.im/discuss");
 +      print("For more help send the below error to us through https://prosody.im/discuss");
        print(tostring(pposix))
        os.exit(1);
  end
@@@ -219,9 -219,9 +219,9 @@@ local error_messages = setmetatable(
                ["no-such-user"] = "The given user does not exist on the server";
                ["no-such-host"] = "The given hostname does not exist in the config";
                ["unable-to-save-data"] = "Unable to store, perhaps you don't have permission?";
 -              ["no-pidfile"] = "There is no 'pidfile' option in the configuration file, see http://prosody.im/doc/prosodyctl#pidfile for help";
 -              ["invalid-pidfile"] = "The 'pidfile' option in the configuration file is not a string, see http://prosody.im/doc/prosodyctl#pidfile for help";
 -              ["no-posix"] = "The mod_posix module is not enabled in the Prosody config file, see http://prosody.im/doc/prosodyctl for more info";
 +              ["no-pidfile"] = "There is no 'pidfile' option in the configuration file, see https://prosody.im/doc/prosodyctl#pidfile for help";
 +              ["invalid-pidfile"] = "The 'pidfile' option in the configuration file is not a string, see https://prosody.im/doc/prosodyctl#pidfile for help";
 +              ["no-posix"] = "The mod_posix module is not enabled in the Prosody config file, see https://prosody.im/doc/prosodyctl for more info";
                ["no-such-method"] = "This module has no commands";
                ["not-running"] = "Prosody is not running";
                }, { __index = function (t,k) return "Error: "..(tostring(k):gsub("%-", " "):gsub("^.", string.upper)); end });
@@@ -365,8 -365,8 +365,8 @@@ function commands.deluser(arg
        end
        local user, host = jid_split(arg[1]);
        if not user and host then
 -              show_message [[Failed to understand JID, please supply the JID you want to set the password for]]
 -              show_usage [[passwd user@host]]
 +              show_message [[Failed to understand JID, please supply the JID to the user account you want to delete]]
 +              show_usage [[deluser user@host]]
                return 1;
        end
        
@@@ -882,7 -882,7 +882,7 @@@ function commands.check(arg
                        ok = false;
                        print("");
                        print("    No global options defined. Perhaps you have put a host definition at the top")
 -                      print("    of the config file? They should be at the bottom, see http://prosody.im/doc/configure#overview");
 +                      print("    of the config file? They should be at the bottom, see https://prosody.im/doc/configure#overview");
                end
                if it.count(enabled_hosts()) == 0 then
                        ok = false;
                                local n = it.count(misplaced_options);
                                print("    You have "..n.." option"..(n>1 and "s " or " ").."set under "..host.." that should be");
                                print("    in the global section of the config file, above any VirtualHost or Component definitions,")
 -                              print("    see http://prosody.im/doc/configure#overview for more information.")
 +                              print("    see https://prosody.im/doc/configure#overview for more information.")
                                print("");
                                print("    You need to move the following option"..(n>1 and "s" or "")..": "..table.concat(it.to_array(misplaced_options), ", "));
                        end
                                print("");
                                print("    Suggestion: If "..host.. " is a new host with no real users yet, consider renaming it now to");
                                print("     "..host:gsub("^[^.]+%.", "")..". You can use SRV records to redirect XMPP clients and servers to "..host..".");
 -                              print("     For more information see: http://prosody.im/doc/dns");
 +                              print("     For more information see: https://prosody.im/doc/dns");
                        end
                end
                local all_modules = set.new(config["*"].modules_enabled);
                                print("    For more information see https://prosody.im/doc/storage");
                        end
                end
+               local require_encryption = set.intersection(all_options, set.new({"require_encryption", "c2s_require_encryption", "s2s_require_encryption"})):empty();
                local ssl = dependencies.softreq"ssl";
                if not ssl then
-                       if not set.intersection(all_options, set.new({"require_encryption", "c2s_require_encryption", "s2s_require_encryption"})):empty() then
+                       if not require_encryption then
                                print("");
                                print("    You require encryption but LuaSec is not available.");
                                print("    Connections will fail.");
                                        ok = false;
                                end
                        end
+               elseif require_encryption and not all_modules:contains("tls") then
+                       print("");
+                       print("    You require encryption but mod_tls is not enabled.");
+                       print("    Connections will fail.");
+                       ok = false;
                end
                
                print("Done.\n");
                                end
                                if host_ok_v6 and not v6_supported then
                                        print("    Host "..host.." has AAAA records, but your version of LuaSocket does not support IPv6.");
 -                                      print("      Please see http://prosody.im/doc/ipv6 for more information.");
 +                                      print("      Please see https://prosody.im/doc/ipv6 for more information.");
                                end
                        end
                        if not all_targets_ok then
                end
                if not problem_hosts:empty() then
                        print("");
 -                      print("For more information about DNS configuration please see http://prosody.im/doc/dns");
 +                      print("For more information about DNS configuration please see https://prosody.im/doc/dns");
                        print("");
                        ok = false;
                end
                        end
                        if cert_ok == false then
                                print("")
 -                              print("For more information about certificates please see http://prosody.im/doc/certificates");
 +                              print("For more information about certificates please see https://prosody.im/doc/certificates");
                                ok = false
                        end
                end