Repository navigation
FeedCourier v0.3.0
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-timeon_renderhooks (and reservedon_ingest/on_deliveredhook contracts for future releases), non-destructiveRenderOverrides(content_html,primary_link,warnings), per-route plugin configuration stored inRouteOptions.plugins, and SQLite tablesplugins,plugin_instances(ChaCha20-Poly1305 encrypted), andplugin_link_cache(automatically pruned after 90 days of inactivity). - Added
/api/v1/plugins,/api/v1/plugins/{id},/api/v1/plugins/{id}/instances*(with single-transaction409 Conflictroute-reference delete protection, live connectivity tests, automatic cache clearing onapi_urlchange, 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 compiledsrc/plugins/market_snapshot.jsonfallback,PLUGIN_INDEX_URLoverride, and stricthttp(s)://validation onhomepage/repositorylinks). - Scaffolded the independent
ElleryHe/FeedCourier-Pluginsregistry repository (schema/manifest.schema.json,registry/link-rewrite.json, zero-dependency Node.js 24 validator/index builder, and GitHub Actions workflows validatingregistry/**,schema/**, and rootindex.jsonwith--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).
- Introduced FeedCourier Plugin Protocol v1 (
- 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)), andpasswordauthentication modes, duplicate-URL (code: "error:url") handling,exclude_domains(*.example.comwildcard matching with trailing-dot normalization + automatic provider self-host skip),pass_title, fail-closeduse_proxy, andstrict_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 KiBresponse limit, and SQLite short-link caching (plugin_link_cache). Uses an HTML5 attribute state machine (skipping<script>and<style>blocks, preserving trailing/on unquotedhref) to rewrite only HTTP/HTTPS<a href>and primary links—preserving all mediasrcURLs, Telegramlink_preview_options.url, SMTP compliance links, and Notion's originalLinkcolumn.
- Added built-in YOURLS link rewriting supporting multiple encrypted provider instances,
- 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-recipientMessage-ID, 1-second inter-recipient delay with lease renewal, andsent_recipientscheckpoint resume; quota ledger continues counting 1 per article task). Destinationtestand feed previewdebug_pushstrictly deliver only toverifiedrecipients via isolated single-To:envelopes with compliance headers (returning an error when 0 verified recipients exist), while account-leveltest(withoutdestination_id) sends a self-test email only tofrom_address. - Added
smtp_recipients(keyed by HKDF-derivedaddress_hmacwith 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 withRetry-Afterheader and WebUI countdown), optional/v/{token}confirmation links whenPUBLIC_URLis 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.10or recipient-unknown550/551/553markbounced, while auth/quota/content 5xx abort without harming verified subscribers), andauto_pausedautomatic recovery (when all recipients unsubscribe or hard-bounce, destinations transition toenabled = false, auto_paused = trueand automatically resume upon re-verification while manually disabled destinations remain paused). - Added
PUBLIC_URL(environment variable or WebUI Settings),TRUST_PROXY(defaultfalse), optional CAN-SPAMsender_identityon 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 public404and relativeaction=""forms for subpath compatibility). - Added automatic pre-v0.3.0 online
VACUUM INTOsnapshot backup (<DATA_DIR>/pre-v0.3.0-backup.db) before migration0003whenever 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 bysystem_settings.smtp_recipient_model_version = 1).
- Switched outbox SMTP delivery to individual per-recipient envelopes (single
- MCP
list_plugins& Route Plugin Configuration (src/mcp/tools.rs):- Expanded
/mcpto 10 tools by addingreadonlysecret-freelist_plugins(exposing only plugin/provider IDs, names, hooks, and enabled status), and addedpluginssupport toconfigure_routeandlist_feeds_status.
- Expanded
- 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_ALLOWLISTguide, Protocol v1 development reference, and Nginx/Caddy reverse-proxy examples exposing only/u/and/v/.
- Added the Plugins / 插件 documentation section with a build-time VitePress marketplace loader (
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 toheading_offset = 3(h1→h4,h2→h5,h3+→h6), compacted<footer>timestamps toYYYY-MM-DD HH:MMin the route timezone (SMTP emails retain explicit(UTC±HH:MM)offsets), and automatically degraded content/entity400 Bad Requesterrors once toCompactCard. - Compact Card: Redesigned into an editorial card layout — bold title at top,
<blockquote>summary (auto-upgrading to collapsible<blockquote expandable>above300UTF-16 units, cleanly grapheme-cluster / word-boundary truncated at<= 800units 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 likeREADME.md/sku.gowhile preserving inlinehttp(s)://URLs, email addresses, and bare domains likenotion.so), bottom italicSource · Author · YYYY-MM-DD HH:MMmetadata, and a native inline URL button (reply_markup) matching Rich Message while keepinghttp(s)://-validatedlink_preview_options.urlon the original canonical URL.
- Rich Message: Demoted article titles one notch further to plain-foreground
- 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 returns409 Conflictlistingreferencing_routes, requiring explicit?cascade=trueto 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/): Enablinguse_proxy: trueon any feed, HTTP channel, preview, or plugin without a configured globalOUTBOUND_PROXYnow 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-dbnow provisions an optionalShort URL(url) property alongside the 7 existing columns (NotionColumnMapping::standard_8_column(), whileNotionColumnMapping::default()leavesshort_url: Nonefor backward compatibility with existing 7-column databases) so Notion destinations preserve the original article permalink inLinkwhile recording shortened URLs from route plugins inShort URLwhen mapped (inspect-schemadetects and optionally patches it).
Security
- Zero-PII HKDF/HMAC Public Compliance Tokens,
TRUST_PROXYRate 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) withstd::hint::black_boxconstant-time validation, keptGET /u/{token}andGET /v/{token}strictly read-only against mail-scanner prefetch, and masked recipient emails acrossdiagnostic_log,bounce_diagnostic, and default SMTP destination names. - Enforced
ConnectInfo<SocketAddr>client IP extraction by default (TRUST_PROXY=false, readingX-Real-IPor rightmost proxy-appendedX-Forwarded-Foronly whenTRUST_PROXY=true) with an8,192-bucket hard cap (30 req / 60s),4 KiBrequest body limit,X-Robots-Tag: noindex, nofollow, strict CSP,Referrer-Policy: no-referrer, andCache-Control: no-store. - Enabled strict
minijinja::AutoEscape::Htmlon"email.html"templates so all untrusted metadata is uniformly HTML-escaped while onlyammonia-sanitized body HTML passes through| safe.
- Derived domain-separated HKDF-SHA256 subkeys (
- 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) throughProtectedHttpClientwith connect-timeSsrfDnsResolver,SSRF_ALLOWLISTenforcement, and fail-closeduse_proxy, restricted marketplacehomepage/repositorylinks tohttp(s)://, encrypted provider configs at rest with ChaCha20-Poly1305, masked secrets in/api/v1/plugins*, and omitted all credentials/URLs from MCPlist_plugins.
Fixed
- Pre-DDL Backup Sidecar Hygiene (
src/db/mod.rs): Verified both target.dband companion-wal/-shmsidecar non-existence beforeVACUUM 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_idTransactional Auto-Writeback (src/channels/notion.rs,src/db/repo.rs): Re-read and updatedchannel_destinations.encrypted_configinside a singlewrite_pooltransaction after404 object_not_foundfallback resolution so subsequent deliveries avoid extra 404 round-trips without overwriting concurrentcolumn_mappingedits. - 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©=2/®=us), and normalized SMTP percentage image widths so fractional percentages remain in inline CSS (style="width:33.3%;...") while HTMLwidthcarries the592px-scaled integer pixel equivalent (width="197"),0%stays0, and positive sub-1% widths clamp to1%. - 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