mirror of
https://github.com/YunoHost-Apps/jitsi_ynh.git
synced 2024-09-03 19:35:57 +02:00
removing mod_http_altconnect.lua
This commit is contained in:
parent
a07e0f7e68
commit
acfb394912
7 changed files with 1 additions and 78 deletions
|
@ -4,11 +4,6 @@ component_ports = { __PORT_COMPONENT__ }
|
|||
|
||||
plugin_paths = { "__FINAL_PATH__/jitsi-meet-prosody/" }
|
||||
|
||||
modules_enabled = {
|
||||
-- For Jitsi Meet
|
||||
"http_altconnect";
|
||||
}
|
||||
|
||||
-- Make the focus user a global administrator
|
||||
admins = { "__FOCUS_USER__@auth.__DOMAIN__" }
|
||||
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
-- mod_http_altconnect
|
||||
-- XEP-0156: Discovering Alternative XMPP Connection Methods
|
||||
|
||||
module:depends"http";
|
||||
|
||||
local mm = require "core.modulemanager";
|
||||
local json = require"util.json";
|
||||
local st = require"util.stanza";
|
||||
local array = require"util.array";
|
||||
|
||||
local function get_supported()
|
||||
local uris = array();
|
||||
if mm.is_loaded(module.host, "bosh") or mm.is_loaded("*", "bosh") then
|
||||
uris:push({ rel = "urn:xmpp:alt-connections:xbosh", href = module:http_url("bosh", "/http-bind") });
|
||||
end
|
||||
if mm.is_loaded(module.host, "websocket") or mm.is_loaded("*", "websocket") then
|
||||
uris:push({ rel = "urn:xmpp:alt-connections:websocket", href = module:http_url("websocket", "xmpp-websocket"):gsub("^http", "ws") });
|
||||
end
|
||||
return uris;
|
||||
end
|
||||
|
||||
|
||||
local function GET_xml(event)
|
||||
local request, response = event.request, event.response;
|
||||
local xrd = st.stanza("XRD", { xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0' });
|
||||
local uris = get_supported();
|
||||
for i, method in ipairs(uris) do
|
||||
xrd:tag("Link", method):up();
|
||||
end
|
||||
response.headers.content_type = "application/xrd+xml"
|
||||
response.headers.access_control_allow_origin = "*";
|
||||
return '<?xml version="1.0" encoding="UTF-8"?>' .. tostring(xrd);
|
||||
end
|
||||
|
||||
local function GET_json(event)
|
||||
local request, response = event.request, event.response;
|
||||
local jrd = { links = get_supported() };
|
||||
response.headers.content_type = "application/json"
|
||||
response.headers.access_control_allow_origin = "*";
|
||||
return json.encode(jrd);
|
||||
end;
|
||||
|
||||
local function GET_either(event)
|
||||
local accept_type = event.request.headers.accept or "";
|
||||
if ( accept_type:find("xml") or #accept_type ) < ( accept_type:find("json") or #accept_type+1 ) then
|
||||
return GET_xml(event);
|
||||
else
|
||||
return GET_json(event);
|
||||
end
|
||||
end;
|
||||
|
||||
module:provides("http", {
|
||||
default_path = "/.well-known";
|
||||
route = {
|
||||
["GET /host-meta"] = GET_either;
|
||||
-- ["GET /host-meta.xml"] = GET_xml; -- Hmmm
|
||||
["GET /host-meta.json"] = GET_json;
|
||||
};
|
||||
});
|
|
@ -60,9 +60,6 @@ ynh_backup --src_path="/usr/share/yunohost/templates/jitsi/auth.$domain.cfg.lua"
|
|||
# Backup Metronome Hook
|
||||
ynh_backup --src_path="/usr/share/yunohost/hooks/conf_regen/50-metronome_$app"
|
||||
|
||||
# Backup Metronome Module
|
||||
ynh_backup --src_path="/usr/lib/metronome/modules/mod_http_altconnect.lua"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE APP CONFIG
|
||||
#=================================================
|
||||
|
|
|
@ -182,9 +182,6 @@ touch "/usr/share/yunohost/templates/jitsi/auth.$domain.cfg.lua"
|
|||
# Add Metronome hook
|
||||
cp -R ../conf/metronome_regen_conf.hook /usr/share/yunohost/hooks/conf_regen/50-metronome_$app
|
||||
|
||||
# Add Metronome modules
|
||||
cp ../conf/mod_http_altconnect.lua /usr/lib/metronome/modules/mod_http_altconnect.lua
|
||||
|
||||
yunohost tools regen-conf metronome
|
||||
|
||||
metronomectl adduser $focus_user@auth.$domain $focus_password || true
|
||||
|
|
|
@ -115,11 +115,6 @@ fi
|
|||
#=================================================
|
||||
ynh_script_progression --message="Reconfiguring Metronome..."
|
||||
|
||||
# Remove Metronome modules
|
||||
ynh_secure_remove --file="/usr/lib/metronome/modules/mod_http_altconnect.lua"
|
||||
|
||||
ynh_systemd_action --service_name=metronome --action=restart
|
||||
|
||||
metronomectl deluser $focus_user@auth.$domain || true
|
||||
metronomectl deluser $videobridge_user@auth.$domain || true
|
||||
|
||||
|
|
|
@ -125,9 +125,6 @@ ynh_restore_file --origin_path="/usr/share/yunohost/templates/jitsi/auth.$domain
|
|||
# Restore Metronome Hook
|
||||
ynh_restore_file --origin_path="/usr/share/yunohost/hooks/conf_regen/50-metronome_$app"
|
||||
|
||||
# Restore Metronome modules
|
||||
ynh_restore_file --origin_path="/usr/lib/metronome/modules/mod_http_altconnect.lua"
|
||||
|
||||
yunohost tools regen-conf metronome
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -78,6 +78,7 @@ if ynh_version_gt "1.0.3969~ynh1" "${current_version}" ; then
|
|||
|
||||
# Remove Previously installed Metronome modules
|
||||
ynh_secure_remove --file="/usr/lib/metronome/modules/mod_carbons.lua"
|
||||
ynh_secure_remove --file="/usr/lib/metronome/modules/mod_http_altconnect.lua"
|
||||
ynh_secure_remove --file="/usr/lib/metronome/modules/mod_smacks.lua"
|
||||
|
||||
# Remove nodejs
|
||||
|
|
Loading…
Reference in a new issue