Blog.Core/Blog.Core.Api/appsettings.json
2021-03-15 09:42:43 +08:00

253 lines
7.5 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"urls": "http://*:8081", //web服务端口如果用IIS部署把这个去掉
"Logging": {
"LogLevel": {
"Default": "Information", //加入Default否则log4net本地写入不了日志
"Blog.Core.AuthHelper.ApiResponseHandler": "Error"
},
"IncludeScopes": false,
"Debug": {
"LogLevel": {
"Default": "Warning"
}
},
"Console": {
"LogLevel": {
"Default": "Warning",
"Microsoft.Hosting.Lifetime": "Debug"
}
},
"Log4Net": {
"Name": "Blog.Core"
}
},
"AllowedHosts": "*",
"Redis": {
"ConnectionString": "127.0.0.1:6319,password=admin"
},
"RabbitMQ": {
"Enabled": false,
"Connection": "118.25.251.13",
"UserName": "",
"Password": "!",
"RetryCount": 3
},
"EventBus": {
"Enabled": false,
"SubscriptionClientName": "Blog.Core"
},
"AppSettings": {
"RedisCachingAOP": {
"Enabled": false
},
"MemoryCachingAOP": {
"Enabled": true
},
"LogAOP": {
"Enabled": false
},
"TranAOP": {
"Enabled": false
},
"SqlAOP": {
"Enabled": false
},
"Date": "2018-08-28",
"SeedDBEnabled": true, //只生成表结构
"SeedDBDataEnabled": true, //生成表,并初始化数据
"Author": "Blog.Core",
"UseLoadTest": false
},
// 请配置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,
Dm = 5,//达梦
Kdbndp = 6,//人大金仓
*/
{
"ConnId": "WMBLOG_SQLITE",
"DBType": 2,
"Enabled": true,
"HitRate": 50, // 值越大,优先级越高
"Connection": "WMBlog.db" //sqlite只写数据库名就行
},
{
"ConnId": "WMBLOG_MSSQL_1",
"DBType": 1,
"Enabled": false,
"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",
"ProviderName": "System.Data.SqlClient"
},
{
"ConnId": "WMBLOG_MSSQL_2",
"DBType": 1,
"Enabled": false,
"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"
},
{
"ConnId": "WMBLOG_MYSQL",
"DBType": 0,
"Enabled": false,
"HitRate": 20,
"Connection": "server=.;Database=ddd;Uid=root;Pwd=123456;Port=10060;Allow User Variables=True;"
},
{
"ConnId": "WMBLOG_MYSQL_2",
"DBType": 0,
"Enabled": true,
"HitRate": 20,
"Connection": "server=.;Database=blogcore001;Uid=root;Pwd=123456;Port=3096;Allow User Variables=True;"
},
{
"ConnId": "WMBLOG_ORACLE",
"DBType": 3,
"Enabled": false,
"HitRate": 10,
"Connection": "Data Source=127.0.0.1/ops;User ID=OPS;Password=123456;Persist Security Info=True;Connection Timeout=60;"
},
{
"ConnId": "WMBLOG_DM",
"DBType": 5,
"Enabled": false,
"HitRate": 10,
"Connection": "PORT=5236;DATABASE=DAMENG;HOST=localhost;PASSWORD=SYSDBA;USER ID=SYSDBA;"
},
{
"ConnId": "WMBLOG_KDBNDP",
"DBType": 6,
"Enabled": true,
"HitRate": 10,
"Connection": "Server=127.0.0.1;Port=54321;UID=SYSTEM;PWD=system;database=SQLSUGAR4XTEST1;"
}
],
"Audience": {
"Secret": "sdfsdfsrty45634kkhllghtdgdfss345t678fs", //不要太短16位+
"SecretFile": "C:\\my-file\\blog.core.audience.secret.txt", //安全。内容就是Secret
"Issuer": "Blog.Core",
"Audience": "wr"
},
"Mongo": {
"ConnectionString": "mongodb://nosql.data",
"Database": "BlogCoreDb"
},
"Startup": {
"Cors": {
"PolicyName": "CorsIpAccess", //策略名称
"EnableAllIPs": false, //当为true时开放所有IP均可访问。
// 支持多个域名端口,注意端口号后不要带/斜杆比如localhost:8000/,是错的
// 注意http://127.0.0.1:1818 和 http://localhost:1818 是不一样的
"IPs": "http://127.0.0.1:2364,http://localhost:2364"
},
"AppConfigAlert": {
"Enabled": true
},
"ApiName": "Blog.Core",
"IdentityServer4": {
"Enabled": false, // 这里默认是false表示使用jwt如果设置为true则表示系统使用Ids4模式
"AuthorizationUrl": "http://localhost:5004", // 认证中心域名
"ApiName": "blog.core.api" // 资源服务器
},
"RedisMq": {
"Enabled": false //redis 消息队列
},
"MiniProfiler": {
"Enabled": false //性能分析开启
}
},
"Middleware": {
"RequestResponseLog": {
"Enabled": false
},
"IPLog": {
"Enabled": true
},
"RecordAccessLogs": {
"Enabled": true,
"IgnoreApis": "/api/permission/getnavigationbar,/api/monitor/getids4users,/api/monitor/getaccesslogs,/api/monitor/server,/api/monitor/getactiveusers,/api/monitor/server,"
},
"SignalR": {
"Enabled": false
},
"QuartzNetJob": {
"Enabled": true
},
"Consul": {
"Enabled": false
},
"IpRateLimit": {
"Enabled": true
}
},
"IpRateLimiting": {
"EnableEndpointRateLimiting": true, //False: globally executed, true: executed for each
"StackBlockedRequests": false, //False: Number of rejections should be recorded on another counter
"RealIpHeader": "X-Real-IP",
"ClientIdHeader": "X-ClientId",
"IpWhitelist": [], //白名单
"EndpointWhitelist": [ "get:/api/xxx", "*:/api/yyy" ],
"ClientWhitelist": [ "dev-client-1", "dev-client-2" ],
"QuotaExceededResponse": {
"Content": "{{\"status\":429,\"msg\":\"访问过于频繁,请稍后重试\",\"success\":false}}",
"ContentType": "application/json",
"StatusCode": 429
},
"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
}
]
},
"ConsulSetting": {
"ServiceName": "BlogCoreService",
"ServiceIP": "localhost",
"ServicePort": "8081",
"ServiceHealthCheck": "/healthcheck",
"ConsulAddress": "http://localhost:8500"
},
"PayInfo": { //建行支付信息
"MERCHANTID": "", //商户号
"POSID": "", //柜台号
"BRANCHID": "", //分行号
"pubKey": "", //公钥
"USER_ID": "", //操作员号
"PASSWORD": "", //密码
"OutAddress": "http://127.0.0.1:12345" //外联地址
}
}