From e6ae9b73c4178a47968c35fb4749bb902fc3a02a Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Fri, 17 Nov 2023 10:48:45 -0500 Subject: [PATCH 1/7] Throw the failing error message in Live tests --- tests/Tgstation.Server.Tests/Live/HardFailLogger.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Tgstation.Server.Tests/Live/HardFailLogger.cs b/tests/Tgstation.Server.Tests/Live/HardFailLogger.cs index eca7cf4ef58..af42b145649 100644 --- a/tests/Tgstation.Server.Tests/Live/HardFailLogger.cs +++ b/tests/Tgstation.Server.Tests/Live/HardFailLogger.cs @@ -30,7 +30,7 @@ public void Log(LogLevel logLevel, EventId eventId, TState state, Except && !(logMessage.StartsWith("An exception occurred in the database while saving changes for context type") && (exception is OperationCanceledException || exception?.InnerException is OperationCanceledException))) || (logLevel == LogLevel.Critical && logMessage != "DropDatabase configuration option set! Dropping any existing database...")) { - failureSink(new AssertFailedException("TGS logged an unexpected error!")); + failureSink(new AssertFailedException($"TGS ERR: {logMessage}")); } } } From 7eafed4fb9ce4e50c370793342a0e607d64b348c Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Fri, 17 Nov 2023 14:45:26 -0500 Subject: [PATCH 2/7] Add missing hashtag to DMAPI releases --- tools/Tgstation.Server.ReleaseNotes/Program.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/Tgstation.Server.ReleaseNotes/Program.cs b/tools/Tgstation.Server.ReleaseNotes/Program.cs index 79b594e5059..6aba269c2fb 100644 --- a/tools/Tgstation.Server.ReleaseNotes/Program.cs +++ b/tools/Tgstation.Server.ReleaseNotes/Program.cs @@ -1322,6 +1322,12 @@ static string GenerateComponentNotes(ReleaseNotes releaseNotes, Component compon PrintChanges(newNotes, relevantChangelog); } + if(component == Component.DreamMakerApi) + { + newNotes.AppendLine(); + newNotes.AppendLine("#tgs-dmapi-release"); + } + var markdown = newNotes.ToString(); return markdown; } From 3abf0b69f2a61941b1dd970ce40c5ba0ed4a4831 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Fri, 17 Nov 2023 22:25:06 -0500 Subject: [PATCH 3/7] Do not increase request stack depth when just adding response headers --- .../Extensions/ApplicationBuilderExtensions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tgstation.Server.Host/Extensions/ApplicationBuilderExtensions.cs b/src/Tgstation.Server.Host/Extensions/ApplicationBuilderExtensions.cs index 55086228dc6..53d953afe5c 100644 --- a/src/Tgstation.Server.Host/Extensions/ApplicationBuilderExtensions.cs +++ b/src/Tgstation.Server.Host/Extensions/ApplicationBuilderExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.Net; @@ -158,10 +158,10 @@ public static void UseServerBranding(this IApplicationBuilder applicationBuilder ArgumentNullException.ThrowIfNull(applicationBuilder); ArgumentNullException.ThrowIfNull(assemblyInformationProvider); - applicationBuilder.Use(async (context, next) => + applicationBuilder.Use((context, next) => { context.Response.Headers.Add("X-Powered-By", assemblyInformationProvider.VersionPrefix); - await next(); + return next(); }); } From f9f712a05bdfc28b802cb48d76354f4c76b59a8d Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Fri, 17 Nov 2023 22:25:22 -0500 Subject: [PATCH 4/7] Add `X-Accel-Buffering: no` response header --- src/Tgstation.Server.Host/Core/Application.cs | 3 +++ .../ApplicationBuilderExtensions.cs | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Tgstation.Server.Host/Core/Application.cs b/src/Tgstation.Server.Host/Core/Application.cs index 41effa00940..3daa375299c 100644 --- a/src/Tgstation.Server.Host/Core/Application.cs +++ b/src/Tgstation.Server.Host/Core/Application.cs @@ -463,6 +463,9 @@ public void Configure( // Add the X-Powered-By response header applicationBuilder.UseServerBranding(assemblyInformationProvider); + // Add the X-Accel-Buffering response header + applicationBuilder.UseDisabledNginxProxyBuffering(); + // suppress OperationCancelledExceptions, they are just aborted HTTP requests applicationBuilder.UseCancelledRequestSuppression(); diff --git a/src/Tgstation.Server.Host/Extensions/ApplicationBuilderExtensions.cs b/src/Tgstation.Server.Host/Extensions/ApplicationBuilderExtensions.cs index 53d953afe5c..bc2a6dd3d72 100644 --- a/src/Tgstation.Server.Host/Extensions/ApplicationBuilderExtensions.cs +++ b/src/Tgstation.Server.Host/Extensions/ApplicationBuilderExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.Net; @@ -165,6 +165,23 @@ public static void UseServerBranding(this IApplicationBuilder applicationBuilder }); } + /// + /// Add the X-Accel-Buffering response header. + /// + /// The to configure. + /// This is used to avoid interruption to SignalR streams by Nginx. + public static void UseDisabledNginxProxyBuffering(this IApplicationBuilder applicationBuilder) + { + ArgumentNullException.ThrowIfNull(applicationBuilder); + + // https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/#x-accel-buffering + applicationBuilder.Use((context, next) => + { + context.Response.Headers.Add("X-Accel-Buffering", "no"); + return next(); + }); + } + /// /// Adds additional global to the request pipeline. /// From 94c62de31625fec8a296fc67dfbe82d89b956307 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Fri, 17 Nov 2023 22:25:40 -0500 Subject: [PATCH 5/7] Version bump to 5.18.1 --- build/Version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Version.props b/build/Version.props index 3478f0fc6ff..28f2e724a5e 100644 --- a/build/Version.props +++ b/build/Version.props @@ -3,7 +3,7 @@ - 5.18.0 + 5.18.1 4.7.1 9.14.0 7.0.0 From 061f61ff9934b1494c6381b23aee59c9c2b233fe Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Fri, 17 Nov 2023 22:28:49 -0500 Subject: [PATCH 6/7] Slightly reword SSE notice for reverse proxies --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b051b218485..ec8528c0a66 100644 --- a/README.md +++ b/README.md @@ -385,7 +385,7 @@ System administrators will most likely have their own configuration plans, but h Once complete, test that your configuration worked by visiting your proxy site from a browser on a different computer. You should recieve a 401 Unauthorized response. -_NOTE: For SignalR to function properly, make sure your reverse proxy setup supports SSE (Server-Sent Events)_ +_NOTE: Your reverse proxy setup may interfere with SSE (Server-Sent Events) which is used for real-time job updates. If you find this to be the case, please open an issue describing what you did to fix it as there may be a way for us to bypass the need for a workaround from our end._ #### IIS (Reccommended for Windows) From bd6fbd2d3b8e515d6c9c7536309e05944e697b70 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Fri, 17 Nov 2023 23:22:19 -0500 Subject: [PATCH 7/7] Fix logic error preventing settings updates in `AdvancedWatchdog` --- .../Components/Watchdog/AdvancedWatchdog.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tgstation.Server.Host/Components/Watchdog/AdvancedWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/AdvancedWatchdog.cs index 7878854458e..00e91224796 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/AdvancedWatchdog.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/AdvancedWatchdog.cs @@ -222,7 +222,7 @@ async Task CleanupLingeringDeployment() else Logger.LogTrace("Nothing to do as pendingSwappable is null."); - return MonitorAction.Continue; + return await base.HandleNormalReboot(cancellationToken); } ///