feat:config move to consul and framework upgrade to 8.0.1
This commit is contained in:
parent
c59f691492
commit
334ab1476a
@ -1,6 +1,6 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<!-- All Fake packages -->
|
||||
<FakePackageVersion>8.0.0</FakePackageVersion>
|
||||
<FakePackageVersion>8.0.1</FakePackageVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
<ProjectReference Include="..\InterfaceForward.Application\InterfaceForward.Application.csproj" />
|
||||
<ProjectReference Include="..\InterfaceForward.ServiceDefaults\InterfaceForward.ServiceDefaults.csproj"/>
|
||||
<PackageReference Include="Fake.Autofac" Version="$(FakePackageVersion)" />
|
||||
<PackageReference Include="Fake.Consul" Version="$(FakePackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.21" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.18" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
|
||||
|
||||
@ -3,6 +3,7 @@ using Serilog;
|
||||
|
||||
var builder = WebApplication.CreateSlimBuilder(args);
|
||||
var configuration = builder.Configuration;
|
||||
builder.Configuration.AddConsul("idwms/itfxapi", source => source.ReloadOnChange = true);
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.ReadFrom.Configuration(configuration)
|
||||
.CreateLogger();
|
||||
|
||||
@ -1,87 +1,8 @@
|
||||
{
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
"Default": "Debug",
|
||||
"Override": {
|
||||
"Microsoft.AspNetCore": "Debug"
|
||||
}
|
||||
},
|
||||
"Properties": {
|
||||
"ServiceName": "interface-api"
|
||||
},
|
||||
"Enrich": [
|
||||
"FromLogContext",
|
||||
"WithMachineName",
|
||||
"WithProcessId",
|
||||
"WithThreadId"
|
||||
],
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {SourceContext} - {Message:lj}{NewLine}{Exception}",
|
||||
"formatter": "Serilog.Formatting.Json.JsonFormatter, Serilog"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"App": {
|
||||
"Urls": [
|
||||
"http://*:8888"
|
||||
],
|
||||
"CorsOrigins": [
|
||||
"http://localhost:8888"
|
||||
]
|
||||
},
|
||||
"InterfaceRelay": {
|
||||
"FailedNeedPush": ["A007", "A009", "A022", "A015"],
|
||||
"ServiceProviderDefaultQPS": 10,
|
||||
"SpinPeriod": 500
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"Default": "server=129.204.22.146;database=interface_forward;uid=dev;pwd=itd!@#123;charset=utf8mb4;"
|
||||
},
|
||||
"FeiShuNotice": {
|
||||
"TitlePrefix": "itfx-dev",
|
||||
"Webhook": "https://open.feishu.cn/open-apis/bot/v2/hook/94e24bce-619d-4b3b-936c-e206353ce802",
|
||||
"Timeout": 20
|
||||
},
|
||||
"Redis": {
|
||||
"Host": "129.204.22.146:6379",
|
||||
"Password": "itd!@#123",
|
||||
"MaxPoolSize": 1000,
|
||||
"Database": 0,
|
||||
"Prefix": ""
|
||||
},
|
||||
"RabbitMQ": {
|
||||
"Connections": {
|
||||
"Default": {
|
||||
"HostName": "129.204.22.146",
|
||||
"Port": 5672,
|
||||
"UserName": "rabbit",
|
||||
"Password": "itd!@#123",
|
||||
"DispatchConsumersAsync": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"ElasticSearch": {
|
||||
"NodeUrls": [ "http://129.204.22.146:9200" ],
|
||||
"LoginName": "elastic",
|
||||
"Password": "itd!@#123",
|
||||
"ShowLogInfo": false,
|
||||
"IndexPrefix": ""
|
||||
},
|
||||
"JWTSettings": {
|
||||
"ValidateIssuerSigningKey": true, // 是否验证密钥,bool 类型,默认true
|
||||
"IssuerSigningKey": "3c1cbc3f546eda35168c3aa3cb91780fbe703f0996c1d133ea96dc85c70bbc0a", // 密钥,string 类型,必须是复杂密钥,长度大于16
|
||||
"ValidateIssuer": true, // 是否验证签发方,bool 类型,默认true
|
||||
"ValidIssuer": "SimpleAdmin", // 签发方,string 类型
|
||||
"ValidateAudience": true, // 是否验证签收方,bool 类型,默认true
|
||||
"ValidAudience": "SimpleAdmin", // 签收方,string 类型
|
||||
"ValidateLifetime": true, // 是否验证过期时间,bool 类型,默认true,建议true
|
||||
"ExpiredTime": 50000, // 过期时间,long 类型,单位分钟,默认20分钟
|
||||
"ClockSkew": 10, // 过期时间容错值,long 类型,单位秒,默认5秒
|
||||
"Algorithm": "HS256" // 加密算法,string 类型,默认 HS256
|
||||
"UseLocalConfigs": false,
|
||||
"Consul": {
|
||||
"Address": "http://81.71.47.150:8500",
|
||||
"Datacenter": "dc1",
|
||||
"Token": "97217125-df0b-5c0a-dbfc-8885def5e471"
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user