Changeset

11066:dc41c8dfd2b1

mod_http: Silence warnings when running under prosodyctl
author Matthew Wild <mwild1@gmail.com>
date Fri, 11 Sep 2020 12:37:07 +0100
parents 11065:95eb1a981ef6
children 11068:988ddd57e851
files plugins/mod_http.lua
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_http.lua	Wed Sep 09 17:12:00 2020 +0100
+++ b/plugins/mod_http.lua	Fri Sep 11 12:37:07 2020 +0100
@@ -93,7 +93,9 @@
 			return url_build(url);
 		end
 	end
-	module:log("warn", "No http ports enabled, can't generate an external URL");
+	if prosody.process_type == "prosody" then
+		module:log("warn", "No http ports enabled, can't generate an external URL");
+	end
 	return "http://disabled.invalid/";
 end
 
@@ -190,7 +192,7 @@
 		local services = portmanager.get_active_services();
 		if services:get("https") or services:get("http") then
 			module:log("info", "Serving '%s' at %s", app_name, module:http_url(app_name, app_path));
-		else
+		elseif prosody.process_type == "prosody" then
 			module:log("warn", "Not listening on any ports, '%s' will be unreachable", app_name);
 		end
 	end