feat(config): 新增错误日志请求体记录开关(默认关闭)

- 新增环境变量 ERROR_LOG_RECORD_REQUEST_BODY,默认 false
- Settings 增加该配置,并在各服务写入错误日志时按开关决定是否
  入库请求体,降低敏感信息泄露风险
- 配置编辑页新增对应开关,前端初始化默认值;.env.example、
  README/README_ZH 同步更新
- db: add_error_log 支持 None 请求体并更稳健解析字符串/字典
- perf(db): 将错误日志批量删除 batch_size 从 500 下调到 200,
  兼容 SQLite/MySQL 参数上限并提升稳定性
- docs: 补充 aliyun_oss 上传提供商与 OSS 配置示例
- style: 轻微代码格式化与导入顺序优化
This commit is contained in:
snaily
2025-09-18 04:21:28 +08:00
parent 7dbd3ad693
commit 708fb1604b
12 changed files with 106 additions and 34 deletions
+28
View File
@@ -2279,6 +2279,34 @@ endblock %} {% block head_extra_styles %}
>
</div>
<!-- 错误日志记录请求体 -->
<div class="mb-6">
<div class="flex items-center justify-between">
<label
for="ERROR_LOG_RECORD_REQUEST_BODY"
class="font-semibold text-gray-700"
>错误日志记录请求体</label
>
<div
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
>
<input
type="checkbox"
name="ERROR_LOG_RECORD_REQUEST_BODY"
id="ERROR_LOG_RECORD_REQUEST_BODY"
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
/>
<label
for="ERROR_LOG_RECORD_REQUEST_BODY"
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
></label>
</div>
</div>
<small class="text-gray-500 mt-1 block"
>关闭可避免敏感数据入库,默认关闭。</small
>
</div>
<!-- 自动删除错误日志 -->
<div class="mb-6">
<div class="flex items-center justify-between">