From 8c217f054a6dd95f4378d96940f37320327d9ac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BE=E8=8D=A3=E5=9B=BD?= Date: Wed, 19 Jan 2022 17:22:50 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E6=95=B4=E7=90=86appsetings.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Program.cs | 4 +- .../appsettings.Production.Development.json | 2 + .../appsettings.Production.json | 37 +++++++++++++++++++ .../appsettings.Production.secrets.json | 2 + .../appsettings.json | 9 +---- .../Win_in.Sfs.Scp.WebApi.Xml.Host/Program.cs | 2 +- .../appsettings.Production.Development.json | 9 ----- .../appsettings.Production.json | 12 +++--- .../appsettings.json | 2 +- 9 files changed, 54 insertions(+), 25 deletions(-) create mode 100644 WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.Production.Development.json create mode 100644 WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.Production.json create mode 100644 WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.Production.secrets.json delete mode 100644 WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/appsettings.Production.Development.json diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Program.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Program.cs index 54dbbaa..8d47cb7 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Program.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Program.cs @@ -20,7 +20,7 @@ namespace Win_in.Sfs.Scp.WebApi .MinimumLevel.Override("Microsoft", LogEventLevel.Information) .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() - .WriteTo.Async(c => c.File("Logs/logs.txt")) + .WriteTo.Async(c => c.File("Logs/logs.txt",rollingInterval:RollingInterval.Day)) #if DEBUG .WriteTo.Async(c => c.Console()) #endif @@ -34,7 +34,7 @@ namespace Win_in.Sfs.Scp.WebApi } catch (Exception ex) { - Log.Fatal(ex, "Host terminated unexpectedly!"); + Log.Fatal(ex, "Win_in.Sfs.Scp.WebApi.HttpApi.Host terminated unexpectedly!"); return 1; } finally diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.Production.Development.json b/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.Production.Development.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.Production.Development.json @@ -0,0 +1,2 @@ +{ +} diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.Production.json b/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.Production.json new file mode 100644 index 0000000..bc81261 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.Production.json @@ -0,0 +1,37 @@ +{ + "App": { + "SelfUrl": "https://scp.iacchina.net:9988", + "CorsOrigins": "https://scp.iacchina.net:9977,https://scp.iacchina.net:9988,https://localhost:9977,https://localhost:9988", + "RedirectAllowedUrls": "https://scp.iacchina.net:9977,https://scp.iacchina.net:9988" + }, + "ConnectionStrings": { + "Default": "Server=127.0.0.1;Database=Scp_WebApi;User ID=sa;Password=Microsoft2008;connection timeout=600;", + "V1Scp": "Server=127.0.0.1;Database=Scp_V1;User ID=sa;Password=Microsoft2008;connection timeout=600;" + }, + "AuthServer": { + "Authority": "https://scp.iacchina.net:9988", + "RequireHttpsMetadata": "false", + "SwaggerClientId": "WebApi_Swagger", + "SwaggerClientSecret": "1q2w3e*" + }, + "IdentityServer": { + "Clients": { + "WebApi_Web": { + "ClientId": "WebApi_Web", + "ClientSecret": "1q2w3e*", + "RootUrl": "https://scp.iacchina.net:9988" + }, + "WebApi_App": { + "ClientId": "WebApi_App", + "ClientSecret": "1q2w3e*", + "RootUrl": "https://scp.iacchina.net:9988" + }, + "WebApi_Swagger": { + "ClientId": "WebApi_Swagger", + "ClientSecret": "1q2w3e*", + "RootUrl": "https://scp.iacchina.net:9988" + } + } + }, + "AlwaysAllowAuthorization": false +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.Production.secrets.json b/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.Production.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.Production.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.json b/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.json index 613b03f..f7d92ee 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.json +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.json @@ -1,8 +1,8 @@ { "App": { "SelfUrl": "https://localhost:9988", - "CorsOrigins": "https://scp.iacchina.net:9977,https://localhost:9977,https://localhost:9988,https://scp.iacchina.net:9988", - "RedirectAllowedUrls": "http://localhost:4200,https://localhost:9988" + "CorsOrigins": "https://localhost:9977,https://localhost:9988", + "RedirectAllowedUrls": "https://localhost:9977,,https://localhost:9988" }, "ConnectionStrings": { "Default": "Server=127.0.0.1;Database=Scp_WebApi;User ID=sa;Password=Microsoft2008;connection timeout=600;", @@ -26,11 +26,6 @@ "ClientSecret": "1q2w3e*", "RootUrl": "https://localhost:9988" }, - "WebApi_BlazorServerTiered": { - "ClientId": "WebApi_BlazorServerTiered", - "ClientSecret": "1q2w3e*", - "RootUrl": "https://localhost:9988" - }, "WebApi_Swagger": { "ClientId": "WebApi_Swagger", "ClientSecret": "1q2w3e*", diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/Program.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/Program.cs index fef2707..29ff880 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/Program.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/Program.cs @@ -21,7 +21,7 @@ namespace Win_in.Sfs.Scp.WebApi.XmlHost } catch (Exception ex) { - Log.Fatal(ex, "Host terminated unexpectedly!"); + Log.Fatal(ex, "Win_in.Sfs.Scp.WebApi.Xml.Host terminated unexpectedly!"); return 1; } finally diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/appsettings.Production.Development.json b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/appsettings.Production.Development.json deleted file mode 100644 index 8983e0f..0000000 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/appsettings.Production.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - } -} diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/appsettings.Production.json b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/appsettings.Production.json index 00bd5e5..cd33aae 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/appsettings.Production.json +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/appsettings.Production.json @@ -13,8 +13,10 @@ "BaseUrl": "https://scp.iacchina.net:9988/" } }, - "BasicAuthentication": { - "Username": "admin", - "Password": "admin" - } -} + "AuthServer": { + "Authority": "https://scp.iacchina.net:9988", + "RequireHttpsMetadata": "false", + "SwaggerClientId": "WebApi_Swagger", + "SwaggerClientSecret": "1q2w3e*" + } +} \ No newline at end of file diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/appsettings.json b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/appsettings.json index 5e78db3..71410d6 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/appsettings.json +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Xml.Host/appsettings.json @@ -10,7 +10,7 @@ "RemoteServices": { "Default": { - "BaseUrl": "https://scp.iacchina.net:9988/" + "BaseUrl": "https://localhost:9988/" } }, "AuthServer": {