Skip to content

fix(plugins): get the plugin host ready for plugins.surfsense.com - #2249

Merged
MODSetter merged 5 commits into
devfrom
fix/plugins-launch-prep
Oct 14, 2026
Merged

MODSetter merged 5 commits into
devfrom
fix/plugins-launch-prep

Conversation

@MODSetter

@MODSetter MODSetter commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Gets the plugin host ready to deploy at plugins.surfsense.com for 2.2.1.

What changes

The license check reaches production's Keygen. keygen.py had Keygen Cloud's address and an empty account id hard-coded, so the host could not start with any paid plugin, and it could not reach the self-hosted Keygen CE that holds the licenses. It now reads the backend's own settings, with the same names and meanings, so the deployment gives both the same values:

Setting Production
KEYGEN_API_URL http://keygen-web:3000/v1/accounts (Keygen Cloud's when unset)
KEYGEN_ACCOUNT_ID the backend's value; the host does not start without it
KEYGEN_HOST keygen.internal, sent as Host with X-Forwarded-Proto: https

A 4xx or a redirect from Keygen now refuses the key as 403 invalid, with a warning in the log, instead of failing the request with a 500. A reply with no code counts as Keygen being unreachable, so the 24-hour grace still applies.

Credentials never reach the logs. Scrapling logs a failed proxy as Proxy 'http://user:password@gw.dataimpulse.com:823' failed. python -m host now redacts every log record as it is made: message, arguments and traceback. That covers URL userinfo, the captcha solvers' user:password@host:port form, and password / solver key fields. A local run against the live sites wrote 8 such lines before this change.

Reddit and Instagram are left out of the app's first-party list. Testing the plugins against the live sites on 2026-10-13 found:

  • Reddit now answers 403 ("blocked by network security") to every anonymous .json request, even from inside the warmed browser.
  • Instagram's profile endpoint is behind a login for everyone.

The code stays. The list offers the other eight, .env.example's PLUGINS names those eight for the deployment, and the backend tests that used Reddit as their sample SurfSense plugin use Amazon now.

DeepWiki is listed as Community. The entry was verified without a domain, so registry_check static failed. That broke the registry PR check and stopped the sign job before it signed anything. No ownership proof exists: the MCP Registry has no DeepWiki listing, and Cognition publishes no SurfSense file or DNS record. So by the registry's rule it is community.

Tests

Run locally on Windows:

  • Plugin host: tests/ plus every test_<plugin>_plugin.py gave 114 passed and 2 skipped (Redis). License check and redaction: 30 passed. ruff check .. and ruff format --check .. are clean.
  • Registry check: static check: passed, and 76 passed. 2 test_icon_check cases error on Windows only, because their test id is longer than an environment variable can hold. They run on Linux CI.
  • Backend: the plugin unit, route and gateway tests, migration 0028, and the agent+plugin tests through a real staged opencode give 170 passed. CI skips the agent+plugin tests because it doesn't stage opencode, so this local run is the only one. tests/packaging/test_spec_data_files.py gave 7 passed, and ruff is clean.

Not in this PR

  • Deploying the host and the registry on Coolify, the plugins.surfsense.com DNS record (GoDaddy), and the REGISTRY_SIGNING_KEY secret.
  • The data-quality bugs the live test found in YouTube, Amazon, Walmart, Google Maps, Google Search and Web Crawl, and TikTok's intermittent user_search.

High-level PR Summary

