Skip to content

Pages: a public link for a page, as a secret gist with a preview (P7b) - #47

Merged
YogiOnCode merged 1 commit into
mainfrom
pages/p7b-public-link
Nov 18, 2026
Merged

YogiOnCode merged 1 commit into
mainfrom
pages/p7b-public-link

Conversation

@YogiOnCode

Copy link
Copy Markdown
Owner

Stacked on #46 (base is pages/p7a-save-copy). Merge #43–#46 first.

Share (viewer bar and cards) gains Create public link…, and for a shared page Copy public link, Update public link and Remove public link….

  • Login: the user's gh login (github.com's token), else Git's saved one; never a prompt or window. Asked once, naming the account; Forget in Settings › Pages asks again.
  • Before it leaves the PC: a scan for secrets, local paths and internal hosts, listed by line, and a confirm that anyone with the link can view it (pictures aren't checked; an update keeps earlier versions in the gist's history).
  • The page is bundled (P7a) into a secret gist; the link is gist.githack.com/<owner>/<id>/raw/<file>, copied.
  • Pages view: Shared badge and filter; deleting a shared page asks to remove its link too.
  • Errors: no login / GitHub unreachable offer a saved copy; a refused login says how to sign in again; a link made with another account is left alone and named.

githack caching (measured)

The link works at once, but githack keeps serving its copy: an update hadn't shown after ~15 min, and deleted gists still served 20+ min later (GitHub's own raw link 404s at once). Per decision, githack stays and the Update/Remove messages say so plainly.

Security review

Reviewed by a separate agent before commit; all findings fixed:

  • gh/git started by full path from PATH's absolute folders, from Clayo's own folder (a repo can't plant gh.exe or a credential.helper).
  • Update/Remove only with the account that made the link (GitHub's 404 for another account's gist no longer reads as "gone" or orphans a gist).
  • Gist ids from shares.json must look like gist ids (no ../repos/… API paths); odd JSON types read as nothing.
  • gh auth token --hostname github.com (no Enterprise token to github.com).
  • Scan: escaped / forward-slash / UNC paths, Stripe, Google, JWT, Bearer, URL passwords; a match timeout; run off the UI thread.
  • CDN fetch size cap; <!-- escaped when inlining; clipboard and unexpected-answer errors shown, not crashing.

Tested

  • Checks: scan (each kind, no false hit on the templates, a slow line), shares file, id shape, PATH lookup, Shared filter, bundle escapes.
  • Live against GitHub with Clayo's code: create (240 KB dashboard served with its chart), update, delete, a deleted gist (404), a bad token (401). All test gists deleted.

To verify by hand

Share a page with a fake ghp_ token (flagged); Create → open in a private window; Update; Remove; Forget in Settings, then share again (asks again).

@YogiOnCode
YogiOnCode added this pull request to stack #51 November 18, 2026 20:58
@YogiOnCode
YogiOnCode force-pushed the pages/p7b-public-link branch 3 times, most recently from 9b0fe63 to 9596bb3 Compare November 18, 2026 21:07
Base automatically changed from pages/p7a-save-copy to main November 18, 2026 21:08
@YogiOnCode
YogiOnCode force-pushed the pages/p7b-public-link branch from 9596bb3 to 7177c6f Compare November 18, 2026 21:08
@YogiOnCode
YogiOnCode merged commit 2d8e3dd into main Nov 18, 2026
1 check passed
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