Skip to content

FeedCourier v0.3.0

Choose a tag to compare

@github-actions github-actions released this 23 Nov 18:10
abbcfdf

Added

  • Built-In Plugin Framework (Protocol v1) & Marketplace (src/plugins/, migrations/0003_plugins_and_smtp_compliance.sql, ElleryHe/FeedCourier-Plugins):
    • Introduced FeedCourier Plugin Protocol v1 (api_version: "1") with delivery-time on_render hooks (and reserved on_ingest / on_delivered hook contracts for future releases), non-destructive RenderOverrides (content_html, primary_link, warnings), per-route plugin configuration stored in RouteOptions.plugins, and SQLite tables plugins, plugin_instances (ChaCha20-Poly1305 encrypted), and plugin_link_cache (automatically pruned after 90 days of inactivity).
    • Added /api/v1/plugins, /api/v1/plugins/{id}, /api/v1/plugins/{id}/instances* (with single-transaction 409 Conflict route-reference delete protection, live connectivity tests, automatic cache clearing on api_url change, and per-provider cache controls), and /api/v1/plugins/market (SSRF-guarded remote index loader with 6-hour remote cache, 60-second negative cache on compiled src/plugins/market_snapshot.json fallback, PLUGIN_INDEX_URL override, and strict http(s):// validation on homepage/repository links).
    • Scaffolded the independent ElleryHe/FeedCourier-Plugins registry repository (schema/manifest.schema.json, registry/link-rewrite.json, zero-dependency Node.js 24 validator/index builder, and GitHub Actions workflows validating registry/**, schema/**, and root index.json with --check --verify-index).
    • Added the WebUI Plugins console (Installed + Marketplace tabs, bespoke YOURLS form plus a generic instance_schema-driven dynamic provider form renderer for non-YOURLS plugins, provider CRUD/test/cache controls, schema-driven collapsible route plugin options, optional plugin selector in the Feed Preview Debug Push bar, route card plugin badges, and amber partial-rewrite warnings in the Outbox view).
  • First-Party Link Rewrite (YOURLS) Plugin (src/plugins/link_rewrite.rs):
    • Added built-in YOURLS link rewriting supporting multiple encrypted provider instances, signature (recommended), timed_signature (md5(timestamp + token)), and password authentication modes, duplicate-URL (code: "error:url") handling, exclude_domains (*.example.com wildcard matching with trailing-dot normalization + automatic provider self-host skip), pass_title, fail-closed use_proxy, and strict_mode (whole-task retry on failure vs. default per-URL graceful degradation with task warnings).
    • Enforced a 50-uncached-URL per-article cap (after batch IN (...) cache lookup), 4-way concurrency, 5-second per-URL timeout, 64 KiB response limit, and SQLite short-link caching (plugin_link_cache). Uses an HTML5 attribute state machine (skipping <script> and <style> blocks, preserving trailing / on unquoted href) to rewrite only HTTP/HTTPS <a href> and primary links—preserving all media src URLs, Telegram link_preview_options.url, SMTP compliance links, and Notion's original Link column.
  • SMTP Per-Recipient Compliance, Double Opt-In & RFC 8058 One-Click Unsubscribe (src/channels/smtp.rs, src/api/public.rs, src/crypto.rs):
    • Switched outbox SMTP delivery to individual per-recipient envelopes (single To: address, deterministic per-recipient Message-ID, 1-second inter-recipient delay with lease renewal, and sent_recipients checkpoint resume; quota ledger continues counting 1 per article task). Destination test and feed preview debug_push strictly deliver only to verified recipients via isolated single-To: envelopes with compliance headers (returning an error when 0 verified recipients exist), while account-level test (without destination_id) sends a self-test email only to from_address.
    • Added smtp_recipients (keyed by HKDF-derived address_hmac with zero plaintext emails stored in table), channel_destinations.auto_paused, and /api/v1/destinations/{id}/recipients* endpoints for manual-trigger double opt-in verification: 6-digit SHA-256 hashed codes (30-minute TTL, max 5 attempts that atomically clear the active code and invalidate /v/{token}, atomic write-pool 60-second resend cooldown and 5/hour cap with Retry-After header and WebUI countdown), optional /v/{token} confirmation links when PUBLIC_URL is configured, immediate wakeup of deferred tasks upon verification, administrator unsubscribe/reactivate controls, recipient-only 5xx hard-bounce classification (5.1.1/5.1.2/5.1.3/5.1.6/5.1.10 or recipient-unknown 550/551/553 mark bounced, while auth/quota/content 5xx abort without harming verified subscribers), and auto_paused automatic recovery (when all recipients unsubscribe or hard-bounce, destinations transition to enabled = false, auto_paused = true and automatically resume upon re-verification while manually disabled destinations remain paused).
    • Added PUBLIC_URL (environment variable or WebUI Settings), TRUST_PROXY (default false), optional CAN-SPAM sender_identity on SMTP accounts, RFC 8058 headers (List-Unsubscribe, List-Unsubscribe-Post: List-Unsubscribe=One-Click, List-Id: <dest-{id}.{from_domain}>, Auto-Submitted: auto-generated), and unauthenticated /u/{token} & /v/{token} endpoints registered before SPA fallback (with bare /u/ & /v/ returning public 404 and relative action="" forms for subpath compatibility).
    • Added automatic pre-v0.3.0 online VACUUM INTO snapshot backup (<DATA_DIR>/pre-v0.3.0-backup.db) before migration 0003 whenever any business table (feeds, channels, channel_destinations) is non-empty (cleaning up partial backups/sidecars on failure), plus idempotent startup backfill (backfill_legacy_smtp_recipients, status = 'verified', consent_method = 'legacy', marked by system_settings.smtp_recipient_model_version = 1).
  • MCP list_plugins & Route Plugin Configuration (src/mcp/tools.rs):
    • Expanded /mcp to 10 tools by adding readonly secret-free list_plugins (exposing only plugin/provider IDs, names, hooks, and enabled status), and added plugins support to configure_route and list_feeds_status.
  • Bilingual Plugins & SMTP Compliance Documentation (docs/):
    • Added the Plugins / 插件 documentation section with a build-time VitePress marketplace loader (docs/.vitepress/plugins.data.ts, remote fetch with snapshot fallback), YOURLS setup & SSRF_ALLOWLIST guide, Protocol v1 development reference, and Nginx/Caddy reverse-proxy examples exposing only /u/ and /v/.

Changed

  • Telegram Rich Message & Compact Card Typography Polish (src/channels/telegram.rs):
    • Rich Message: Demoted article titles one notch further to plain-foreground <h3> (removing full-title hyperlink blue in favor of the bottom "Read original" pill button), raised body heading offset to heading_offset = 3 (h1→h4, h2→h5, h3+→h6), compacted <footer> timestamps to YYYY-MM-DD HH:MM in the route timezone (SMTP emails retain explicit (UTC±HH:MM) offsets), and automatically degraded content/entity 400 Bad Request errors once to CompactCard.
    • Compact Card: Redesigned into an editorial card layout — bold title at top, <blockquote> summary (auto-upgrading to collapsible <blockquote expandable> above 300 UTF-16 units, cleanly grapheme-cluster / word-boundary truncated at <= 800 units with smooth entity-expansion budget backoff, omitting duplicate title summaries, and inserting invisible zero-width non-joiners to stop false-positive blue highlights on /commands, @scoped/packages, and explicit filenames like README.md / sku.go while preserving inline http(s):// URLs, email addresses, and bare domains like notion.so), bottom italic Source · Author · YYYY-MM-DD HH:MM metadata, and a native inline URL button (reply_markup) matching Rich Message while keeping http(s)://-validated link_preview_options.url on the original canonical URL.
  • Account & Destination Delete Reference Guard (DELETE /api/v1/channels/{id}, DELETE /api/v1/destinations/{id}): Deleting a channel account or destination still referenced by one or more routes now atomically returns 409 Conflict listing referencing_routes, requiring explicit ?cascade=true to cascade-delete it together with its referencing routes.
  • Fail-Closed use_proxy & Direct TCP/TLS SMTP Clarification (src/net/mod.rs, src/channels/smtp.rs, web/): Enabling use_proxy: true on any feed, HTTP channel, preview, or plugin without a configured global OUTBOUND_PROXY now fails closed with an explicit error instead of silently leaking the host's direct egress IP. Clarified that SMTP accounts connect over native TCP/TLS directly (HTTP/SOCKS outbound proxies do not apply) and hid the SMTP proxy toggle in the WebUI.
  • Notion 8-Column Standard Schema (Short URL): POST /api/v1/channels/notion/init-db now provisions an optional Short URL (url) property alongside the 7 existing columns (NotionColumnMapping::standard_8_column(), while NotionColumnMapping::default() leaves short_url: None for backward compatibility with existing 7-column databases) so Notion destinations preserve the original article permalink in Link while recording shortened URLs from route plugins in Short URL when mapped (inspect-schema detects and optionally patches it).

Security

  • Zero-PII HKDF/HMAC Public Compliance Tokens, TRUST_PROXY Rate Limiting & Strict Email Auto-Escaping (src/crypto.rs, src/api/public.rs, src/channels/smtp.rs):
    • Derived domain-separated HKDF-SHA256 subkeys (fc-smtp-addr-v1, fc-unsub-v1, fc-verify-v1) with std::hint::black_box constant-time validation, kept GET /u/{token} and GET /v/{token} strictly read-only against mail-scanner prefetch, and masked recipient emails across diagnostic_log, bounce_diagnostic, and default SMTP destination names.
    • Enforced ConnectInfo<SocketAddr> client IP extraction by default (TRUST_PROXY=false, reading X-Real-IP or rightmost proxy-appended X-Forwarded-For only when TRUST_PROXY=true) with an 8,192-bucket hard cap (30 req / 60s), 4 KiB request body limit, X-Robots-Tag: noindex, nofollow, strict CSP, Referrer-Policy: no-referrer, and Cache-Control: no-store.
    • Enabled strict minijinja::AutoEscape::Html on "email.html" templates so all untrusted metadata is uniformly HTML-escaped while only ammonia-sanitized body HTML passes through | safe.
  • Plugin SSRF, Fail-Closed Proxy, URL Validation & Secret Isolation (src/plugins/): Routed all plugin API calls (YOURLS) and remote marketplace index fetches (PLUGIN_INDEX_URL) through ProtectedHttpClient with connect-time SsrfDnsResolver, SSRF_ALLOWLIST enforcement, and fail-closed use_proxy, restricted marketplace homepage/repository links to http(s)://, encrypted provider configs at rest with ChaCha20-Poly1305, masked secrets in /api/v1/plugins*, and omitted all credentials/URLs from MCP list_plugins.

Fixed

  • Pre-DDL Backup Sidecar Hygiene (src/db/mod.rs): Verified both target .db and companion -wal/-shm sidecar non-existence before VACUUM INTO (appending collision suffixes when needed) and cleaned up residual sidecars (and partial backup files on failure) after backup completion.
  • Notion database_id → data_source_id Transactional Auto-Writeback (src/channels/notion.rs, src/db/repo.rs): Re-read and updated channel_destinations.encrypted_config inside a single write_pool transaction after 404 object_not_found fallback resolution so subsequent deliveries avoid extra 404 round-trips without overwriting concurrent column_mapping edits.
  • Semicolon-Aware HTML5 Entity Decoding & Responsive Percentage Image Widths (src/ingest/html.rs, src/channels/smtp.rs): Upgraded HTML attribute decoding to single-pass semicolon-aware HTML5 decoding (preserving unescaped query parameters such as &copy=2 / &reg=us), and normalized SMTP percentage image widths so fractional percentages remain in inline CSS (style="width:33.3%;...") while HTML width carries the 592px-scaled integer pixel equivalent (width="197"), 0% stays 0, and positive sub-1% widths clamp to 1%.
  • Bilingual Release Pipeline Documentation Parity (docs/zh/reference/releasing.md): Aligned the Chinese Mermaid release workflow diagram with the English reference.

What's Changed

Maintenance & Dependencies

  • release: v0.3.0 — plugin framework, YOURLS link rewrite, SMTP compliance, and Telegram polish by @ElleryHe in #24

Full Changelog: v0.2.0...v0.3.0