Current behavior
src/shared/config.js and extension/options/options.html already have a developer-facing "Environment" + "API base URL" setting, but it's more limited than it looks:
DEFAULT_API_URLS only knows about development (http://localhost:3000) and production (the hosted Render URL) - see src/shared/config.js:1-4.
getApiBaseUrl() (src/shared/config.js:21-46) actively resets a non-localhost, non-legacy URL back to the hosted default whenever environment is production (config.js:38-42). In practice, a contributor typing a self-hosted URL into "Production" mode gets silently overridden.
manifest.json hardcodes host_permissions (extension/manifest.json:34-37) and the CSP connect-src (extension/manifest.json:39) to just the hosted URL and localhost:3000. Even if the config layer allowed a custom URL, the browser would block the request - Manifest V3 host permissions and CSP connect-src are fixed at install/build time and can't be changed by a runtime setting.
This is a discussion issue before implementation
Manifest V3's optional_host_permissions lets an extension request additional host access at runtime via chrome.permissions.request(), prompting the user - that's the realistic path here, not editing host_permissions directly per install.
Please define, before implementing:
- Whether self-hosting is opt-in via
optional_host_permissions (user grants access to their own host explicitly) rather than broadening the default host_permissions
- How the options page collects and validates a custom host (scheme required, no wildcards beyond what's needed)
- What happens to the CSP
connect-src - it may need to become more permissive in a scoped way, or the request needs to go through a background-script relay
- How this interacts with the existing
environment field, since today "production" actively fights a custom URL
Relevant files
src/shared/config.js
extension/options/options.html, extension/options/options.js
extension/manifest.json (permissions, host_permissions, content_security_policy)
docs/architecture.md ("no content scripts... Permissions are storage plus host access")
Non-goals
- Do not widen
host_permissions to <all_urls> or a broad wildcard - that changes the extension's review/trust profile for every user, including the default hosted setup.
Current behavior
src/shared/config.jsandextension/options/options.htmlalready have a developer-facing "Environment" + "API base URL" setting, but it's more limited than it looks:DEFAULT_API_URLSonly knows aboutdevelopment(http://localhost:3000) andproduction(the hosted Render URL) - seesrc/shared/config.js:1-4.getApiBaseUrl()(src/shared/config.js:21-46) actively resets a non-localhost, non-legacy URL back to the hosted default wheneverenvironmentisproduction(config.js:38-42). In practice, a contributor typing a self-hosted URL into "Production" mode gets silently overridden.manifest.jsonhardcodeshost_permissions(extension/manifest.json:34-37) and the CSPconnect-src(extension/manifest.json:39) to just the hosted URL andlocalhost:3000. Even if the config layer allowed a custom URL, the browser would block the request - Manifest V3 host permissions and CSPconnect-srcare fixed at install/build time and can't be changed by a runtime setting.This is a discussion issue before implementation
Manifest V3's
optional_host_permissionslets an extension request additional host access at runtime viachrome.permissions.request(), prompting the user - that's the realistic path here, not editinghost_permissionsdirectly per install.Please define, before implementing:
optional_host_permissions(user grants access to their own host explicitly) rather than broadening the defaulthost_permissionsconnect-src- it may need to become more permissive in a scoped way, or the request needs to go through a background-script relayenvironmentfield, since today "production" actively fights a custom URLRelevant files
src/shared/config.jsextension/options/options.html,extension/options/options.jsextension/manifest.json(permissions,host_permissions,content_security_policy)docs/architecture.md("no content scripts... Permissions are storage plus host access")Non-goals
host_permissionsto<all_urls>or a broad wildcard - that changes the extension's review/trust profile for every user, including the default hosted setup.