@@ -48,13 +48,21 @@ title: 配置
4848
4949### ` TOKEN_SECRET_KEY `  <Badge  type =" info "  text =" str "  /> 
5050
51- token 生成和解析密钥,用于防止 token 被恶意篡改,请妥善保管此配置内容,密钥生成:` secrets.token_urlsafe(32) ` 
51+ token 生成和解析密钥,用于防止 token 被恶意篡改,密钥生成:` secrets.token_urlsafe(32) ` 
52+ 
53+ ::: danger
54+ 请妥善保管此值,以免遭受恶意攻击
55+ :::
5256
5357### ` OPERA_LOG_ENCRYPT_SECRET_KEY `  <Badge  type =" info "  text =" "  /> 
5458
55- 操作日志指定字段加密密钥,当使用对称加密算法对指定字段进行加密时,这将十分重要,请妥善保管此配置内容 ,密钥生成:
59+ 操作日志加密密钥,当使用对称加密算法加密操作日志时,将十分重要 ,密钥生成:
5660` os.urandom(32).hex() ` 
5761
62+ ::: danger
63+ 请妥善保管此值,以免遭受恶意攻击
64+ :::
65+ 
5866## FastAPI 配置  
5967
6068### ` FASTAPI_API_V1_PATH `  <Badge  type =" info "  text =" str "  /> 
@@ -164,15 +172,15 @@ JWT 中间件存储用户信息到 Redis 时的前缀
164172
165173## RBAC 配置  
166174
167- 更多详情: [ RBAC ] ( ./RBAC.md ) 
175+ [ 更多详情 ] ( ./RBAC.md ) {.read-more} 
168176
169177### ` RBAC_ROLE_MENU_MODE `  <Badge  type =" info "  text =" bool "  /> 
170178
171179是否开启 RBAC 角色菜单模式
172180
173181### ` RBAC_ROLE_MENU_EXCLUDE `  <Badge  type =" info "  text =" list[str] "  /> 
174182
175- 开启 RBAC 角色菜单模式时,跳过 RBAC 鉴权(当接口权限标识和菜单权限标识相同时 )
183+ 开启 RBAC 角色菜单模式时,跳过 RBAC 鉴权的标识(当接口权限标识和用户菜单权限标识相同时 )
176184
177185## Cookie 配置  
178186
@@ -186,7 +194,7 @@ JWT 中间件存储用户信息到 Redis 时的前缀
186194
187195## 数据权限配置  
188196
189- 更多详情: [ 数据权限 ] ( ../../planet ) 
197+ [ 更多详情 ] ( ../../planet ) {.read-more} 
190198
191199### ` DATA_PERMISSION_MODELS `  <Badge  type =" info "  text =" dict[str, str] "  /> 
192200
@@ -200,13 +208,17 @@ JWT 中间件存储用户信息到 Redis 时的前缀
200208
201209### ` WS_NO_AUTH_MARKER `  <Badge  type =" info "  text =" str "  /> 
202210
203- 连接 socket.io 服务时跳过验证的标记,应将其直接定义为 token 值进行传输,请妥善保管此值,以免遭受恶意攻击
211+ 连接 socket.io 服务时跳过用户验证的标记,应将其直接定义为 token 值进行传输
212+ 
213+ ::: danger
214+ 请妥善保管此值,以免遭受恶意攻击
215+ :::
204216
205217## CORS 配置  
206218
207219### ` CORS_ALLOWED_ORIGINS `  <Badge  type =" info "  text =" list[str] "  /> 
208220
209- 跨域请求时允许的来源,末尾不带 ` / ` ,例如:` http <Badge type="info" text="" />// 127.0.0.1 <Badge type="info" text="" /> 8000 ` 
221+ 跨域请求时允许的来源,末尾不带 ` / ` ,例如:` http// 127.0.0.1: 8000 ` 
210222
211223### ` CORS_EXPOSE_HEADERS `  <Badge  type =" info "  text =" list[str] "  /> 
212224
@@ -228,11 +240,11 @@ JWT 中间件存储用户信息到 Redis 时的前缀
228240
229241### ` DATETIME_TIMEZONE `  <Badge  type =" info "  text =" str "  /> 
230242
231- 全局时区配置,这将影响所有应用的时区设置 
243+ 全局时区 
232244
233245### ` DATETIME_FORMAT `  <Badge  type =" info "  text =" str "  /> 
234246
235- 接口返回时,将时间字段转为指定字符串格式 
247+ 将时间转为时间字符串的格式 
236248
237249## 文件上传配置  
238250
@@ -250,15 +262,15 @@ JWT 中间件存储用户信息到 Redis 时的前缀
250262
251263### ` UPLOAD_IMAGE_SIZE_MAX `  <Badge  type =" info "  text =" int "  /> 
252264
253- 允许上传的图片文件大小 
265+ 允许上传的图片文件最大尺寸 
254266
255267### ` UPLOAD_VIDEO_EXT_INCLUDE `  <Badge  type =" info "  text =" list[str] "  /> 
256268
257269允许上传的视频文件类型
258270
259271### ` UPLOAD_VIDEO_SIZE_MAX `  <Badge  type =" info "  text =" int "  /> 
260272
261- 允许上传的视频文件大小 
273+ 允许上传的视频文件最大尺寸 
262274
263275## 演示模式配置  
264276
@@ -274,7 +286,7 @@ JWT 中间件存储用户信息到 Redis 时的前缀
274286
275287### ` IP_LOCATION_PARSE `  <Badge  type =" info "  text =" Literal['online', 'offline', 'false'] "  /> 
276288
277- 定位信息获取模式 
289+ 请求发起者的定位信息获取模式 
278290
279291### ` IP_LOCATION_REDIS_PREFIX `  <Badge  type =" info "  text =" str "  /> 
280292
@@ -284,37 +296,39 @@ JWT 中间件存储用户信息到 Redis 时的前缀
284296
285297定位信息缓存时长
286298
287- ## 日志( Trace ID)  
299+ ## Trace ID  
288300
289301### ` TRACE_ID_REQUEST_HEADER_KEY `  <Badge  type =" info "  text =" str "  /> 
290302
291303跟踪 ID 请求头键名
292304
305+ ### ` TRACE_ID_LOG_LENGTH `  <Badge  type =" info "  text =" int "  /> 
306+ 
307+ 跟踪 ID 日志长度,必须小于等于 32
308+ 
293309### ` TRACE_ID_LOG_DEFAULT_VALUE `  <Badge  type =" info "  text =" str "  /> 
294310
295- 跟踪 ID 未生成时的默认值
311+ 跟踪 ID 日志默认值
312+ 
313+ ## 日志  
296314
297- ### ` TRACE_ID_LOG_UUID_LENGTH `  <Badge  type =" info "  text =" int "  /> 
315+ ### ` LOG_FORMAT `  <Badge  type =" info "  text =" str "  /> 
298316
299- 跟踪 ID 长度,必须小于等于 32 
317+ 日志内容格式(控制台和文件同享) 
300318
301319## 日志(控制台)  
302320
303321### ` LOG_STD_LEVEL `  <Badge  type =" info "  text =" str "  /> 
304322
305323日志记录级别
306324
307- ### ` LOG_STD_FORMAT `  <Badge  type =" info "  text =" str "  /> 
308- 
309- 日志内容格式化
310- 
311325## 日志(文件)  
312326
313- ### ` LOG_ACCESS_FILE_LEVEL `  <Badge  type =" info "  text =" str "  /> 
327+ ### ` LOG_FILE_ACCESS_LEVEL `  <Badge  type =" info "  text =" str "  /> 
314328
315329访问日志记录级别
316330
317- ### ` LOG_ERROR_FILE_LEVEL `  <Badge  type =" info "  text =" str "  /> 
331+ ### ` LOG_FILE_ERROR_LEVEL `  <Badge  type =" info "  text =" str "  /> 
318332
319333错误日志记录级别
320334
@@ -326,10 +340,6 @@ JWT 中间件存储用户信息到 Redis 时的前缀
326340
327341错误日志文件名
328342
329- ### ` LOG_FILE_FORMAT `  <Badge  type =" info "  text =" str "  /> 
330- 
331- 日志内容格式化
332- 
333343## 操作日志  
334344
335345### ` OPERA_LOG_PATH_EXCLUDE `  <Badge  type =" info "  text =" list[str] "  /> 
@@ -338,7 +348,7 @@ JWT 中间件存储用户信息到 Redis 时的前缀
338348
339349### ` OPERA_LOG_ENCRYPT_TYPE `  <Badge  type =" info "  text =" int "  /> 
340350
341- 操作日志加密类型 
351+ 操作日志中的接口请求参数加密类型 
342352
343353-  0:AES (性能损耗)
344354-  1:md5
@@ -348,17 +358,25 @@ JWT 中间件存储用户信息到 Redis 时的前缀
348358
349359### ` OPERA_LOG_ENCRYPT_KEY_INCLUDE `  <Badge  type =" info "  text =" list[str] "  /> 
350360
351- 将操作日志中的指定字段值进行加密
361+ 加密操作日志中的接口请求参数
362+ 
363+ ### ` OPERA_LOG_QUEUE_BATCH_CONSUME_SIZE `  <Badge  type =" info "  text =" int "  /> 
364+ 
365+ 操作日志队列批量消费大小,达到上限后,操作日志将批量写入数据库
366+ 
367+ ### ` OPERA_LOG_QUEUE_TIMEOUT `  <Badge  type =" info "  text =" int "  /> 
368+ 
369+ 操作日志队列超时时长,达到上限后,操作日志将批量写入数据库
352370
353371## 插件配置  
354372
355373### ` PLUGIN_PIP_CHINA `  <Badge  type =" info "  text =" bool "  /> 
356374
357- 是否开启  pip 下载插件依赖国内加速 
375+ 通过  pip 下载插件依赖时,是否使用国内源 
358376
359377### ` PLUGIN_PIP_INDEX_URL `  <Badge  type =" info "  text =" str "  /> 
360378
361- 通过 pip 下载插件依赖时的索引地址,与  ` PLUGIN_PIP_CHINA `  配置相辅相成 
379+ 通过 pip 下载插件依赖时的索引地址
362380
363381### ` PLUGIN_REDIS_PREFIX `  <Badge  type =" info "  text =" str "  /> 
364382
@@ -368,7 +386,7 @@ JWT 中间件存储用户信息到 Redis 时的前缀
368386
369387### ` CAPTCHA_LOGIN_REDIS_PREFIX `  <Badge  type =" info "  text =" str "  /> 
370388
371- 验证码登录时,验证码存储到 Redis 数据库时的前缀 
389+ 验证码登录时,验证码存储到 Redis 时的前缀 
372390
373391### ` CAPTCHA_LOGIN_EXPIRE_SECONDS `  <Badge  type =" info "  text =" int "  /> 
374392
@@ -380,37 +398,37 @@ JWT 中间件存储用户信息到 Redis 时的前缀
380398
381399#### ` CELERY_BROKER_REDIS_DATABASE `  <Badge  type =" info "  text =" int "  /> 
382400
383- celery  代理使用的 Redis 逻辑数据库
401+ Celery  代理使用的 Redis 逻辑数据库
384402
385403#### ` CELERY_RABBITMQ_HOST `  <Badge  type =" info "  text =" str "  /> 
386404
387- 连接 RabbitMQ 服务的主机地址
405+ Celery  连接 RabbitMQ 服务的主机地址
388406
389407#### ` CELERY_RABBITMQ_PORT `  <Badge  type =" info "  text =" int "  /> 
390408
391- 连接 RabbitMQ 服务的主机端口号
409+ Celery  连接 RabbitMQ 服务的主机端口号
392410
393411#### ` CELERY_RABBITMQ_USERNAME `  <Badge  type =" info "  text =" str "  /> 
394412
395- 连接 RabbitMQ 服务的用户名
413+ Celery  连接 RabbitMQ 服务的用户名
396414
397415#### ` CELERY_RABBITMQ_PASSWORD `  <Badge  type =" info "  text =" str "  /> 
398416
399- 连接 RabbitMQ 服务的密码
417+ Celery  连接 RabbitMQ 服务的密码
400418
401419### 基础配置  
402420
403421#### ` CELERY_BROKER `  <Badge  type =" info "  text =" Literal['rabbitmq', 'redis'] "  /> 
404422
405- 代理模式, 开发模式默认使用 redis ,线上模式强制切换为 rabbitmq 
423+ Celery  代理模式( 开发模式默认使用 Redis ,线上模式强制切换为 Rabbitmq) 
406424
407425#### ` CELERY_REDIS_PREFIX `  <Badge  type =" info "  text =" str "  /> 
408426
409- 任务应用默认使用的  Redis 逻辑数据库 
427+ Celery 数据存储到  Redis 时的前缀 
410428
411429#### ` CELERY_TASK_MAX_RETRIES `  <Badge  type =" info "  text =" int "  /> 
412430
413- 任务执行失败时的最大重试次数
431+ Celery  任务执行失败时的最大重试次数
414432
415433## 插件:OAuth2  
416434
@@ -444,4 +462,4 @@ Linux Do 客户端密钥
444462
445463#### ` CODE_GENERATOR_DOWNLOAD_ZIP_FILENAME `  <Badge  type =" info "  text =" str "  /> 
446464
447- 下载代码压缩包时的文件名称 
465+ 下载代码时的 ZIP 压缩包文件名 
0 commit comments