Inbox: advertise a configurable public URL instead of localhost (tunnels, reverse proxies)

オープン
#4,082 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

Start by tracing inboxCanonicalBaseUrl, resolvePublicUrl, and the Inbox URL outputs named in the issue; the payload does not provide their file paths. Check how publicUrl is configured and validated for review and annotate sessions. Done means the Inbox setting controls the advertised links listed in the proposal, while inbox status --json retains its local URL and adds public_url; the listener and routes remain local-only.

索引モデルが issue の本文から書いたものです。

説明

What I want

I run the Inbox on a cloud dev box and reach it from my laptop through an authenticated HTTPS tunnel (ngrok, a Cloudflare Tunnel I run myself or an nginx reverse proxy all work the same way). The tunnel has a stable public origin, https://<user>-<label>-plannotator-inbox.<tunnel-domain>, which forwards to the Inbox's loopback port.

Every link the Inbox hands out still says http://localhost:<port>/:

  • the url that send_message and read_thread return to agents
  • what plannotator inbox --open, --background and status print, and therefore Pi's /plannotator-inbox notice
  • links in notifications

So every link an agent gives me is dead on the laptop, and I have to swap the origin by hand.

I'd like a way to set the origin the Inbox advertises, the way publicUrl / PLANNOTATOR_PUBLIC_URL already works for review and annotate sessions.

What I found (v0.29.3 CLI, v0.29.4 Pi extension)
  • inboxCanonicalBaseUrl(port) builds http://${resolveLocalUrlHostname(config) ?? "localhost"}:${port}/. It accepts only localhost or a *.localhost urlHost, so it can't produce an https:// origin without a port.
  • resolvePublicUrl (PLANNOTATOR_PUBLIC_URL / publicUrl) feeds only resolveAdvertisedSessionUrl, so review and annotate sessions use it. The Inbox never reads it.
  • The Inbox can't be pinned to a port (it reuses the port in inbox/inbox.json), so a urlHost-style host:port setting would not help either. The tunnel keeps a stable name and moves with the port.

#4017 asks for the same thing for Tailscale (advertise tailscale.url). This request is the general case: any origin that the user sets.

Proposal

Add an Inbox public origin setting: inboxPublicUrl in config.json plus PLANNOTATOR_INBOX_PUBLIC_URL, validated with the existing isValidPublicUrl (an origin with no path, query or credentials).

When it is set:

  • send_message, read_thread, inbox --open, inbox --background, inbox status and notifications use <inboxPublicUrl>/ plus the thread path.
  • inbox status --json keeps the loopback url and adds public_url, so scripts can still find the local port.
  • Nothing else changes: the Inbox still binds loopback, and the MCP and agent routes stay local-only. Only the advertised address changes.

With #4017 the precedence could be: explicit inboxPublicUrl, then the live tailnet URL when the advertise option is on, then localhost.

Related: session ports after the first

With PLANNOTATOR_PORT=19432-19439, publicUrlAppliesToPort applies PLANNOTATOR_PUBLIC_URL only to 19432. A second concurrent review on 19433 prints http://localhost:19433, even though I run one tunnel per port (https://…-plannotator-19433.<tunnel-domain>). A {port} placeholder would cover this, for example PLANNOTATOR_PUBLIC_URL=https://me-plannotator-{port}.example.dev, filled in for every port in the range. I'm happy to split this into its own issue if you prefer.

Workaround for now

I bookmark the tunnel URL and tell agents to rewrite http://localhost:<port> links themselves.

主要言語
TypeScript
スター
8.7k
フォーク
649
平均マージ
16時間 1分
マージ済み PR(30日)
756

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

backnotprop/plannotator のほかの issue

backnotprop/plannotator の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。