Skip to content

Commit 17e7cf8

Browse files
committed
docs: harden public repo defaults and setup docs
1 parent fd7da43 commit 17e7cf8

4 files changed

Lines changed: 15 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ OPENCLAW_GATEWAY_URL=http://localhost:18789
197197
CONTENTPIPE_PORT=8765
198198
CONTENTPIPE_HOST=0.0.0.0
199199
CONTENTPIPE_NOTIFY_CHANNEL=<discord_channel_id>
200+
CONTENTPIPE_PUBLIC_BASE_URL=http://localhost:8765
200201

201202
WECHAT_APPID=...
202203
WECHAT_SECRET=...
@@ -207,6 +208,7 @@ ANTHROPIC_API_KEY=...
207208

208209
说明:
209210
- `CONTENTPIPE_NOTIFY_CHANNEL` 为空时,不会发送 Discord 通知
211+
- `CONTENTPIPE_PUBLIC_BASE_URL` 用于 Discord 通知里的回链地址
210212
- 发布相关密钥建议只通过环境变量或本地未跟踪配置注入
211213

212214
---

requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fastapi>=0.115
2+
uvicorn>=0.34
3+
sse-starlette>=2.0
4+
python-multipart>=0.0.18
5+
jinja2>=3.1
6+
pyyaml>=6.0
7+
httpx>=0.27

scripts/web/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
app = FastAPI(
3030
title="ContentPipe Console",
3131
description="图文内容 Pipeline 主控台",
32-
version="0.2.0",
32+
version="0.7.0",
3333
)
3434

3535
# 静态文件

scripts/web/notify.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# 配置(可被环境变量覆盖)
1515
GATEWAY_URL = os.environ.get("OPENCLAW_GATEWAY_URL", "http://localhost:18789")
1616
NOTIFY_CHANNEL = os.environ.get("CONTENTPIPE_NOTIFY_CHANNEL", "")
17+
PUBLIC_BASE_URL = os.environ.get("CONTENTPIPE_PUBLIC_BASE_URL", "http://localhost:8765").rstrip("/")
1718

1819
# 节点 emoji
1920
NODE_EMOJI = {
@@ -76,7 +77,7 @@ async def notify_node_complete(run_id: str, node: str, title: str = "", summary:
7677
msg += f"\n> {title}"
7778
if summary:
7879
msg += f"\n{summary[:200]}"
79-
msg += f"\n🔗 审核: http://localhost:8765/runs/{run_id}/review?node={node}"
80+
msg += f"\n🔗 审核: {PUBLIC_BASE_URL}/runs/{run_id}/review?node={node}"
8081
await notify_discord(msg, run_id=run_id, node=node)
8182

8283

@@ -86,7 +87,7 @@ async def notify_review_needed(run_id: str, node: str, output_summary: str = "")
8687
msg = f"⏸️ **{emoji} {node} 等待审核**"
8788
if output_summary:
8889
msg += f"\n{output_summary[:300]}"
89-
msg += f"\n\n👉 http://localhost:8765/runs/{run_id}/review?node={node}"
90+
msg += f"\n\n👉 {PUBLIC_BASE_URL}/runs/{run_id}/review?node={node}"
9091
await notify_discord(msg, run_id=run_id, node=node, buttons=True)
9192

9293

@@ -95,7 +96,7 @@ async def notify_run_complete(run_id: str, title: str = ""):
9596
msg = f"✅ **Pipeline 完成**"
9697
if title:
9798
msg += f": {title}"
98-
msg += f"\n📱 预览: http://localhost:8765/runs/{run_id}/preview"
99+
msg += f"\n📱 预览: {PUBLIC_BASE_URL}/runs/{run_id}/preview"
99100
await notify_discord(msg, run_id=run_id)
100101

101102

@@ -104,5 +105,5 @@ async def notify_run_failed(run_id: str, error: str = ""):
104105
msg = f"❌ **Pipeline 失败**"
105106
if error:
106107
msg += f"\n```{error[:200]}```"
107-
msg += f"\n🔗 http://localhost:8765/runs/{run_id}"
108+
msg += f"\n🔗 {PUBLIC_BASE_URL}/runs/{run_id}"
108109
await notify_discord(msg, run_id=run_id)

0 commit comments

Comments
 (0)