Federated chat: enabling the direct s2s mode.

This commit is contained in:
John Livingston 2023-05-25 17:32:51 +02:00
parent 2de38661d6
commit c00ffc31b2
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 6 additions and 10 deletions

View File

@ -14,11 +14,8 @@ TODO?: mod_s2s_peertubelivechat: dont allow to connect to remote server that are
TODO: when sanitizing remote chat endpoint, check that the domain is the same as the video domain (or is room.videodomain.tld).
TODO: only compatible with Prosody 0.12.x. So it should be documented for people using «system Prosody». And i should fix the ARM AppImage.
TODO: it seems that in some case A->B can be Websocket, and B->A direct S2S. Check if this is fine. And maybe we can optimise some code, by allowing directS2S event if current server dont accept it.
TODO: add a specific websocket timeout option, and send keepalive. In production the connection is often close and reopened because of nginx 30s timeout.
TODO: alpha.2 version force Websocket S2S when available, even if s2s is possible. Revert this before releasing.
TODO?: always generate self-signed certificates. Could be used for outgoing s2s?
TODO: check in the diagnostic tool that Prosody is >=0.12
TODO: ARM AppImage, and to say that needs Prosody >=0.12
### Minor changes and fixes

View File

@ -10,13 +10,12 @@ function discover_websocket_s2s(event)
local to_host = event.to_host;
module:log("debug", "Searching websocket s2s for remote host %s", to_host);
-- FIXME: this was commented for the 6.4.0-alpha2, to test ws s2s. Revert before releasing.
-- local f_s2s = io.open(path.join(server_infos_dir, to_host, 's2s'), "r");
-- if f_s2s ~= nil then
-- io.close(f_s2s);
-- module:log("debug", "Remote host is a known Peertube %s that has s2s activated, we will let legacy s2s module handle the connection", to_host);
-- return;
-- end
local f_s2s = io.open(path.join(server_infos_dir, to_host, 's2s'), "r");
if f_s2s ~= nil then
io.close(f_s2s);
module:log("debug", "Remote host is a known Peertube %s that has s2s activated, we will let legacy s2s module handle the connection", to_host);
return;
end
local f_ws_proxy = io.open(path.join(server_infos_dir, to_host, 'ws-s2s'), "r");
if f_ws_proxy == nil then