]> git.deb.at Git - rhonda/impostor.git/commitdiff
Only throw warning outside of docker containers
authorminiduikboot <mini@duikbo.at>
Wed, 24 Jan 2024 20:18:42 +0000 (21:18 +0100)
committerminiduikboot <mini@duikbo.at>
Wed, 24 Jan 2024 20:21:07 +0000 (21:21 +0100)
src/Impostor.Server/Net/MatchmakerService.cs

index 9b0d478d90c7043166fe02fc8fdb5d5e55b1ef96..eb73fb1efdf0ac69a4906f6c79160802ebcf1506 100644 (file)
@@ -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");