From 83fe5814abd6b5e4193ff5b4c87e3ec91103aaf8 Mon Sep 17 00:00:00 2001 From: miniduikboot Date: Wed, 24 Jan 2024 21:18:42 +0100 Subject: [PATCH] Only throw warning outside of docker containers --- src/Impostor.Server/Net/MatchmakerService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Impostor.Server/Net/MatchmakerService.cs b/src/Impostor.Server/Net/MatchmakerService.cs index 9b0d478..eb73fb1 100644 --- a/src/Impostor.Server/Net/MatchmakerService.cs +++ b/src/Impostor.Server/Net/MatchmakerService.cs @@ -1,4 +1,5 @@ -using System.Net; +using System; +using System.Net; using System.Threading; using System.Threading.Tasks; using Impostor.Api.Config; @@ -48,7 +49,8 @@ namespace Impostor.Server.Net _logger.LogError("For more info on how to do this see https://github.com/Impostor/Impostor/blob/master/docs/Server-configuration.md"); } - if (_httpServerConfig.ListenIp == "0.0.0.0") + var runningOutsideContainer = Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER") == null; + if (_httpServerConfig.ListenIp == "0.0.0.0" && runningOutsideContainer) { _logger.LogWarning("Your HTTP server is exposed to the public internet, we recommend setting up a reverse proxy and enabling HTTPS"); _logger.LogWarning("See https://github.com/Impostor/Impostor/blob/master/docs/Http-server.md for instructions"); -- 2.39.5