diff --git a/README.md b/README.md index 4161afa21b..a229c9a697 100644 --- a/README.md +++ b/README.md @@ -329,7 +329,7 @@ Create an `appsettings.Production.yml` file next to `appsettings.yml`. This will #### OAuth Configuration -- `Security:OAuth:`: Sets the OAuth client ID and secret for a given ``. The currently supported providers are `GitHub`, `Discord`, `InvisionCommunity` and `TGForums`. Setting these fields to `null` disables logins AND gateway auth with the provider, but does not stop users from associating their accounts using the API. Sample Entry: +- `Security:OAuth:`: Sets the OAuth client ID and secret for a given ``. The currently supported providers are `GitHub`, `Discord`, and `InvisionCommunity`. Setting these fields to `null` disables logins AND gateway auth with the provider, but does not stop users from associating their accounts using the API. Sample Entry: ```yml Security: OAuth: @@ -369,6 +369,8 @@ Security: - `Security:OidcStrictMode`: Boolean flag that, when `true`, disables password and OAuth logins, password changes, individual permission set assignment, and enables user registration using OpenID Connect providers. The claim name `tgstation-server-group-id` is used to dictate what TGS group users are registered to. +_Note: When using OIDC with a reverse proxy, TGS must receive `X-Forwarded` headers to properly identify the redirect URI to use. i.e. `X-Forwarded-Host` and `X-Forwarded-Proto`._ + ### Database Configuration If using a MariaDB/MySQL server, our client library [recommends you set 'utf8mb4' as your default charset](https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#1-recommended-server-charset) disregard at your own risk. diff --git a/build/Version.props b/build/Version.props index e504a6475f..edf4220733 100644 --- a/build/Version.props +++ b/build/Version.props @@ -3,7 +3,7 @@ - 6.15.0 + 6.15.1 5.6.0 10.13.0 0.6.0 diff --git a/build/WebpanelVersion.props b/build/WebpanelVersion.props index 2c3b54d0f1..9364e27aff 100644 --- a/build/WebpanelVersion.props +++ b/build/WebpanelVersion.props @@ -1,6 +1,6 @@ - 6.9.0 + 6.9.3 diff --git a/src/Tgstation.Server.Host.Service/Tgstation.Server.Host.Service.csproj b/src/Tgstation.Server.Host.Service/Tgstation.Server.Host.Service.csproj index 07863a2111..65a0469a4e 100644 --- a/src/Tgstation.Server.Host.Service/Tgstation.Server.Host.Service.csproj +++ b/src/Tgstation.Server.Host.Service/Tgstation.Server.Host.Service.csproj @@ -21,11 +21,11 @@ - + - + diff --git a/src/Tgstation.Server.Host/Core/Application.cs b/src/Tgstation.Server.Host/Core/Application.cs index ba07babec1..93be5a1fec 100644 --- a/src/Tgstation.Server.Host/Core/Application.cs +++ b/src/Tgstation.Server.Host/Core/Application.cs @@ -22,6 +22,7 @@ using Microsoft.AspNetCore.Cors.Infrastructure; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Connections; +using Microsoft.AspNetCore.HttpOverrides; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.SignalR; @@ -617,6 +618,12 @@ namespace Tgstation.Server.Host.Core // Wrap exceptions in a 500 (ErrorMessage) response applicationBuilder.UseServerErrorHandling(); + // header forwarding important for OIDC + applicationBuilder.UseForwardedHeaders(new ForwardedHeadersOptions + { + ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto | ForwardedHeaders.XForwardedHost, + }); + // metrics capture applicationBuilder.UseHttpMetrics(); diff --git a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj index 96c7dbcee1..4d0a20afb7 100644 --- a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj +++ b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj @@ -110,7 +110,7 @@ - + @@ -130,7 +130,7 @@ - + diff --git a/tools/Tgstation.Server.ReleaseNotes/Changelist.cs b/tools/Tgstation.Server.ReleaseNotes/Changelist.cs index feac94bc26..a1d437b546 100644 --- a/tools/Tgstation.Server.ReleaseNotes/Changelist.cs +++ b/tools/Tgstation.Server.ReleaseNotes/Changelist.cs @@ -41,6 +41,7 @@ namespace Tgstation.Server.ReleaseNotes Author = author }; }) + .Distinct(new ChangelistEqualityComparer()) .ToList(); } diff --git a/tools/Tgstation.Server.ReleaseNotes/ChangelistEqualityComparer.cs b/tools/Tgstation.Server.ReleaseNotes/ChangelistEqualityComparer.cs new file mode 100644 index 0000000000..08d320e859 --- /dev/null +++ b/tools/Tgstation.Server.ReleaseNotes/ChangelistEqualityComparer.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; + +namespace Tgstation.Server.ReleaseNotes +{ + internal class ChangelistEqualityComparer : IEqualityComparer + { + public bool Equals(Change x, Change y) + { + if (x == y) + return true; + + if (x == null) + return false; + + if (y == null) + return false; + + return JsonSerializer.Serialize(x) == JsonSerializer.Serialize(y); + } + + public int GetHashCode([DisallowNull] Change obj) + { + return JsonSerializer.Serialize(obj).GetHashCode(); + } + } +}