forked from anjoy8/Blog.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappsettings.json
More file actions
320 lines (317 loc) · 9.16 KB
/
appsettings.json
File metadata and controls
320 lines (317 loc) · 9.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
{
"urls": "http://*:9291", //web服务端口,如果用IIS部署,把这个去掉
"Logging": {
"LogLevel": {
"Default": "Information", //加入Default否则log4net本地写入不了日志
"Blog.Core.AuthHelper.ApiResponseHandler": "Error"
},
"Debug": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
},
"Console": {
"IncludeScopes": false,
"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
},
"Kafka": {
"Enabled": false,
"Servers": "localhost:9092",
"Topic": "blog",
"GroupId": "blog-consumer",
"NumPartitions": 3 //主题分区数量
},
"EventBus": {
"Enabled": false,
"SubscriptionClientName": "Blog.Core"
},
"AppSettings": {
"RedisCachingAOP": {
"Enabled": false
},
"MemoryCachingAOP": {
"Enabled": true
},
"LogAOP": {
"Enabled": true,
"LogToFile": {
"Enabled": false
},
"LogToDB": {
"Enabled": true
}
},
"TranAOP": {
"Enabled": true
},
"SqlAOP": {
"Enabled": true,
"LogToFile": {
"Enabled": false
},
"LogToDB": {
"Enabled": false
},
"LogToConsole": {
"Enabled": true
}
},
"Date": "2018-08-28",
"SeedDBEnabled": true, //只生成表结构
"SeedDBDataEnabled": true, //生成表,并初始化数据
"Author": "Blog.Core",
"SvcName": "", // /svc/blog
"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=localhost;Database=blogcore001;Uid=root;Pwd=root;Port=3306;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": {
"Domain": "http://localhost:9291",
"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,http://127.0.0.1:6688,http://localhost:6688"
},
"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 //性能分析开启
},
"Nacos": {
"Enabled": false //Nacos注册中心
}
},
"Middleware": {
"RequestResponseLog": {
"Enabled": true,
"LogToFile": {
"Enabled": false
},
"LogToDB": {
"Enabled": true
}
},
"IPLog": {
"Enabled": true,
"LogToFile": {
"Enabled": false
},
"LogToDB": {
"Enabled": true
}
},
"RecordAccessLogs": {
"Enabled": true,
"LogToFile": {
"Enabled": false
},
"LogToDB": {
"Enabled": true
},
"IgnoreApis": "/api/permission/getnavigationbar,/api/monitor/getids4users,/api/monitor/getaccesslogs,/api/monitor/server,/api/monitor/getactiveusers,/api/monitor/server,"
},
"SignalR": {
"Enabled": false
},
"SignalRSendLog": {
"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": "9291",
"ServiceHealthCheck": "/healthcheck",
"ConsulAddress": "http://localhost:8500"
},
"PayInfo": { //建行聚合支付信息
"MERCHANTID": "", //商户号
"POSID": "", //柜台号
"BRANCHID": "", //分行号
"pubKey": "", //公钥
"USER_ID": "", //操作员号
"PASSWORD": "", //密码
"OutAddress": "http://127.0.0.1:12345" //外联地址
},
"nacos": {
"ServerAddresses": [ "http://localhost:8848" ], // nacos 连接地址
"DefaultTimeOut": 15000, // 默认超时时间
"Namespace": "public", // 命名空间
"ListenInterval": 10000, // 监听的频率
"ServiceName": "blog.Core.Api", // 服务名
"Port": "9291", // 服务端口号
"RegisterEnabled": true // 是否直接注册nacos
},
"LogFiedOutPutConfigs": {
"tcpAddressHost": "", // 输出elk的tcp连接地址
"tcpAddressPort": 0, // 输出elk的tcp端口号
"ConfigsInfo": [ // 配置的输出elk节点内容 常用语动态标识
{
"FiedName": "applicationName",
"FiedValue": "Blog.Core.Api"
}
]
}
}