Skip to content

show terms linked on GitHub, to register and receive names - #22

Merged
brenzi merged 4 commits into
simplex-chat:simplexfrom
brenzi-agent:ab/terms-links-github
Nov 21, 2026
Merged

brenzi merged 4 commits into
simplex-chat:simplexfrom
brenzi-agent:ab/terms-links-github

Conversation

@brenzi-agent

@brenzi-agent brenzi-agent commented Nov 20, 2026 •

Copy link
Copy Markdown

The .simplex v2 deployment sets the name policy's terms to GitHub raw links of one file at one commit with its sha256:

https://raw.githubusercontent.com/simplex-chat/simplex-chat/<40-hex commit>/<path>.md#sha256=<64-hex>

On simplex, parseTermsLink returns a parsed link only for git.simplex.chat commit links and loopback links (useNameTerms.ts#L15-L34). For a GitHub link it returns nothing, so no text is fetched and no hash is accepted:

The v1 name policy that the production build reads (0xf7054e2f…b823) links both kinds to https://git.simplex.chat/simplex-chat/simplex-chat/raw/commit/d94981224a366a433f2d42388effff720419f9fd/docs/NAMES-CONDITIONS.md#sha256=620f9e9b… (generalTermsLink() and communityTermsLink(), read on 2026-11-20), so that form remains accepted beside the new one. The webstore and the store service already accept both hosts (simplex-chat/simplex.domains names, webapp/src/api.ts, termsLink and readerUrl; simplex-chat/simplex-chat names, StoreService/Names/Contracts.hs, termsLinkParts).

Parser — src/hooks/useNameTerms.ts

  • TERMS_LINK also matches https://raw.githubusercontent.com/simplex-chat/simplex-chat/<40 lower-case hex>/<path>.md#sha256=<64 lower-case hex>; the path rules and the required sha256 are unchanged.
  • The text is fetched from raw.githubusercontent.com at the link's commit: for a git.simplex.chat link as before, for a GitHub link from the link without its fragment.
  • The reader page: https://git.simplex.chat/simplex-chat/simplex-chat/src/commit/<commit>/<path> for a git.simplex.chat link, as before; https://github.com/simplex-chat/simplex-chat/blob/<commit>/<path> for a GitHub link, as the webstore maps it.

What users and admins see

  • Registration and claim show the text of terms linked on GitHub, and they can be accepted; the admin page shows that text and sends a GitHub link.
  • src/components/NameTerms.tsx: the link under the terms reads "View this version", without a host.
  • src/pages/admin.tsx: the placeholder shows the GitHub form; the description names the raw link at a full commit hash on either host.

Tests

  • src/hooks/useNameTerms.test.ts: a GitHub link read with its text URL and GitHub page; refused: a github.com page, a branch, an abbreviated commit, an upper-case commit, another repository, a fork.
  • src/__tests__/pages/admin.test.tsx: the general terms setter sends a GitHub link; both setters share TermsSettings.

Checks (fork CI)

Merge with #19: #19 changes other lines of NameTerms.tsx, useNameTerms.ts, useNameTerms.test.ts and admin.tsx; a trial merge of its head 4f1f9b7 into this branch completes without conflicts. With #19 merged first, holders can also renew under GitHub terms, and the title reads "show terms linked on GitHub, to register, receive and renew names".

The dApp is deployed from production, so users get this change when production is moved past its merge.

@brenzi
brenzi marked this pull request as ready for review November 21, 2026 08:04
@brenzi
brenzi merged commit e8032ae into simplex-chat:simplex Nov 21, 2026
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.

2 participants