Polish generic NAS deployment template
- Rework docker-compose-Nas.yaml as a QNAP/NAS-friendly generic template with placeholders for NAS IP, public domain, proxy, and secrets. - Preserve QNAP-specific fixes including relative build context, api network alias, NAS persistent paths, and 127.0.0.1 health checks. - Keep optional frpc profile while avoiding real server addresses or tokens in the reusable template. - Replace residual deployment examples with generic your-domain.example, NAS_IP, PROXY_IP, and LAN_CIDR placeholders in README and Docker docs.
This commit is contained in:
28
README.md
28
README.md
@@ -278,15 +278,15 @@ docker compose -f docker-compose-Nas.yaml ps
|
||||
# XXX 必改:生产环境不要继续使用默认 Session 密钥。
|
||||
SESSION_SECRET=替换为足够长的随机字符串
|
||||
|
||||
# XXX 如果公网入口是 https://sstwbg.example.com,建议开启这两项。
|
||||
# XXX 如果公网入口是 https://your-domain.example,建议开启这两项。
|
||||
SESSION_COOKIE_SECURE=true
|
||||
TRUST_PROXY=true
|
||||
CORS_ORIGIN=http://192.168.31.5:4002,https://sstwbg.example.com
|
||||
CORS_ORIGIN=http://NAS_IP:4002,https://your-domain.example
|
||||
|
||||
# XXX 如需代理构建或让后端访问外网,可按 NAS 网络环境配置。
|
||||
HTTP_PROXY=http://192.168.31.7:7893
|
||||
HTTPS_PROXY=http://192.168.31.7:7893
|
||||
NO_PROXY=localhost,127.0.0.1,192.168.31.0/24,tuwen_db,tuwen_api,tuwen_web,api,db,web
|
||||
HTTP_PROXY=http://PROXY_IP:PROXY_PORT
|
||||
HTTPS_PROXY=http://PROXY_IP:PROXY_PORT
|
||||
NO_PROXY=localhost,127.0.0.1,LAN_CIDR,tuwen_db,tuwen_api,tuwen_web,api,db,web
|
||||
```
|
||||
|
||||
启用 NAS 上的 frpc 隧道:
|
||||
@@ -297,16 +297,16 @@ docker compose -f docker-compose-Nas.yaml --profile frpc up -d --build
|
||||
docker compose -f docker-compose-Nas.yaml logs -f frpc
|
||||
```
|
||||
|
||||
`# XXX` NAS 公网访问仍然只需要把 `4002` 通过 frpc 映射到公网服务器,再由 Nginx Proxy Manager 给 `sstwbg.example.com` 提供 HTTPS。`4443` 仍只是本机自签名 HTTPS 演示入口,不建议映射到公网域名。
|
||||
`# XXX` NAS 公网访问仍然只需要把 `4002` 通过 frpc 映射到公网服务器,再由 Nginx Proxy Manager 给 `your-domain.example` 提供 HTTPS。`4443` 仍只是本机自签名 HTTPS 演示入口,不建议映射到公网域名。
|
||||
|
||||
## 公网反向代理部署
|
||||
|
||||
<!-- # XXX 公网部署新增:适用于本机 Docker 4002 端口通过 frpc 映射到公网服务器,再由 Nginx Proxy Manager 绑定 sstwbg.example.com 的部署链路。 -->
|
||||
<!-- # XXX 公网部署新增:适用于本机 Docker 4002 端口通过 frpc 映射到公网服务器,再由 Nginx Proxy Manager 绑定 your-domain.example 的部署链路。 -->
|
||||
|
||||
推荐公网链路:
|
||||
|
||||
```text
|
||||
浏览器 https://sstwbg.example.com
|
||||
浏览器 https://your-domain.example
|
||||
-> 公网服务器 Nginx Proxy Manager
|
||||
-> frps/frpc 映射端口
|
||||
-> 本机 Docker web:4002
|
||||
@@ -363,17 +363,17 @@ docker-compose logs -f frpc
|
||||
docker-compose up -d --build
|
||||
```
|
||||
|
||||
`# XXX` 公网正式访问只需要映射 `4002` 到公网服务器,再由公网 Nginx Proxy Manager 提供 `https://sstwbg.example.com`。不建议把 `4443` 映射到公网域名;`4443` 是本机自签名 HTTPS 演示入口,主要用于 `https://localhost:4443` 测试麦克风。
|
||||
`# XXX` 公网正式访问只需要映射 `4002` 到公网服务器,再由公网 Nginx Proxy Manager 提供 `https://your-domain.example`。不建议把 `4443` 映射到公网域名;`4443` 是本机自签名 HTTPS 演示入口,主要用于 `https://localhost:4443` 测试麦克风。
|
||||
|
||||
Nginx Proxy Manager 中为 `sstwbg.example.com` 新建 Proxy Host:
|
||||
Nginx Proxy Manager 中为 `your-domain.example` 新建 Proxy Host:
|
||||
|
||||
- `Domain Names`:`sstwbg.example.com`
|
||||
- `Domain Names`:`your-domain.example`
|
||||
- `Scheme`:`http`
|
||||
- `Forward Hostname / IP`:frps 可访问到的映射地址,通常是 `127.0.0.1`、公网服务器内网 IP 或 frps 指定监听地址。
|
||||
- `Forward Port`:frpc 暴露出来的 `remotePort`,例如 `4002`。
|
||||
- `Websockets Support`:开启。`# XXX` 语音识别使用 `/api/speech/iat` WebSocket,必须透传 Upgrade。
|
||||
- `Block Common Exploits`:开启。
|
||||
- `SSL`:申请或绑定 `sstwbg.example.com` 证书,开启 `Force SSL`。`# XXX` 浏览器麦克风权限要求 HTTPS,普通公网 HTTP 下语音识别不可用。
|
||||
- `SSL`:申请或绑定 `your-domain.example` 证书,开启 `Force SSL`。`# XXX` 浏览器麦克风权限要求 HTTPS,普通公网 HTTP 下语音识别不可用。
|
||||
|
||||
Nginx Proxy Manager 的 `Advanced` 可加入:
|
||||
|
||||
@@ -389,8 +389,8 @@ proxy_send_timeout 3600s;
|
||||
公网验收顺序:
|
||||
|
||||
```text
|
||||
1. 打开 https://sstwbg.example.com/api/health,确认 API 健康检查可访问。
|
||||
2. 打开 https://sstwbg.example.com 登录 admin / 123456。
|
||||
1. 打开 https://your-domain.example/api/health,确认 API 健康检查可访问。
|
||||
2. 打开 https://your-domain.example 登录 admin / 123456。
|
||||
3. 进入系统设置,确认 AI Provider 和讯飞语音配置有效。
|
||||
4. 进入报告编辑页,测试上传视频、自动抽帧、报告保存、AI 对话和语音听写。
|
||||
5. 浏览器控制台执行 window.isSecureContext,应返回 true;否则语音麦克风权限不会开放。
|
||||
|
||||
Reference in New Issue
Block a user