Add configurable paste service URL for self-hosting#582
Merged
backnotprop merged 2 commits intomainfrom Apr 18, 2026
Merged
Conversation
…mo 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.
backnotprop
commented
Apr 18, 2026
Owner
Author
backnotprop
left a comment
There was a problem hiding this comment.
Review from Plannotator
Comment on lines
+12
to
15
| # 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" |
Owner
Author
There was a problem hiding this comment.
suggestion (blocking): This needs documentation
Comment on lines
+7
to
13
| // Defaults target the hosted plannotator.ai deployment. | ||
| // Self-hosters should set PASTE_ALLOWED_ORIGINS (Bun) or ALLOWED_ORIGINS (Cloudflare) | ||
| // to their own portal origin so requests from the hosted share.plannotator.ai | ||
| // portal are not granted CORS access against their service. | ||
| export function getAllowedOrigins(envValue?: string): string[] { | ||
| if (envValue) { | ||
| return envValue.split(",").map((o) => o.trim()); |
Owner
Author
There was a problem hiding this comment.
suggestion (blocking): This needs documentation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #580
Summary
This PR adds support for configuring a custom paste service URL, enabling self-hosted deployments to use their own paste service instead of the default hosted instance.
Key Changes
getPasteApiUrl()function in the OpenCode plugin that reads from thePLANNOTATOR_PASTE_URLenvironment variableCommandDepsinterface to include the newgetPasteApiUrldependencypasteApiUrlthrough all command handlers (handleAnnotateCommand,handleAnnotateLastCommand,handleArchiveCommand) and the review server initializationshareBaseUrlprop for the demo link, with fallback to the default hosted URLPLANNOTATOR_PASTE_URLenvironment variablewrangler.toml) with comments explaining CORS configuration for self-hosterspaste-service/core/cors.tswith guidance for self-hosted deploymentspasteApiUrlconfigurationImplementation Details
undefined, allowing the UI to use its own default (https://plannotator-paste.plannotator.workers.dev)PLANNOTATOR_SHARE_URLfor consistency