# HG changeset patch # User Trần H. Trung # Date 1690629084 -25200 # Node ID 6fb93b901aa485d244b7098ec30321a4947d9948 # Parent 758866b43aa4cc832e619d17d49232fc76c228f5# Parent ae62d92506dc6fa70785f9db3065b98ad30d04a6 Merge upstream diff -r 758866b43aa4 -r 6fb93b901aa4 mod_invites_page/mod_invites_page.lua --- a/mod_invites_page/mod_invites_page.lua Sat Jul 29 18:08:58 2023 +0700 +++ b/mod_invites_page/mod_invites_page.lua Sat Jul 29 18:11:24 2023 +0700 @@ -39,6 +39,9 @@ else http_files = module:depends"http_files"; end + elseif prosody.process_type and module.get_option_period then + module:depends("http"); + http_files = require "net.http.files"; end -- Calculate automatic base_url default base_url = module.http_url and module:http_url(); diff -r 758866b43aa4 -r 6fb93b901aa4 mod_s2sout_override/README.md --- a/mod_s2sout_override/README.md Sat Jul 29 18:08:58 2023 +0700 +++ b/mod_s2sout_override/README.md Sat Jul 29 18:11:24 2023 +0700 @@ -18,6 +18,13 @@ URIs with IP addresses like `tcp://127.0.0.1:9999` will bypass A/AAAA DNS lookups. +The special target `"*"` may be used to redirect all servers that don't have +an exact match. + +One-level wildcards like `"*.example.net"` also work. + +Standard DNS SRV resolution can be restored by specifying a truthy value. + ```lua -- Global section modules_enabled = { @@ -28,7 +35,13 @@ s2sout_override = { ["example.com"] = "tcp://other.host.example:5299"; ["xmpp.example.net"] = "tcp://localhost:5999"; - ["secure.example"] = = "tls://127.0.0.1:5270"; + ["secure.example"] = "tls://127.0.0.1:5270"; + ["*.allthese.example"] = = "tcp://198.51.100.123:9999"; + + -- catch-all: + ["*"] = "tls://127.0.0.1:5370"; + -- bypass the catch-all, use standard DNS SRV: + ["jabber.example"] = true; } ``` diff -r 758866b43aa4 -r 6fb93b901aa4 mod_s2sout_override/mod_s2sout_override.lua --- a/mod_s2sout_override/mod_s2sout_override.lua Sat Jul 29 18:08:58 2023 +0700 +++ b/mod_s2sout_override/mod_s2sout_override.lua Sat Jul 29 18:11:24 2023 +0700 @@ -6,7 +6,7 @@ local override_for = module:get_option(module.name, {}); -- map of host to "tcp://example.com:5269" module:hook("s2sout-pre-connect", function(event) - local override = override_for[event.session.to_host]; + local override = override_for[event.session.to_host] or override_for[event.session.to_host:gsub("^[^.]+%.", "*.")] or override_for["*"]; if type(override) == "string" then override = url.parse(override); end