Skip to content

Tip links: Patreon, Ko-fi and the like on people and products - #62

Merged
vijayakrishnans merged 1 commit into
mainfrom
feat/tip-links
Dec 3, 2026
Merged

vijayakrishnans merged 1 commit into
mainfrom
feat/tip-links

Conversation

@vijayakrishnans

Copy link
Copy Markdown
Collaborator

What

People and products can show where to support them.

  • People: a Tip links box in Settings, shown on /@handle under the other links.
  • Products: a Tip links box in Studio → Edit details, shown in the product's header card under Where it runs.

Each link is a soft pill with a heart and a name. It opens in a new tab with rel="noopener noreferrer nofollow ugc".

The rule: the platform comes from the address

The owner chose "known platforms plus one other". You paste addresses, one per line, and the platform is read from the host, never typed. A "Patreon" button can therefore only lead to patreon.com, the same reasoning as githubUrl's github.com allowlist.

Platform Accepted address
Patreon patreon.com/…
Ko-fi ko-fi.com/…
Buy Me a Coffee buymeacoffee.com/…
GitHub Sponsors github.com/sponsors/… only
Open Collective opencollective.com/…
Liberapay liberapay.com/…
PayPal paypal.me/…, or paypal.com/paypalme/… and /donate
one other any https address, labelled with its own host
  • One link per platform, and one other link.
  • https only, at most 200 characters, no user name or password in the address.
  • A platform's bare home page is refused.
  • Look-alike hosts (patreon.com.evil.example) and other GitHub or PayPal pages count as "other" and show their real host.
  • Every read re-checks stored rows with tipLinksOf, so a row can never show a platform name its address doesn't earn.

Changes

  • Migration 2330: contributors.tip_links and profiles.tip_links, JSONB, [] by default. Additive and idempotent.
  • Contracts: new tip-links.ts. tipLinks is added to PublicContributor / PUBLIC_CONTRIBUTOR_KEYS, PublicProfile / PUBLIC_PROFILE_KEYS, MaintainerProfile, UpdateProfileRequest, ContributorProfile and CatalogProduct / CATALOG_PRODUCT_KEYS. Catalog API 1.8.0, with a changelog entry and an OpenAPI description. Disclosure lines are added for both.
  • Core: PUT /me and the profile PATCH take tipLinks (addresses), replaced whole. Leaving it out keeps the links and [] clears them; a bad list returns 422 with the parser's sentence. The maintainer, public and catalog projections carry the links.
  • Web: ui/tip-links.tsx, the Settings box, the Studio Edit details box and the actions route (sent only when the box is on the form), plus the people and product pages.

Not in this PR

The MCP tools (update_my_profile, update_listing) don't take tipLinks yet. Agents can read the links through the catalog API but can't write them.

Tests

  • packages/contracts/src/tip-links.test.ts: platforms, look-alikes, every refusal, the form text round trip, and the stored-row re-check.
  • packages/db/src/pg/tip-links.test.ts (real Postgres): both columns are written, kept by a write that doesn't name them, cleared, and read by the public contributor read.
  • tests/core/src/tip-links.test.ts and product-posts.test.ts: both writes, including what gets refused. contributor-profile.test.ts checks that a stored "patreon" row on another host is projected as other.
  • tests/web/src/tip-links.test.ts: forms, buttons and the save plan.
  • All suites pass: contracts 1325, core 1157, web 2143, gateway 546, db pg 644 + 3. Every package typechecks and web lint is clean. Run all at once, four db tests time out on this machine; each passes when run alone, and they don't touch this change.

Security (OWASP)

  • A01 / phishing: a button's name comes only from a host allowlist. An unknown link shows its real host. User names and passwords in addresses are refused.
  • A03 / XSS: https only (javascript: is refused), rendered as React href text, and the stored JSON is re-validated on every read.
  • A05: links open with noopener noreferrer, plus nofollow ugc because strangers write them. Nothing on openproduct is paid for or ranked through them.
  • A04: at most 8 links of 200 characters each; the form box is capped at 2000 characters.

🤖 Generated with Claude Code

A person adds tip links in Settings, a crew adds a product's in Edit
details, and each shows as a row of buttons: on /@handle, and in the
product's header card.

The platform is read from the address, never typed, so a "Patreon" button
can only lead to patreon.com: Patreon, Ko-fi, Buy Me a Coffee, GitHub
Sponsors, Open Collective, Liberapay and PayPal.me, one each, plus one
other https address, which shows its own host.

- migration 2330: contributors.tip_links and profiles.tip_links (JSONB,
  empty by default)
- contracts: tip-links.ts (platforms, parseTipLinks, tipLinksOf);
  PublicContributor, PublicProfile and the catalog API (1.8.0) carry
  tipLinks; disclosure lines for both
- core: PUT /me and the profile PATCH take tipLinks, replaced whole; every
  read re-checks stored rows by today's rules
- web: a Tip links box in Settings and in Edit details; the TipLinks
  buttons (new tab, rel noopener noreferrer nofollow ugc)
- tests: parser, both writes, the public projection, a live-pg round trip,
  and the forms

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vijayakrishnans
vijayakrishnans merged commit 507e37a into main Dec 3, 2026
19 checks passed
@vijayakrishnans
vijayakrishnans deleted the feat/tip-links branch December 3, 2026 10:58
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