www_site/infra/README.md

20 lines
954 B
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.

# Phase 2 基础设施
本目录只保存不含秘密的部署模板:
- `caddy/Caddyfile`:测试机 IP 的内部 CA HTTPS、Web/API 反向代理。
- `systemd/kaotings-api.service`FastAPI 自动重启服务。
- `systemd/kaotings-web.service`Next.js 自动重启服务。
数据库账号密码、`CSRF_SECRET` 和 Caddy 私有 CA 不进入 Git。服务器上的 `/etc/kaotings/api.env` 必须由 root 拥有且权限为 `0600`
Phase 2 测试入口:
- HTTPS`https://192.168.199.22/`
- API通过同源 `https://192.168.199.22/api/v1/*`
- API 回环端口:`127.0.0.1:8000`,不对局域网开放
- Web 回环端口:`127.0.0.1:3000`,不对局域网开放
- PostgreSQL`127.0.0.1:5432`,不对局域网开放
Caddy `tls internal` 生成的根证书需要在测试浏览器/设备中导入后HTTPS 才会显示为受信任。根证书可以从服务器的 Caddy 数据目录受控导出;私钥不得导出或提交。