清理历史兼容代码和废弃同步入口
This commit is contained in:
@@ -10,11 +10,8 @@
|
||||
- `scripts/deploy_to_vps.py`:部署新时空教务管理系统到 VPS。
|
||||
- `scripts/migrate_text_to_sqlite.py`:一次性把旧纯文本、JSON、JSONL 和课程小结 Markdown 迁移进 SQLite。
|
||||
- `scripts/import_course_summaries.py`:一次性导入历史课程小结 Markdown。
|
||||
- `scripts/sync_to_vps.py`:旧版正式数据同步脚本,迁移后不要继续常驻运行。
|
||||
- `scripts/smoke_test.js`:轻量前端行为烟测。
|
||||
- `scripts/install_gitea_backup_hook.py`:安装提交后自动推送到 Gitea 的 Git hook。
|
||||
- `scripts/install_launch_agent.py`:安装 Mac 开机常驻同步任务。
|
||||
- `launchd/com.xsk.education-management.sync.plist.template`:LaunchAgent 模板。
|
||||
|
||||
## 维护入口
|
||||
|
||||
@@ -70,27 +67,6 @@ http://121.199.172.246:18080/
|
||||
XSK_PYTHON_IMAGE='python:3.12-slim'
|
||||
```
|
||||
|
||||
## 手动同步数据
|
||||
|
||||
迁移完成后不要再用本机 `classnotes.txt` 和 `学生课时账户.md` 覆盖 VPS。SQLite 数据库 `/data/xsk_education.db` 是唯一事实源;运行时生成的 `/data/runtime_text_cache/` 只是兼容旧业务逻辑的缓存。下面命令只保留给迁移前或灾难恢复时使用,日常新增课程小结应走 `POST /api/ingest/course-summaries`。
|
||||
|
||||
```bash
|
||||
XSK_USE_SSHPASS=1 \
|
||||
XSK_SSH_PASSWORD='填写SSH密码' \
|
||||
python3 scripts/sync_to_vps.py --once --use-sshpass
|
||||
```
|
||||
|
||||
同步文件:
|
||||
|
||||
- `/Users/yangdawei/Desktop/新时空业务源数据/新时空课程记录与课时账户/classnotes.txt`
|
||||
- `/Users/yangdawei/Desktop/新时空业务源数据/新时空课程记录与课时账户/学生课时账户.md`
|
||||
|
||||
远端数据目录:
|
||||
|
||||
```text
|
||||
/root/新时空教务管理系统/data/xsk_education.db
|
||||
```
|
||||
|
||||
## SQLite 迁移
|
||||
|
||||
首次迁移先 dry-run:
|
||||
@@ -188,34 +164,6 @@ cp /root/新时空教务管理系统/data/backups/<备份目录>/学生课时账
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
## 安装自动同步
|
||||
|
||||
```bash
|
||||
XSK_USE_SSHPASS=1 \
|
||||
XSK_SSH_PASSWORD='填写SSH密码' \
|
||||
python3 scripts/install_launch_agent.py --use-sshpass
|
||||
```
|
||||
|
||||
日志位置:
|
||||
|
||||
```text
|
||||
~/Library/Logs/xsk-education-management/sync.log
|
||||
~/Library/Logs/xsk-education-management/sync.err.log
|
||||
```
|
||||
|
||||
查看任务:
|
||||
|
||||
```bash
|
||||
launchctl list | grep com.xsk.education-management.sync
|
||||
```
|
||||
|
||||
卸载任务:
|
||||
|
||||
```bash
|
||||
launchctl unload ~/Library/LaunchAgents/com.xsk.education-management.sync.plist
|
||||
rm ~/Library/LaunchAgents/com.xsk.education-management.sync.plist
|
||||
```
|
||||
|
||||
## 更换网页访问密码
|
||||
|
||||
登录 VPS 后修改 `/root/新时空教务管理系统/app/.env` 中的 `BASIC_AUTH_PASSWORD`,然后重启:
|
||||
|
||||
Reference in New Issue
Block a user