# 2026-04-15

## 今日目标

- 修复 Oppi iPhone HTTPS 连接（Apple ATS 报错）
- Debug IBKR bot TSLA 平仓单未触发问题
- 迁移通知从 LINE 到 Telegram
- 建立 Second Brain 知识库

## 工作过程

### Oppi HTTPS 修复

问题：iPhone 连接 Oppi 时被 Apple ATS 拒绝，Tailscale 证书方案不可用（账户限制）。

排查发现 Oppi 运行在 self-signed TLS 模式（端口 7749），nginx 反代用 http → 协议不匹配。

解决：将 Oppi TLS 改为 manual 模式，指向 Let's Encrypt 证书，nginx 改为 proxy_pass https + proxy_ssl_verify off。Oppi 和 nginx 使用同一张证书，invite 里的 cert fingerprint 匹配。

访问地址：`https://yaolispeedgoat.duckdns.org:8443`

### Telegram 迁移

从 LINE 迁移到 Telegram：
- 播报 bot：`@SpeedGoatbot`（Yahoo Finance 信号）
- 交互 bot：`@yaolispeedgoatbot`（IBKR Gateway 直连，待开发）

在 `approval_service.py` 添加 `TelegramNotifier` 类，`system.yaml` provider 改为 telegram。

### IBKR Bot Debug

TSLA BUY 245 一直未触发，原因：`max_order_quantity: 10` 风控拦截。改为 500 后通过。

随后发现订单已于 17:53 提交到 IBKR Gateway：
- order_id=188，TSLA BUY 245 MKT，status=PreSubmitted
- 市场休市，等待 2026-04-16 9:30 AM ET 成交
- 后续「该信号已处理」是正常去重，非 bug

## 结论 / 决策

- Oppi 用 manual TLS + Let's Encrypt，不走 Tailscale 证书
- 通知全面切换到 Telegram，LINE 代码保留
- max_order_quantity 设为 500

## 明日待办

- 确认 order_id=188 TSLA BUY 245 开盘后成交
- 成交后删除 `buy-tsla-245-retry` 规则
- 确认 Oppi iPhone 连接正常
