From 974866de52bda62de95d06f64169286c8df5b66a Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 16 Jul 2017 19:25:15 +0100 Subject: mod_bosh: Add ::1 to the default trusted_proxies. --- plugins/mod_bosh.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index 5ef0dfb6..9ef4a41e 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -48,7 +48,7 @@ local cross_domain = module:get_option("cross_domain_bosh", false); if cross_domain == true then cross_domain = "*"; end if type(cross_domain) == "table" then cross_domain = table.concat(cross_domain, ", "); end -local trusted_proxies = module:get_option_set("trusted_proxies", {"127.0.0.1"})._items; +local trusted_proxies = module:get_option_set("trusted_proxies", { "127.0.0.1", "::1" })._items; local function get_ip_from_request(request) local ip = request.conn:ip(); -- cgit v1.2.3 From 2e893d1f3563b7a0ecf1267c96eec114326f295a Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 16 Jul 2017 19:25:29 +0100 Subject: mod_register: Add ::1 to the default registration_whitelist. --- plugins/mod_register.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua index e999428d..fd5339d9 100644 --- a/plugins/mod_register.lua +++ b/plugins/mod_register.lua @@ -182,7 +182,7 @@ end local min_seconds_between_registrations = module:get_option_number("min_seconds_between_registrations"); local whitelist_only = module:get_option_boolean("whitelist_registration_only"); -local whitelisted_ips = module:get_option_set("registration_whitelist", { "127.0.0.1" })._items; +local whitelisted_ips = module:get_option_set("registration_whitelist", { "127.0.0.1", "::1" })._items; local blacklisted_ips = module:get_option_set("registration_blacklist", {})._items; local throttle_max = module:get_option_number("registration_throttle_max", min_seconds_between_registrations and 1); -- cgit v1.2.3 From 15ee257b357d532f7c8dc1de83b0379b57203268 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 28 Jul 2017 23:45:05 +0100 Subject: sessionmanager: Revert session.type if binding fails due to roster load error --- core/sessionmanager.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index f7f36ae3..6c9ecc24 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -187,10 +187,14 @@ local function bind_resource(session, resource) local err; session.roster, err = rm_load_roster(session.username, session.host); if err then + -- FIXME: Why is all this rollback down here, instead of just doing the roster test up above? full_sessions[session.full_jid] = nil; hosts[session.host].sessions[session.username].sessions[resource] = nil; session.full_jid = nil; session.resource = nil; + if session.type == "c2s" then + session.type = "c2s_unbound"; + end if next(bare_sessions[session.username..'@'..session.host].sessions) == nil then bare_sessions[session.username..'@'..session.host] = nil; hosts[session.host].sessions[session.username] = nil; -- cgit v1.2.3