2020-07-06 20:20:53 +08:00
|
|
|
|
{
|
2019-04-08 15:54:01 +08:00
|
|
|
|
"Logging": {
|
|
|
|
|
"IncludeScopes": false,
|
|
|
|
|
"Debug": {
|
|
|
|
|
"LogLevel": {
|
|
|
|
|
"Default": "Warning"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"Console": {
|
|
|
|
|
"LogLevel": {
|
2020-06-11 13:52:54 +08:00
|
|
|
|
"Default": "Warning",
|
|
|
|
|
"Microsoft.Hosting.Lifetime": "Debug"
|
2019-04-08 15:54:01 +08:00
|
|
|
|
}
|
2019-10-02 22:27:15 +08:00
|
|
|
|
},
|
|
|
|
|
"Log4Net": {
|
|
|
|
|
"Name": "Blog.Core"
|
2019-04-08 15:54:01 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2020-06-11 13:52:54 +08:00
|
|
|
|
//"urls": "http://localhost:8081",// IIS 部署,注释掉
|
2019-04-08 15:54:01 +08:00
|
|
|
|
"AllowedHosts": "*",
|
|
|
|
|
"AppSettings": {
|
2019-10-02 22:27:15 +08:00
|
|
|
|
"RedisCachingAOP": {
|
2019-04-08 15:54:01 +08:00
|
|
|
|
"Enabled": false,
|
|
|
|
|
"ConnectionString": "127.0.0.1:6319"
|
|
|
|
|
},
|
|
|
|
|
"MemoryCachingAOP": {
|
|
|
|
|
"Enabled": true
|
|
|
|
|
},
|
2019-10-02 22:27:15 +08:00
|
|
|
|
"LogAOP": {
|
|
|
|
|
"Enabled": false
|
|
|
|
|
},
|
2019-11-07 18:14:34 +08:00
|
|
|
|
"TranAOP": {
|
|
|
|
|
"Enabled": false
|
|
|
|
|
},
|
2019-10-02 22:27:15 +08:00
|
|
|
|
"SqlAOP": {
|
2019-04-08 15:54:01 +08:00
|
|
|
|
"Enabled": false
|
|
|
|
|
},
|
2020-04-26 19:45:25 +08:00
|
|
|
|
"Date": "2018-08-28",
|
|
|
|
|
"SeedDBEnabled": true, //只生成表结构
|
|
|
|
|
"SeedDBDataEnabled": true, //生成表,并初始化数据
|
|
|
|
|
"Author": "Blog.Core"
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 请配置MainDB为你想要的主库的ConnId值,并设置对应的Enabled为true;
|
|
|
|
|
// *** 单库操作,把 MutiDBEnabled 设为false ***;
|
|
|
|
|
// *** 多库操作,把 MutiDBEnabled 设为true,其他的从库Enabled也为true **;
|
|
|
|
|
// 具体配置看视频:https://www.bilibili.com/video/BV1BJ411B7mn?p=6
|
|
|
|
|
|
|
|
|
|
"MainDB": "WMBLOG_SQLITE", //当前项目的主库,所对应的连接字符串的Enabled必须为true
|
|
|
|
|
"MutiDBEnabled": false, //是否开启多库模式
|
|
|
|
|
"CQRSEnabled": false, //是否开启读写分离模式,必须是单库模式,且数据库类型一致,比如都是SqlServer
|
|
|
|
|
"DBS": [
|
|
|
|
|
/*
|
|
|
|
|
对应下边的 DBType
|
|
|
|
|
MySql = 0,
|
|
|
|
|
SqlServer = 1,
|
|
|
|
|
Sqlite = 2,
|
|
|
|
|
Oracle = 3,
|
|
|
|
|
PostgreSQL = 4
|
|
|
|
|
*/
|
|
|
|
|
{
|
|
|
|
|
"ConnId": "WMBLOG_SQLITE",
|
|
|
|
|
"DBType": 2,
|
2019-10-02 22:27:15 +08:00
|
|
|
|
"Enabled": true,
|
2020-04-26 19:45:25 +08:00
|
|
|
|
"HitRate": 50, // 值越大,优先级越高
|
|
|
|
|
"Connection": "WMBlog.db" //sqlite只写数据库名就行
|
2019-10-02 22:27:15 +08:00
|
|
|
|
},
|
2020-04-26 19:45:25 +08:00
|
|
|
|
{
|
|
|
|
|
"ConnId": "WMBLOG_MSSQL_1",
|
|
|
|
|
"DBType": 1,
|
|
|
|
|
"Enabled": true,
|
|
|
|
|
"HitRate": 40,
|
|
|
|
|
"Connection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=WMBLOG_MSSQL_1;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
|
2019-04-08 15:54:01 +08:00
|
|
|
|
"ProviderName": "System.Data.SqlClient"
|
|
|
|
|
},
|
2020-04-26 19:45:25 +08:00
|
|
|
|
{
|
|
|
|
|
"ConnId": "WMBLOG_MSSQL_2",
|
|
|
|
|
"DBType": 1,
|
|
|
|
|
"Enabled": true,
|
|
|
|
|
"HitRate": 30,
|
|
|
|
|
"Connection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=WMBLOG_MSSQL_2;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
|
|
|
|
|
"ProviderName": "System.Data.SqlClient"
|
2019-04-16 19:08:45 +08:00
|
|
|
|
},
|
2020-04-26 19:45:25 +08:00
|
|
|
|
{
|
|
|
|
|
"ConnId": "WMBLOG_MYSQL",
|
|
|
|
|
"DBType": 0,
|
|
|
|
|
"Enabled": true,
|
|
|
|
|
"HitRate": 20,
|
|
|
|
|
"Connection": "Server=localhost; Port=3306;Stmt=; Database=wmblogdb; Uid=root; Pwd=456;"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"ConnId": "WMBLOG_ORACLE",
|
|
|
|
|
"DBType": 3,
|
2019-10-02 22:27:15 +08:00
|
|
|
|
"Enabled": false,
|
2020-04-26 19:45:25 +08:00
|
|
|
|
"HitRate": 10,
|
|
|
|
|
"Connection": "Provider=OraOLEDB.Oracle; Data Source=WMBlogDB; User Id=sss; Password=789;",
|
2019-10-02 22:27:15 +08:00
|
|
|
|
"OracleConnection_other1": "User ID=sss;Password=789;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.8.65)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME = orcl)))"
|
2020-04-26 19:45:25 +08:00
|
|
|
|
}
|
|
|
|
|
],
|
2019-04-08 15:54:01 +08:00
|
|
|
|
"Audience": {
|
2020-04-26 19:45:25 +08:00
|
|
|
|
"Secret": "sdfsdfsrty45634kkhllghtdgdfss345t678fs", //不要太短,16位+
|
|
|
|
|
"SecretFile": "C:\\my-file\\blog.core.audience.secret.txt", //安全。内容就是Secret
|
2019-04-08 15:54:01 +08:00
|
|
|
|
"Issuer": "Blog.Core",
|
|
|
|
|
"Audience": "wr"
|
2019-11-07 18:14:34 +08:00
|
|
|
|
},
|
|
|
|
|
"Startup": {
|
|
|
|
|
"Cors": {
|
2020-04-26 19:45:25 +08:00
|
|
|
|
"IPs": "http://127.0.0.1:2364,http://localhost:2364,http://localhost:8080,http://localhost:8021,http://localhost:1818"
|
|
|
|
|
},
|
|
|
|
|
"AppConfigAlert": {
|
|
|
|
|
"Enabled": true
|
2019-11-07 18:14:34 +08:00
|
|
|
|
},
|
2020-04-26 19:45:25 +08:00
|
|
|
|
"ApiName": "Blog.Core",
|
|
|
|
|
"IdentityServer4": {
|
|
|
|
|
"Enabled": false, // 这里默认是false,表示使用jwt,如果设置为true,则表示系统使用Ids4模式
|
|
|
|
|
"AuthorizationUrl": "https://ids.neters.club", // 认证中心域名
|
|
|
|
|
"ApiName": "blog.core.api" // 资源服务器
|
|
|
|
|
}
|
2019-11-07 18:14:34 +08:00
|
|
|
|
},
|
|
|
|
|
"Middleware": {
|
|
|
|
|
"RequestResponseLog": {
|
2020-04-26 19:45:25 +08:00
|
|
|
|
"Enabled": false
|
|
|
|
|
},
|
|
|
|
|
"IPLog": {
|
2019-11-07 18:14:34 +08:00
|
|
|
|
"Enabled": true
|
|
|
|
|
},
|
2020-07-06 20:20:53 +08:00
|
|
|
|
"RecordAccessLogs": {
|
|
|
|
|
"Enabled": true
|
2020-04-26 19:45:25 +08:00
|
|
|
|
},
|
|
|
|
|
"SignalR": {
|
|
|
|
|
"Enabled": false
|
2020-06-11 13:52:54 +08:00
|
|
|
|
},
|
|
|
|
|
"QuartzNetJob": {
|
|
|
|
|
"Enabled": true
|
2020-06-17 15:45:24 +08:00
|
|
|
|
},
|
|
|
|
|
"Consul": {
|
|
|
|
|
"Enabled": false
|
|
|
|
|
},
|
|
|
|
|
"IpRateLimit": {
|
|
|
|
|
"Enabled": true
|
2019-11-07 18:14:34 +08:00
|
|
|
|
}
|
2020-04-26 19:45:25 +08:00
|
|
|
|
},
|
|
|
|
|
"IpRateLimiting": {
|
2020-06-11 13:52:54 +08:00
|
|
|
|
"EnableEndpointRateLimiting": true, //False: globally executed, true: executed for each
|
|
|
|
|
"StackBlockedRequests": false, //False: Number of rejections should be recorded on another counter
|
2020-04-26 19:45:25 +08:00
|
|
|
|
"RealIpHeader": "X-Real-IP",
|
|
|
|
|
"ClientIdHeader": "X-ClientId",
|
|
|
|
|
"IpWhitelist": [], //白名单
|
|
|
|
|
"EndpointWhitelist": [ "get:/api/xxx", "*:/api/yyy" ],
|
|
|
|
|
"ClientWhitelist": [ "dev-client-1", "dev-client-2" ],
|
|
|
|
|
"HttpStatusCode": 429, //返回状态码
|
|
|
|
|
"GeneralRules": [ //api规则,结尾一定要带*
|
|
|
|
|
{
|
|
|
|
|
"Endpoint": "*:/api/blog*",
|
|
|
|
|
"Period": "1m",
|
|
|
|
|
"Limit": 20
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"Endpoint": "*/api/*",
|
|
|
|
|
"Period": "1s",
|
|
|
|
|
"Limit": 3
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"Endpoint": "*/api/*",
|
|
|
|
|
"Period": "1m",
|
|
|
|
|
"Limit": 30
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"Endpoint": "*/api/*",
|
|
|
|
|
"Period": "12h",
|
|
|
|
|
"Limit": 500
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
2020-06-14 22:41:27 +08:00
|
|
|
|
},
|
|
|
|
|
"ConsulSetting": {
|
|
|
|
|
"ServiceName": "BlogCoreService",
|
|
|
|
|
"ServiceIP": "localhost",
|
|
|
|
|
"ServicePort": "8081",
|
|
|
|
|
"ServiceHealthCheck": "/healthcheck",
|
|
|
|
|
"ConsulAddress": "http://localhost:8500"
|
2019-04-08 15:54:01 +08:00
|
|
|
|
}
|
|
|
|
|
}
|