This PR prepares the plugin host for production deployment at plugins.surfsense.com for version 2.2.1. It fixes the license check to reach the production Keygen instance by reading settings from the environment (matching the backend's configuration), adds credential redaction to prevent passwords and API keys from appearing in logs, removes Reddit and Instagram from the first-party plugin list due to anonymous access issues, and corrects the DeepWiki registry entry from verified to community status.

⏱️ Estimated Review Time: 30-90 minutes

💡 Review Order Suggestion
Order File Path
1 plugins/remote/host/.env.example
2 plugins/remote/proprietary/license_check/keygen.py
3 plugins/remote/host/redacted_logs.py
4 plugins/remote/host/__main__.py
5 plugins/remote/proprietary/license_check/tests/stand_in_keygen.py
6 plugins/remote/proprietary/license_check/tests/test_license_access.py
7 plugins/remote/host/tests/test_redacted_logs.py
8 plugins/remote/proprietary/license_check/tests/sample_plugins/proprietary/paid/server.py
9 surfsense_local/backend/modules/plugins/lists/first_party/plugins.json
10 plugins/registry/plugins.json
11 docs/architecture/plugin-host.md
12 docs/architecture/plugins.md
13 plugins/remote/proprietary/reddit/tests/test_reddit_plugin.py
14 plugins/remote/proprietary/instagram/tests/test_instagram_plugin.py
15 plugins/remote/proprietary/youtube/tests/test_youtube_plugin.py
16 plugins/remote/proprietary/tiktok/tests/test_tiktok_plugin.py
17 plugins/remote/proprietary/google_maps/tests/test_google_maps_plugin.py
18 plugins/remote/proprietary/google_search/tests/test_google_search_plugin.py
19 plugins/remote/proprietary/amazon/tests/test_amazon_plugin.py
20 plugins/remote/proprietary/walmart/tests/test_walmart_plugin.py
21 plugins/remote/proprietary/indeed/tests/test_indeed_plugin.py
22 plugins/remote/proprietary/web_crawl/tests/test_web_crawl_plugin.py
23 surfsense_local/backend/tests/integration/agent/test_plugin_tools.py
24 surfsense_local/backend/tests/integration/plugins/routes/test_first_party_plugins.py
25 surfsense_local/backend/tests/integration/plugins/routes/test_registry.py
26 surfsense_local/backend/tests/mcp_test_server.py
27 surfsense_local/backend/tests/unit/plugins/lists/test_first_party_list.py

Need help? Join our Discord

Summary by CodeRabbit

  • New Features
    • Plugin-host logs now redact credentials, API keys, and other sensitive values.
    • License validation supports configurable Keygen endpoints and host settings, with clearer handling of refusals and service outages.
  • Changes
    • Reddit and Instagram are no longer included in the first-party plugin list; both currently have access limitations.
    • DeepWiki is now listed as a community-verified plugin.
  • Documentation
    • Updated plugin setup and license configuration guidance, including the first-party plugin list and known access limitations.

…s the backend does

keygen.py held Keygen Cloud's address and an empty account id, so the host could
not start with a paid plugin, and could not reach the self-hosted Keygen CE that
holds production's licenses. It now reads KEYGEN_API_URL (the accounts endpoint,
Keygen Cloud's when unset), KEYGEN_ACCOUNT_ID and KEYGEN_HOST, with the backend's
names and meanings, so a deployment gives both the same values. With KEYGEN_HOST
set it sends Host and X-Forwarded-Proto: https, as CE needs.

A 4xx or a redirect from Keygen refuses the key as invalid, with a warning in the
log, instead of failing the request with a 500. A reply with no code is no
answer, so the 24-hour grace still applies.
…t makes

Scrapling logs a failed proxy with its user and password, so a deployed host
would write the proxy vendor's credentials into its logs. python -m host now
redacts each record as it is made, its message, arguments and traceback: a URL's
user:password@, the captcha solvers' user:password@host:port form, and a password
or a solver's key as a field.
…y list

Run against the live sites on 2026-10-13, Reddit refused every anonymous .json
request, even from inside the warmed browser, and Instagram's profile endpoint
asked for a login on every IP. Both plugins stay on the host; the app lists the
other eight. The tests that used Reddit as their sample SurfSense plugin use
Amazon now.
The entry was verified with no domain, so registry_check static failed, which
broke the registry's pull request check and stopped the sign job before it
signed. No ownership proof exists: the MCP Registry holds no DeepWiki listing
and Cognition publishes no SurfSense file or DNS record, so the registry's rule
makes it Community.
…eight listed plugins

plugin-host.md describes the Keygen settings and answers, log redaction and the
new tests, and replaces the empty-account-id gaps with Reddit's and Instagram's.
.env.example gains the KEYGEN_* settings and names the eight plugins in PLUGINS.
@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
surf-sense-frontend Ready Ready Preview Oct 14, 2026 3:37am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: MODSetter/SurfSense/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eca2123a-b1a9-4859-a636-75e17743f092
📥 Commits

Reviewing files that changed from the base of the PR and between a4a5d9a and ada244d.

📒 Files selected for processing: 27
  • docs/architecture/plugin-host.md
  • docs/architecture/plugins.md
  • plugins/registry/plugins.json
  • plugins/remote/host/.env.example
  • plugins/remote/host/__main__.py
  • plugins/remote/host/redacted_logs.py
  • plugins/remote/host/tests/test_redacted_logs.py
  • plugins/remote/proprietary/amazon/tests/test_amazon_plugin.py
  • plugins/remote/proprietary/google_maps/tests/test_google_maps_plugin.py
  • plugins/remote/proprietary/google_search/tests/test_google_search_plugin.py
  • plugins/remote/proprietary/indeed/tests/test_indeed_plugin.py
  • plugins/remote/proprietary/instagram/tests/test_instagram_plugin.py
  • plugins/remote/proprietary/license_check/keygen.py
  • plugins/remote/proprietary/license_check/tests/sample_plugins/proprietary/paid/server.py
  • plugins/remote/proprietary/license_check/tests/stand_in_keygen.py
  • plugins/remote/proprietary/license_check/tests/test_license_access.py
  • plugins/remote/proprietary/reddit/tests/test_reddit_plugin.py
  • plugins/remote/proprietary/tiktok/tests/test_tiktok_plugin.py
  • plugins/remote/proprietary/walmart/tests/test_walmart_plugin.py
  • plugins/remote/proprietary/web_crawl/tests/test_web_crawl_plugin.py
  • plugins/remote/proprietary/youtube/tests/test_youtube_plugin.py
  • surfsense_local/backend/modules/plugins/lists/first_party/plugins.json
  • surfsense_local/backend/tests/integration/agent/test_plugin_tools.py
  • surfsense_local/backend/tests/integration/plugins/routes/test_first_party_plugins.py
  • surfsense_local/backend/tests/integration/plugins/routes/test_registry.py
  • surfsense_local/backend/tests/mcp_test_server.py
  • surfsense_local/backend/tests/unit/plugins/lists/test_first_party_list.py
 __________________________________________________
< Making NVIDIA proud with all this bug detection. >
 --------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch was successfully deployed

1 active deployment
Preview — ada244d4 Deployed Oct 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant