From 546781317494c225b9446bacd368f618917fdf52 Mon Sep 17 00:00:00 2001 From: lookshe Date: Wed, 13 Jan 2016 10:30:46 +0100 Subject: read url and server_key from configuration --- .../mod_http_upload_external/mod_http_upload_external.lua | 10 ++++++++-- 1 file 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 -- cgit v1.2.3