guanghulab/brain/operations/BS-SG-001/OUTLINE-DEPLOYMENT-STATUS.md

80 lines
3.4 KiB
Markdown
Raw Permalink Normal View History

# ════════════════════════════════════════════
# Outline Wiki + Dex OIDC 部署状态
# 服务器BS-SG-001 (新加坡)
# 时间2026-06-04 D123
# ════════════════════════════════════════════
## 容器状态
```
outline → port 3090 (内部 3000) image: outlinewiki/outline:0.80.2
outline-dex → port 5556 image: dexidp/dex:latest
outline-postgres → 内部网络 image: postgres:16-alpine
outline-redis → 内部网络 image: redis:7-alpine
```
状态:全部 healthy ✅
## 配置路径
- Docker Compose: `/opt/outline/docker-compose.yml`
- Dex 配置: `/opt/outline/dex-config.yml`
- 数据目录: `/opt/outline/outline-data/`, `postgres-data/`, `redis-data/`
## 关键配置项
- Outline URL: `https://guanghubingshuo.com/outline`
- Dex Issuer: `https://guanghubingshuo.com/dex`
- OIDC Redirect: `https://guanghubingshuo.com/outline/auth/oidc.callback`
- OIDC Provider: `光湖登录`
- 管理员: `bingshuo` (静态密码Dex mockCallback)
## Nginx 新增代理块
| 路径 | 后端 | 用途 |
|------|------|------|
| `/outline/` | port 3090 | Outline Wiki |
| `/dex/` | port 5556 | Dex OIDC |
| `/static/` | port 3090 | Outline JS/CSS 静态资源 |
| `/fonts/` | port 3090 | Outline 字体 |
| `/auth/oidc` | port 3090 | OIDC 登录跳转 |
| `/brain-db/` | port 3914 | 人格体数据库 |
## Nginx 关键机制
1. **API 条件路由**`map $http_referer` 按 Referer 来源选择 /api/ 后端
- 来源包含 "outline" → port 3090
- 其他 → port 3998原服务不受影响
2. **Referrer-Policy 重写**/outline/ 覆盖 `no-referrer``same-origin`
- Outline 默认禁止浏览器发送 Referer导致 map 路由失效
## ⚠️ 当前卡点 — 未解决
Outline 页面显示 "Failed to load configuration"。
### 已完成排查
- ✅ 静态资源(/static/, /fonts/)正常加载
- ✅ /outline/ 页面正常返回
- ✅ /outline/api/auth.config 直接请求返回正确数据
- ✅ OIDC 跳转链路打通(/outline/auth/oidc → /dex/auth → redirect
- ✅ Nginx 语法通过并 reload
### 推测原因
1. **Referer 路由仍失效**:虽然修改了 referrer-policy 为 same-origin
但 Service Worker (`/static/sw.js`) 可能拦截 fetch 请求且不透传 Referer
2. **SW 干扰**Outline 使用的 Service Worker 可能自己的 fetch handler 中
使用了 `no-referrer` 策略,覆盖了页面级的 referrer-policy
3. **建议方向**
- 方案 A禁用 SW拦截 /static/sw.js 返回空)测试是否修复
- 方案 B用子域名 `outline.guanghubingshuo.com` 完全避免子路径问题
- 方案 CNginx 层注入自定义 header如 X-Outline-Proxy: 1并在 map 中使用
### 验证方法
```bash
# 检查 Nginx 日志确认 Referer 是否已发送
tail -f /var/log/nginx/access.log | grep "/api/"
# 直接测试(带 Referer
curl -X POST https://guanghubingshuo.com/api/auth.config \
-H "Referer: https://guanghubingshuo.com/outline/" \
-H "Content-Type: application/json" -d '{}'
# 预期:{"data":{"providers":[...]},"status":200,"ok":true}
```
## 首页卡片
已添加第5张卡片「🧠 语言层数据库」→ `/outline/`
文件位置:`/var/www/html/index.html`