diff --git a/.gitattributes b/.gitattributes index 1ff0c42..ef82812 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,6 +2,7 @@ # Set default behavior to automatically normalize line endings. ############################################################################### * text=auto +*.sh text eol=lf ############################################################################### # Set default behavior for command prompt diff. diff --git a/docker-compose.yml b/docker-compose.yml index aedde3a..9a2f38d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,22 +1,3 @@ -# Create the file docker-compose.secrets.yml and add -# ``` -# version: '2' -# services: -# proxy: -# volumes: -# - "/dev.local.crt:/tmp/dev.local.crt" -# - "/dev.local.key:/tmp/dev.local.key" -# -# keycloak: -# volumes: -# - "/dev.local.crt:/tmp/dev.local.crt" -# -# steamidp: -# environment: -# Steam__ApplicationKey: -# ``` -# -# Than start with `docker compose -f .\docker-compose.yml -f .\docker-compose.secrets.yml up` version: '2' volumes: postgres_data: diff --git a/src/Domains/Steam/Player.cs b/src/Domains/Steam/Player.cs index 2873c3d..6ce9ae6 100644 --- a/src/Domains/Steam/Player.cs +++ b/src/Domains/Steam/Player.cs @@ -1,4 +1,4 @@ -using System.Text.Json; +using System.Text.Json; using System.Text.Json.Serialization; namespace SteamOpenIdConnectProvider.Profile.Models @@ -6,7 +6,7 @@ namespace SteamOpenIdConnectProvider.Profile.Models public sealed class Player { [JsonPropertyName("steamid")] - public ulong SteamId { get; set; } + public string SteamId { get; set; } [JsonPropertyName("communityvisibilitystate")] public int CommunityVisibilityState { get; set; } @@ -45,7 +45,7 @@ namespace SteamOpenIdConnectProvider.Profile.Models public string RealName { get; set; } [JsonPropertyName("primaryclanid")] - public ulong PrimaryClanId { get; set; } + public string PrimaryClanId { get; set; } [JsonPropertyName("timecreated")] public int TimeCreated { get; set; } @@ -56,4 +56,4 @@ namespace SteamOpenIdConnectProvider.Profile.Models [JsonPropertyName("loccountrycode")] public string LocCountryCode { get; set; } } -} \ No newline at end of file +} diff --git a/src/Domains/Steam/SteamConfig.cs b/src/Domains/Steam/SteamConfig.cs index 150d484..6a7e40e 100644 --- a/src/Domains/Steam/SteamConfig.cs +++ b/src/Domains/Steam/SteamConfig.cs @@ -9,6 +9,6 @@ namespace SteamOpenIdConnectProvider.Domains.Steam { public static readonly string Key = "Steam"; - public string ApplicationKey { get; internal set; } + public string ApplicationKey { get; set; } } } diff --git a/src/Program.cs b/src/Program.cs index c345b04..ed6d99a 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -15,8 +15,9 @@ namespace SteamOpenIdConnectProvider .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) .MinimumLevel.Override("System", LogEventLevel.Warning) .MinimumLevel.Override("Microsoft.AspNetCore.Authentication", LogEventLevel.Information) + .MinimumLevel.Override("Microsoft.AspNetCore", LogEventLevel.Warning) .Enrich.FromLogContext() - .WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}", theme: AnsiConsoleTheme.Literate) + .WriteTo.Console() .CreateLogger(); CreateWebHostBuilder(args).Build().Run(); diff --git a/src/Startup.cs b/src/Startup.cs index 44ce6a5..290c599 100644 --- a/src/Startup.cs +++ b/src/Startup.cs @@ -16,6 +16,9 @@ using SteamOpenIdConnectProvider.Models.IdentityServer; using SteamOpenIdConnectProvider.Domains.Common; using SteamOpenIdConnectProvider.Domains.IdentityServer; using SteamOpenIdConnectProvider.Domains.Steam; +using System.IO; +using System.Text; +using Serilog; namespace SteamOpenIdConnectProvider { @@ -87,6 +90,8 @@ namespace SteamOpenIdConnectProvider app.UsePathBase(hostingConfig.BasePath); } + app.UseSerilogRequestLogging(); + app.UseCookiePolicy(); app.Use(async (ctx, next) => { diff --git a/src/appsettings.Development.json b/src/appsettings.Development.json index 35c654c..2ada604 100644 --- a/src/appsettings.Development.json +++ b/src/appsettings.Development.json @@ -1,12 +1,5 @@ { - "Logging": { - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - }, "Hosting": { - "PathBase": "/steam" + "BasePath": "/steam" } } diff --git a/src/appsettings.json b/src/appsettings.json index bba5e09..d6ba347 100644 --- a/src/appsettings.json +++ b/src/appsettings.json @@ -1,9 +1,4 @@ { - "Logging": { - "LogLevel": { - "Default": "Warning" - } - }, "AllowedHosts": "*", "OpenID": { "ClientID": "keycloak", @@ -13,7 +8,7 @@ "PostLogoutRedirectUri": "" }, "Hosting": { - "PathBase": "" + "BasePath": "" }, "Steam": { "ApplicationKey": "secret"