aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--prosody-module/mod_http_upload_external/mod_http_upload_external.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/prosody-module/mod_http_upload_external/mod_http_upload_external.lua b/prosody-module/mod_http_upload_external/mod_http_upload_external.lua
index af6d48a..768a956 100644
--- a/prosody-module/mod_http_upload_external/mod_http_upload_external.lua
+++ b/prosody-module/mod_http_upload_external/mod_http_upload_external.lua
@@ -10,8 +10,8 @@
--
-- configuration
-local external_url = "https://snippets.thedevstack.de/httpupload/index.php";
-local xmpp_server_key = "1323978hjkgh12";
+local external_url = module:get_option("http_upload_external_url");
+local xmpp_server_key = module:get_option("http_upload_external_server_key");
-- imports
local st = require"util.stanza";
@@ -36,6 +36,12 @@ module:hook("iq/host/"..xmlns_http_upload..":request", function (event)
origin.send(st.error_reply(stanza, "cancel", "not-authorized"));
return true;
end
+ -- check configuration
+ if not external_url or not xmpp_server_key then
+ module:log("debug", "missing configuration options: http_upload_external_url and/or http_upload_external_server_key");
+ origin.send(st.error_reply(stanza, "cancel", "internal-server-error"));
+ return true;
+ end
-- validate
local filename = request:get_child_text("filename");
if not filename then