diff options
Diffstat (limited to 'modules/spanningtree/server.cpp')
| -rw-r--r-- | modules/spanningtree/server.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/modules/spanningtree/server.cpp b/modules/spanningtree/server.cpp index 711bc3b9b..e9d8ebd19 100644 --- a/modules/spanningtree/server.cpp +++ b/modules/spanningtree/server.cpp @@ -23,6 +23,8 @@ */ +#include <filesystem> + #include "inspircd.h" #include "modules/ssl.h" @@ -33,6 +35,22 @@ #include "treesocket.h" #include "commands.h" +namespace +{ + bool RunningInContainer() + { + std::error_code ec; + if (std::filesystem::is_regular_file("/.dockerenv", ec)) + { + // We are running inside of Docker so all IP addresses are + // non-local and as far as I can see there isn't a way to + // reliably detect the Docker network. + return true; + } + return false; + } +} + /* * Some server somewhere in the network introducing another server. * -- w @@ -138,7 +156,7 @@ std::shared_ptr<Link> TreeSocket::AuthRemote(const CommandBase::Params& params) ssliohook->GetCiphersuite(ciphersuite); ServerInstance->SNO.WriteToSnoMask('l', "Negotiated ciphersuite {} on link {}", ciphersuite, x->Name); } - else if (!capab->remotesa.is_local()) + else if (!capab->remotesa.is_local() && !RunningInContainer()) { this->SendError("Non-local server connections MUST be linked with SSL!"); return nullptr; |
