From 5d904c1ed7cada0f070471dbe07560bbb4a5fddc Mon Sep 17 00:00:00 2001 From: asesidaa <1061472754@qq.com> Date: Thu, 22 Sep 2022 22:14:55 +0800 Subject: [PATCH] Modify settings to directly use server without reverse proxy --- TaikoLocalServer/Certificates/cert.pfx | Bin 2829 -> 2781 bytes TaikoLocalServer/Certificates/root.pfx | Bin 0 -> 2653 bytes .../Common/Utils/FlagCalculator.cs | 2 +- TaikoLocalServer/Program.cs | 7 ++----- TaikoLocalServer/TaikoLocalServer.csproj | 3 +++ TaikoLocalServer/appsettings.json | 14 +++++++++++++- TaikoWebUI/Program.cs | 8 ++------ TaikoWebUI/Services/GameDataService.cs | 1 + TaikoWebUI/TaikoWebUI.csproj | 15 ++++++++++++--- .../wwwroot/appsettings.Development.json | 3 --- TaikoWebUI/wwwroot/appsettings.json | 3 --- 11 files changed, 34 insertions(+), 22 deletions(-) create mode 100644 TaikoLocalServer/Certificates/root.pfx delete mode 100644 TaikoWebUI/wwwroot/appsettings.Development.json delete mode 100644 TaikoWebUI/wwwroot/appsettings.json diff --git a/TaikoLocalServer/Certificates/cert.pfx b/TaikoLocalServer/Certificates/cert.pfx index f5204116754fa2e9d8ea0f4143ebe9b2bc115d1f..b703cde823635c2df6343fce4b5056fdbc6f2726 100644 GIT binary patch delta 2716 zcmV;N3S;$+7Tpyx-xe~@*GjlsAoQw`VD}c3K9IqSTfU*&J#WkHgH%uQ2P+P_GJnr3_}uv zDvp@Iw|jgN{KhPv@-!up6(Jzd?+(E%W78^u)-)|I2qVqwba-#=qPJfc!Bb zLdT(7;p4=m8L&EmgYV;9vZxiFcEJLFk3|D~d&q2zZAPl)-4^3hCk{l;7iG331Zm{q zyI#goa=#P^My&>d6}{95(Lp<9z{Dq0@a5%7#%B{}>tek#f1HaFvBZzgHu*VN#+NyP zS|qI7_4bKo(0)nR$mafDtXHi}Px-^OxXLG9hn+f6_dVR+g(%Ds#$Fj>M*>TKtC#mU zN{rGou#d+h>#-^S#G1O{5^}m7vG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TaikoLocalServer/Common/Utils/FlagCalculator.cs +++ b/TaikoLocalServer/Common/Utils/FlagCalculator.cs @@ -116,7 +116,7 @@ public static class FlagCalculator { if (id >= bitArraySize) { - logger.LogWarning("Id out of range!"); + logger.LogWarning("Id {Id} out of range!", id); continue; } bitSet.Set((int)id, true); diff --git a/TaikoLocalServer/Program.cs b/TaikoLocalServer/Program.cs index e8bfad7..67dd292 100644 --- a/TaikoLocalServer/Program.cs +++ b/TaikoLocalServer/Program.cs @@ -23,11 +23,8 @@ try // Manually enable tls 1.0 builder.WebHost.UseKestrel(kestrelOptions => { - kestrelOptions.ConfigureHttpsDefaults(httpsOptions => - { - httpsOptions.SslProtocols = - SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12 | SslProtocols.Tls13; - }); + kestrelOptions.ConfigureHttpsDefaults(options => + options.SslProtocols = SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12 | SslProtocols.Tls13); }); builder.Host.UseSerilog((context, configuration) => diff --git a/TaikoLocalServer/TaikoLocalServer.csproj b/TaikoLocalServer/TaikoLocalServer.csproj index 55f1417..e0a0423 100644 --- a/TaikoLocalServer/TaikoLocalServer.csproj +++ b/TaikoLocalServer/TaikoLocalServer.csproj @@ -47,6 +47,9 @@ PreserveNewest + + PreserveNewest + diff --git a/TaikoLocalServer/appsettings.json b/TaikoLocalServer/appsettings.json index 13b11b2..239dc28 100644 --- a/TaikoLocalServer/appsettings.json +++ b/TaikoLocalServer/appsettings.json @@ -36,8 +36,20 @@ "Kestrel": { "Endpoints": { - "Server": { + "BaseServer": { "Url": "http://0.0.0.0:5000" + }, + "AmAuthServer": { + "Url": "http://0.0.0.0:80" + }, + "MuchaServer": { + "Url": "https://0.0.0.0:10122" + }, + "GameServer1": { + "Url": "https://0.0.0.0:54430" + }, + "GameServer2": { + "Url": "https://0.0.0.0:54431" } }, "Certificates": { diff --git a/TaikoWebUI/Program.cs b/TaikoWebUI/Program.cs index 7821a3d..75baef5 100644 --- a/TaikoWebUI/Program.cs +++ b/TaikoWebUI/Program.cs @@ -7,7 +7,7 @@ builder.RootComponents.Add("head::after"); builder.Services.AddSingleton(sp => new HttpClient { - BaseAddress = new Uri(builder.Configuration.GetValue("BaseUrl")) + BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); builder.Services.AddMudServices(); builder.Services.AddSingleton(); @@ -15,10 +15,6 @@ builder.Services.AddSingleton(); var host = builder.Build(); var gameDataService = host.Services.GetRequiredService(); -#if DEBUG -await gameDataService.InitializeAsync(builder.Configuration.GetValue("DataBaseUrl")); -#else -await gameDataService.InitializeAsync(builder.Configuration.GetValue("BaseUrl")); -#endif +await gameDataService.InitializeAsync(builder.HostEnvironment.BaseAddress); await host.RunAsync(); \ No newline at end of file diff --git a/TaikoWebUI/Services/GameDataService.cs b/TaikoWebUI/Services/GameDataService.cs index c72f86b..977fe54 100644 --- a/TaikoWebUI/Services/GameDataService.cs +++ b/TaikoWebUI/Services/GameDataService.cs @@ -30,6 +30,7 @@ public class GameDataService : IGameDataService public async Task InitializeAsync(string dataBaseUrl) { + dataBaseUrl = dataBaseUrl.TrimEnd('/'); var musicInfo = await GetData(dataBaseUrl, Constants.MUSIC_INFO_BASE_NAME); var wordList = await GetData(dataBaseUrl, Constants.WORD_LIST_BASE_NAME); var musicOrder = await GetData(dataBaseUrl, Constants.MUSIC_ORDER_BASE_NAME); diff --git a/TaikoWebUI/TaikoWebUI.csproj b/TaikoWebUI/TaikoWebUI.csproj index fcf3b46..b39c692 100644 --- a/TaikoWebUI/TaikoWebUI.csproj +++ b/TaikoWebUI/TaikoWebUI.csproj @@ -20,9 +20,6 @@ - - PreserveNewest - PreserveNewest @@ -32,6 +29,18 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + diff --git a/TaikoWebUI/wwwroot/appsettings.Development.json b/TaikoWebUI/wwwroot/appsettings.Development.json deleted file mode 100644 index ce35693..0000000 --- a/TaikoWebUI/wwwroot/appsettings.Development.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "DataBaseUrl": "http://localhost:5000" -} \ No newline at end of file diff --git a/TaikoWebUI/wwwroot/appsettings.json b/TaikoWebUI/wwwroot/appsettings.json deleted file mode 100644 index e575e49..0000000 --- a/TaikoWebUI/wwwroot/appsettings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "BaseUrl": "http://localhost:5000" -} \ No newline at end of file