Files
backnotprop__plannotator/apps/paste-service/wrangler.toml
Michael Ramos ea758f9978 Add configurable paste service URL for self-hosting (#582)
* Wire PLANNOTATOR_PASTE_URL through opencode/pi servers and Landing demo link

OpenCode plugin only read PLANNOTATOR_SHARE_URL; add a getPasteApiUrl helper
and thread it into plan/annotate/archive server starts. Pi extension's
serverReview gains the same shareBaseUrl/pasteApiUrl env-var pair already
used by serverPlan/serverAnnotate. Landing.tsx now accepts a shareBaseUrl
prop for self-hosters' demo link. Paste-service CORS defaults grow a
comment clarifying that self-hosters must override ALLOWED_ORIGINS.

* Embed custom paste origin in short URL fragment

When PLANNOTATOR_PASTE_URL is set to a non-default paste service, the
generated short link now includes a base64url-encoded paste param in the
fragment (#key=...&paste=...). The share portal and importFromShareUrl
extract it on load so they can fetch from the right paste backend without
needing a server — fixing broken short links for self-hosters who use a
custom paste service but keep the hosted share portal.

Backward compatible: links without a paste param continue to use the
default or server-provided paste API URL as before.

For provenance purposes, this commit was AI assisted.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-17 22:21:49 -07:00

16 lines
587 B
TOML

name = "plannotator-paste"
main = "targets/cloudflare.ts"
compatibility_date = "2024-12-01"
[[kv_namespaces]]
binding = "PASTE_KV"
# Run `wrangler kv:namespace create PASTE_KV` to get your IDs and fill them in.
id = "9bc2647f6f5244499c26c90d87a743a0"
preview_id = "6efae5ac33c4443ba8f0a0b83a2eb111"
[vars]
# Default values target the hosted plannotator.ai deployment.
# Self-hosters must override ALLOWED_ORIGINS to point at their own portal,
# either by editing this file or setting it via `wrangler secret put`.
ALLOWED_ORIGINS = "https://share.plannotator.ai,http://localhost:3001"