Commit Graph
30 Commits
Author SHA1 Message Date
qing cebef9fe70 docs: 各模块安全审计报告 + 补充 .gitignore 忽略规则 2026-08-01 05:21:23 +08:00
qing 6c587a22d8 docs(db): update README for log_client SDK template and hardening features
- Document that example_log_client.py now uses RpcClient (high-level RPC)
  instead of legacy MsgClient (low-level TCP frames)
- Add comprehensive client feature list reflecting all hardening fixes:
  - Thread exception protection (outer try/except prevents thread death)
  - Accurate enqueue-time timestamps
  - Queue maxsize with drop-oldest policy
  - Safe JSON serialization fallback
  - Event-based flush synchronization
  - Non-blocking push() guarantee
- Clarify length truncation: server-side _log_internal() truncates
  internal logs to 8KB/4KB, external clients should control length
- Add db_tools.py to file table (was previously undocumented)
- Update service description to mention RpcServer
2026-08-01 03:28:40 +08:00
qing bdbea6ac40 fix(log_client): update example_log_client template to use RpcClient
- Replace legacy MsgClient (low-level TCP frames) with RpcClient (high-level
  RPC) to match dbv2's RpcServer interface; the old MsgClient-based version
  was incompatible with the current RPC routing protocol
- Apply all hardening fixes from the service copies:
  - Outer try/except in _flush_loop to prevent any exception from killing
    the background thread
  - _safe_json() helper for unserializable extra fields (fallback to str/repr)
  - Timestamp generated at push() (enqueue time) instead of _send() time
  - Event-based flush() synchronization instead of unreliable sleep(0.6)
  - Queue maxsize=10000 with drop-oldest policy to prevent unbounded memory
  - put_nowait with Full handling ensures push() never blocks business threads
  - RpcClient construction wrapped in try/except
- Add explicit service_name parameter example for all 4 services in comments
- This is the template file referenced by db/README.md and copied by new
  services; keeping it in sync prevents propagating old bugs
2026-08-01 03:26:19 +08:00
qing 3f97dd92ef update 2026-07-30 21:57:04 +08:00
qing 32d3a5a19f 重构db 2026-07-30 20:15:02 +08:00
qing 803d176066 docs(db): 修正 log_client 描述并补充 message/extra 截断说明
- "纯标准库实现" → "无第三方依赖(仅依赖 pymsg 项目内置库)",更准确
- 新增长度保护说明:message 上限 8KB、extra 上限 4KB,超长自动截断

fix(db): _set.sh Nuitka 注释 main.py → dbv2.py
2026-07-30 12:34:37 +08:00
qing 19d5b65625 fix(db): 新增日期列类型适配层,修复无法经 db 处理 DATETIME 列的问题
JSON 无日期类型,而 SQLite DATETIME 只接受 Python datetime 对象,
导致各服务对日期列的写入与 where 比较全部失败。_coerce_value 按反射
列类型把 ISO 8601 字符串转为 datetime/date/time(带时区偏移统一转
UTC),并支持 "$now" 哨兵取服务端当前时间;响应中日期时间改为一律
序列化为 ISO 8601(T 分隔)。黑盒测试补 3 个日期列场景。
2026-07-28 23:16:17 +08:00
qing 6692c9c4ee refactor(db): 清理遗留死代码并对齐文档与测试
删除 dbv2 从未挂载的 log_module.py(Flask /log/* 遗留)与纯 TCP 服务
用不到的 security_middleware.py 副本;db/README.md 按 pymsg 实现重写,
requirements 去掉 flask/waitress;黑盒测试对 pymsg 服务改用 TCP 探测,
修复 check_service HTTP 探测导致的 db 测试整体假 skip。
2026-07-28 22:21:36 +08:00
qing 50f209e84a fix: X-Frame-Options/frame-ancestors 改为同源以修复条例弹窗空白 2026-07-28 11:53:35 +08:00
qing a5e581ef24 fix: CSP img-src 放行 blob:,修复验证码图片被拦截
登录页验证码用 URL.createObjectURL 生成的 blob: URL 显示,被 img-src 'self' data: 拦截导致图片无法加载;五处 CSP 定义(waf 边缘 + 四个 Flask 中间件副本)同步放宽。
2026-07-28 10:19:47 +08:00
qing 18ac572442 更新dbv2、删除旧的db1、为static添加log 2026-07-27 10:22:16 +08:00
qing 08021015b1 更新msg客户端 2026-07-27 09:21:06 +08:00
qing 6efb792133 C++版本的MsgClient 2026-07-26 21:48:14 +08:00
qing 3d2278f6b7 ^-^ rename 2026-07-26 21:27:40 +08:00
qing 4fe0689cf6 修复db客户端无法推日志的问题 2026-07-26 21:26:17 +08:00
qing 8ec42df779 初步开发了新的pymsg,并且应用在了dnfs上面 2026-07-26 17:57:27 +08:00
qing 9349b8248f fix 2026-07-25 21:08:17 +08:00
qing 013e130a08 logs in db develop 2026-07-25 21:01:46 +08:00
qing a4479696eb dos2unix 2026-07-25 20:54:57 +08:00
qing 479d263b88 log service in db 2026-07-25 20:32:56 +08:00
qing efbe2b36f3 节点所有权 2026-07-25 14:20:08 +08:00
qing fbccc5d909 网友修改版 2026-07-25 00:21:16 +08:00
shufeng2012 468d420746 解决冲突(这啥呀*2) 2026-07-24 15:00:34 +08:00
shufeng2012 80d20f5015 解决冲突(这啥呀) 2026-07-24 14:46:26 +08:00
shufeng2012 a6ff35260b 使用db服务 2026-07-24 10:02:46 +08:00
shufeng2012 b2aa177ed2 refix 2026-07-24 07:33:34 +08:00
shufeng2012 2ac5e0999a 创建sqlite3数据表的sql文件 2026-07-24 07:11:48 +08:00
shufeng2012 cc08d171c6 refix 2026-07-24 07:05:46 +08:00
shufeng2012 4046ef8dc8 refix 2026-07-24 07:01:43 +08:00
shufeng2012 400f527a88 rename 2026-07-24 06:36:26 +08:00