- JavaScript 90%
- HTML 8%
- Shell 2%
jsem (jsem.phosh.uk) #
Thảo's own blog, a personal project. Name and domain are both jsem, living on a subdomain of phosh.uk (no new domain). The cat (#cat symbol) is the brand. It is hers alone: no sign-ups, no accounts, and no registration wording anywhere on the site (she decided that; do not add it back).
Source: https://tangled.org/viet.shy.cat/jsem
Live at https://jsem.phosh.uk (Worker phosh-jsem, KV purrnal-blog (old name, same data), route jsem.phosh.uk/*).
worker.js: everything: public list + post pages + tag pages + RSS, admin editor, small safe markdown renderer, image upload to KVtest.mjs: local test with mock KV (node test.mjs)deploy.sh: uploads the Worker,og.png, and creates the route (git-ignored; needs git-ignoredKV_IDand~/apps/jsem/admin-key)og.png: default 1200x630 share image, rendered fromog-src/card.html
Admin #
Only Thao. Login by secret link https://jsem.phosh.uk/admin?k=<key> (link in ~/apps/jsem/admin-link.txt, mode 600), which sets a 1-year HttpOnly cookie. Without the cookie /admin* returns 404. With it, the public site shows a pink bar (new article, admin, logout) and drafts. Visitors see only the list of published posts.
Post fields: title, subtitle, slug, date, status (published/draft), tags, share description, cover image (+alt), markdown body (preview button, inline image upload). The cover is the post's og:image; without one the default og.png is used.
KV keys: post:<slug> JSON, img:<id> bytes, asset:og.png. To rotate the key: change ~/apps/jsem/admin-key, rerun deploy.sh, update the link file.
standard.site (ATProto) #
Each published post is mirrored as a site.standard.document record in Thao's own repo (PDS tngl.sh); the site is the publication at://<did>/site.standard.publication/<tid>.
- On save the Worker creates/updates the record (title, path, description, tags, publishedAt, plain
textContent,coverImageif the cover is at most 1 MB). Draft or delete removes the record. The page gets<link rel="site.standard.document" href="at://...">; the publication is verified at/.well-known/site.standard.publication. - ATProto errors never block saving; the post stores
atError, shown in the editor and as a warning in the admin list. Admin has a "Synchronizovat" button that re-pushes everything. - Feature is off until all three exist: Worker secrets
ATP_HANDLE+ATP_PASSWORD(an app password, revocable) and bindingPUB_AT_URI.
One-time setup:
ATP_HANDLE=viet.shy.cat ATP_PASSWORD=<app password> node scripts/create-publication.mjscreates the publication record (TID rkey chosen by the PDS) and prints its AT-URI.- Put that AT-URI into
~/apps/jsem/pub-at-uri. ATP_HANDLE=... ATP_PASSWORD=... ./set-atproto.shstores the secrets (not written to disk), then./deploy.sh(it keeps secrets and addsPUB_AT_URI).- In admin press "Synchronizovat".
Her repo already has other publications (PHỞznámky, Linh Tinh, ...); jsem is a separate one and does not touch them.