Files
daywork/server/DEPLOY.md
T

33 lines
1.0 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.
# 同步服务端部署指南
## 部署(在 124.221.192.176 上执行)
1. 上传 server 目录到服务器(如 ~/internlog-sync/)
2. 启动:
cd ~/internlog-sync
docker compose up -d --build
3. 验证:curl http://127.0.0.1:3780/api/health 应返回 {"ok":true}
数据保存在 ./data/(用户注册表 + 每用户数据文件),直接打包该目录即备份。
## 建议:启用 HTTPS
客户端在手机浏览器使用时,建议用 nginx 反向代理复用现有证书:
location /sync-api/ {
proxy_pass http://127.0.0.1:3780/;
proxy_set_header Host $host;
}
客户端同步地址填 https://gitea.linyux.cn/sync-api 即可全程加密。
不加代理时客户端可临时填 http://124.221.192.176:3780(明文,仅建议内网或过渡期使用)。
## 接口
- POST /api/auth/register {username, password}
- POST /api/auth/login {username, password}
- POST /api/sync Authorization: Bearer <token>,body: {tables, tombstones}
- GET /api/health