1414# 配置(可被环境变量覆盖)
1515GATEWAY_URL = os .environ .get ("OPENCLAW_GATEWAY_URL" , "http://localhost:18789" )
1616NOTIFY_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
1920NODE_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