Files
37duAutomation/desktop/fileserver/frontend/README.md
T
puddy eeb951f9f6 feat(fileserver): 新增内网文件服务器服务与管理页面
新增 FastAPI 文件服务器核心模块(配置、鉴权、存储、心跳上报),新增 HTTP 路由接口(健康检查、文件上传/下载/删除、管理登录/密码修改/统计),新增 Vue3 管理页面源码;新增 MySQL 元数据存储支持,新增 PyMySQL 依赖;新增 .gitignore 忽略 IDE 与备份文件;新增文件服务器工具脚本;删除旧的 build/ 脚本与 exe 构建产物,优化 Electron 平台登录逻辑为纯接口模式,新增平台账号环境变量注入,优化试用期异常检查逻辑,拆分服务岗转正流程为独立脚本。
2026-10-12 09:45:04 +08:00

48 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# fileserver 管理页面(Vue 3)
文件服务器(8802)的 Web 管理界面:查看文件列表、上传时间、大小、SHA256,支持上传/下载/删除。
## 文件说明
| 文件 | 说明 |
|------|------|
| `index.html` | 页面骨架 + 样式 |
| `app.js` | Vue 3 应用逻辑(列表/上传/删除/搜索) |
| `vue.global.prod.js` | Vue 运行时(本地托管,离线可用,部署在服务器 `/opt/37du/fileserver-admin/`) |
## 架构
```
浏览器 → Nginx(:80)
├── 页面静态文件(/opt/37du/fileserver-admin/)
└── /fs-api/* → 反代到 127.0.0.1:8802
```
- 管理接口(列表/上传/删除)需**页面内登录**:`POST /api/admin/login`(账号密码在 fileserver/.env 的 `FILESERVER_ADMIN_USER/PASSWORD`),签发 HMAC 会话 Token(默认 12h),前端存 localStorage、以 `Authorization: Bearer` 携带
- 前端**不接触** X-API-Token(中心机/自动化直连 8802 时用)
- 下载 `/files/{fid}` 保持开放(执行机内网直连)
- Nginx `client_max_body_size 0` 支持大文件上传
## 部署位置(服务器 172.30.30.243)
- 站点配置:`/etc/nginx/sites-available/37du-fileserver-admin`
- 页面文件:`/opt/37du/fileserver-admin/`
- 认证文件:`/etc/nginx/.htpasswd`
## 修改管理密码
```bash
# 修改 /opt/37du/fileserver/.env 中的 FILESERVER_ADMIN_PASSWORD,然后重启服务:
systemctl restart 37du-fileserver
```
## 更新页面
1. 本地修改 `desktop/fileserver/frontend/` 下文件
2. 上传覆盖 `/opt/37du/fileserver-admin/` 同名文件
3. `systemctl reload nginx`
## 防火墙(ufw)
已启用:默认拒绝入站,放行 `22/tcp`(limit)、`80/tcp`、`3306/tcp`、`8802/tcp`。
管理:`ufw status verbose` / `ufw allow <port>/tcp` / `ufw delete allow <port>/tcp`