Compare commits
2
Commits
ec1eb1e805
...
f003b4dfaa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f003b4dfaa | ||
|
|
eb506e5cbf |
No files matched your search
+15
-1
@@ -190,6 +190,20 @@ port = resp["data"]["value"]
|
||||
- 各内部服务通过 pymsg 调 `get` 路由按需获取配置,替代本地散落的 ini/json/yaml
|
||||
- 自身日志通过 `log_client.py` 异步推送至 `db:8005` 的 Logs 表(与其他服务一致)
|
||||
|
||||
### 已接入的服务
|
||||
|
||||
| 服务 | 配置文件 | 接入方式 |
|
||||
|------|---------|---------|
|
||||
| [static](../static/) | [static.ini](configs/static.ini) | 三层 fail-safe:内置默认值 → confs(优先)→ 本地 `config.ini` 回退 |
|
||||
|
||||
static 的接入实现见 [static/fsys.py](../static/fsys.py):
|
||||
- `_fetch_from_confs()` 通过 `RpcClient` 调 `get` 路由取 `static.ini`,3 秒超时
|
||||
- `CONFS_HOST` / `CONFS_PORT` 环境变量定位 confs(默认 `127.0.0.1:8010`)
|
||||
- `_merge_ini()` 仅覆盖已知的 section/key(白名单合并,不引入未预期字段)
|
||||
- 配置来源会记录到日志(`logs.info/warning`),便于排查实际用了哪一层
|
||||
|
||||
其他服务(gateway / waf / ai_review / smtp / dnfs / db)尚未接入,仍读各自本地配置。
|
||||
|
||||
## 项目结构
|
||||
|
||||
```
|
||||
@@ -211,4 +225,4 @@ confs/
|
||||
- 文件以 UTF-8 读取,非 UTF-8 文件会返回 `配置读取失败` 错误
|
||||
- 配置名区分大小写(与文件系统一致)
|
||||
- 缓存基于文件 mtime 判断变化,若同秒内修改且 mtime 精度不足(如某些 FAT 文件系统),可能无法及时重载——可手动调 `reload` 路由强制刷新
|
||||
- `static` 已接入 confs 统一分发(启动时拉取 `static.ini`,本地 `config.ini` 为 fail-safe 回退);其余服务仍读本地配置文件,接入示例见上文"调用示例"
|
||||
- 当前接入情况见上文"集成关系 → 已接入的服务";新服务接入可参考 static 的三层 fail-safe 模式(内置默认 → confs 优先 → 本地回退)
|
||||
@@ -78,6 +78,7 @@ static :9200 (Flask + CORS)
|
||||
- 文件浏览:目录导航、面包屑、实时搜索(`/` 或 `Ctrl+F`)、文件统计
|
||||
- 流媒体:视频(MP4/WebM/OGG/AVI/MOV/MKV)与音频(MP3/WAV/OGG/FLAC/AAC/M4A)在线播放,支持进度拖动
|
||||
- 深色模式:`css/theme.css` 统一主题,自动适配系统偏好
|
||||
- 表单组件:注册页图形/邮箱验证码统一 `.code-box` 行内布局(文字标签 + 输入框 + 控件同排,窄屏自动换行),验证码图片样式复用 `theme.css` 的 `.captcha-img` 类
|
||||
- 路径遍历防护:`safe_path_join` 限制访问范围在 `directory.root` 内
|
||||
- Nuitka 编译:可打包为独立二进制 `fsys.bin`(`sys.frozen` 检测 + BASE_DIR 锚定)
|
||||
- 安全头注入:`security_middleware.py` 为所有响应注入 CSP、X-Frame-Options 等安全头
|
||||
|
||||
@@ -190,6 +190,18 @@ input[type="button"]:disabled {
|
||||
}
|
||||
.code-box input[type="text"] { width: auto; flex: 1; min-width: 100px; display: inline-block; }
|
||||
.code-box input[type="button"] { white-space: nowrap; }
|
||||
/* 图形验证码图片(register 图形/邮箱验证码同排布局) */
|
||||
.code-box .captcha-img {
|
||||
width: 120px;
|
||||
height: 38px;
|
||||
flex: none;
|
||||
cursor: pointer;
|
||||
border: 1.5px solid var(--border);
|
||||
border-radius: 10px;
|
||||
box-sizing: border-box;
|
||||
object-fit: cover;
|
||||
background: var(--bg);
|
||||
}
|
||||
|
||||
/* ===== Validation Tips ===== */
|
||||
.tip-red { color: var(--error); font-size: 0.78rem; }
|
||||
|
||||
@@ -14,12 +14,11 @@
|
||||
<label>邮箱号:</label>
|
||||
<input type="email" id="regemail" placeholder="请输入邮箱号">
|
||||
<span id="emlTip"></span>
|
||||
<label>图形验证码:</label>
|
||||
<div style="display:flex;align-items:center;gap:8px">
|
||||
<input type="text" id="captchaAnswer" placeholder="请输入图形验证码" maxlength="4" autocomplete="off" style="flex:1;min-width:0;width:auto">
|
||||
<img id="captchaImg" alt="加载中…" title="点击刷新验证码" style="width:120px;height:38px;flex:none;cursor:pointer;border:1.5px solid var(--border);border-radius:10px;box-sizing:border-box">
|
||||
</div>
|
||||
<div class="code-box">图形验证码:
|
||||
<input type="text" id="captchaAnswer" placeholder="请输入图形验证码" maxlength="4" autocomplete="off">
|
||||
<img id="captchaImg" class="captcha-img" alt="加载中…" title="点击刷新验证码">
|
||||
<span id="captchaTip"></span>
|
||||
</div>
|
||||
<div class="code-box">邮箱验证码:
|
||||
<input type="text" id="code" placeholder="请输入6位验证码" inputmode="numeric" maxlength="6">
|
||||
<input type="button" id="getCode" value="获取验证码">
|
||||
|
||||
Reference in new issue
Block a user