gitoriaLog in with ident

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit05f407c505f407c5tracker: no border on any button except inverted ones (Log out, ident status and identities too); header brand weight 100mre05f407c5/README.md

9.2 KB

  1. # tracker.worldapi.org
  2. The new tracker: a Hybriel app that will track the TV shows (and later movies) the creator
  3. follows and watches. **`CONCEPT.md` (the creator's) is the source of truth** — read it first;
  4. nothing is built that it does not describe. Built step by step, one ticket per step
  5. (tracker.worldapi.org#1, #2, …).
  6. **Built so far — step 1 (ticket #1)**: the shell. The header carries the ident login (an
  7. identity selector, like calendar/gitoria) and sign-out; the homepage itself stays empty. No
  8. design carried over from the old app.
  9. **Step 2 (ticket #2)**: the old tracker's MongoDB export is now in `storage/mpackdb/` (new
  10. mpackdb ids, every reference re-pointed) — see "Data" and `STATUS.md`. Nothing is shown in the
  11. UI yet; the homepage still renders empty. That is a later step, from the creator.
  12. Written in **Hybriel** on **hl:web**, same stack and conventions as `ident.worldapi.org`
  13. (vendored plugins/binary copied from there, see "Vendored Hybriel").
  14. ## Run (dev, Loreana)
  15. ```bash
  16. cd /media/STORAGE/projects/tracker.worldapi.org
  17. TRACKER_PORT=8700 setsid nohup ./bin/hybriel project.hl > server.log 2>&1 < /dev/null & echo $! > server.pid
  18. # stop: kill $(cat server.pid)
  19. ```
  20. * Config (env; the real environment outranks nothing here — there is no `.env` reader in
  21. project.hl, unlike ident's SMTP settings — set these in the shell or `docker-compose.yml`):
  22. | Variable | Default | |
  23. |---|---|---|
  24. | `TRACKER_PORT` | 45008 | |
  25. | `TRACKER_URL` | `http://127.0.0.1:<port>` | this app's own origin — the ident login button's `return=` is built from it |
  26. | `IDENT_URL` | `https://ident.worldapi.org` | |
  27. | `TRACKER_KEY` / `TRACKER_SECRET` | `''` | this app's API key + secret, from ident's `/apps` (register once, origin = `TRACKER_URL`) — **not set yet on Byrodin**: the first deploy (architect) registers the app in the live ident and puts these in `.env` next to `docker-compose.yml`, exactly like ident's own `.env` holds its SMTP settings |
  28. | `TRACKER_WATCH` | on | `0` = no dev watcher (the container) |
  29. | `TRACKER_STORAGE` | `./storage/mpackdb` | the `usersTable` directory |
  30. | `TRACKER_SESSIONS` | `./.sessions` (hl:web's own default) | this app's own session store |
  31. | `HL_HOST` (or `HOST`) | 0.0.0.0 | interface to bind; `127.0.0.1` on Byrodin |
  32. Without `TRACKER_KEY`/`TRACKER_SECRET`, `/` still renders (signed out, the selector and "Log
  33. in with ident" show in the header); a login attempt answers `'login is not set up on this
  34. server (TRACKER_KEY / TRACKER_SECRET missing)'` instead of exchanging a code — so the app is
  35. never a dead 500 while waiting for that one-time setup.
  36. ## What it does (step 1)
  37. * **Login, copied unchanged from calendar.worldapi.org** (rejected once for a centered
  38. sign-in and no header selector — architect, 2026-09-27): ident only, no own passwords
  39. (ident's login button flow, ident.worldapi.org README "How apps use ident"), the identity
  40. selector (`<ident-selector>`, ident's `/selector.js`) sits in the header
  41. (`components/main.hl`, `userBox`), a plain "Log in with ident" link beside it when signed
  42. out. Choosing an identity in the selector fires `ident-login` (one-time code); `login.js`
  43. (an external-component bridge, allowed per the creator: "login.js is correct, as thats for
  44. externals in general") hands the code to a hidden input, whose `change` calls the server
  45. face `trackerLogin` (`users.hl` `exchangeCode`, `POST <ident>/api/exchange` — nothing else:
  46. ident does not hand over a display name yet, ident#23 done / ident#11 on hold), which makes
  47. or finds this app's own user record (`usersTable`, `storage/mpackdb/users.db`) and sets
  48. `session.user = { id }`. `/login/callback` is the same exchange as a plain redirect (the
  49. login button's return URL) for a client that has no socket yet. "Log out" in the header
  50. calls `trackerLogOut`; ident's own login is untouched. This app's own session cookie is
  51. `trackersid` (cookies ignore ports, an own name keeps it apart from ident's `identsid` on
  52. the same dev host, hybriel#10/#17).
  53. * **The empty homepage** (`/`, `components/home.hl`): no content at all, signed in or out —
  54. the header alone carries the login state. Nothing else.
  55. * **One mpackdb table**: `storage/mpackdb/users.db` (`identity` → this app's user id — no
  56. display name, no other per-user data yet). Step 2 (tracker.worldapi.org#2, open) brings the
  57. old tracker's data across.
  58. ## Test
  59. ```bash
  60. node tests/browser.mjs # THE GATE: this app's own server + its OWN ident (a copy of
  61. # ident's code without .env, codes to a mail sink — no live
  62. # ident, no real mail; tests/identkit.mjs, same as calendar's
  63. # gate) + a real headless Chrome: signed out (header shows the
  64. # selector + "Log in with ident", the page itself is empty) ->
  65. # sign in -> header shows "Log out", page still empty -> sign
  66. # out -> signed out again -> a reload stays signed out. Also
  67. # checks the header has no bottom border and filled buttons
  68. # (incl. the ident selector's) have none, while inverted ones
  69. # ("Log out") keep theirs.
  70. # 16 checks. Own servers :8700 (this app) / :8701 (ident copy);
  71. # own storage .scratch/gate-store; Chrome on 8702-8709.
  72. ps -eo pid,args | grep [h]l-browser-tier # must print nothing afterwards
  73. ```
  74. ## Deploy (Byrodin)
  75. Target: `/CONTAINERS/projects/tracker.worldapi.org` on Byrodin, container
  76. `tracker.worldapi.org` (`docker-compose.yml`: debian:12-slim, host network,
  77. `HL_HOST=127.0.0.1`, `TRACKER_PORT=45008`, `TRACKER_WATCH=0`, the folder mounted at
  78. `/home/tracker`, `./bin/hybriel project.hl`), public https://tracker.worldapi.org/ via
  79. nginx (TLS ends there; no baseUrl/tls in the app, like ident/notes).
  80. * **First deploy: done by the architect** (folder, nginx vhost with WebSocket Upgrade
  81. headers, cert, DNS, **and registering this app in the live ident** — `/apps` → name +
  82. origin `https://tracker.worldapi.org` → the API key + secret go into `.env` next to
  83. `docker-compose.yml`, `TRACKER_KEY=… TRACKER_SECRET=…`).
  84. * **Later: `./deploy.sh`** on Loreana, in this folder: runs the gate (refuses on a failure;
  85. `--skip-tests` skips it LOUDLY), rsyncs the code to
  86. `[email protected]:/CONTAINERS/projects/tracker.worldapi.org` (never `storage/`,
  87. `.sessions/`, `.env`, `.scratch/`, `server.*`, logs — the preview is checked for them; no
  88. `--delete`), `docker compose up -d && docker compose restart` over `ssh -F /dev/null`,
  89. then waits for https://tracker.worldapi.org/ to answer 200.
  90. * `./deploy.sh --dry-run` = the gate + `rsync -n` + the commands it would run (no restart, no
  91. URL check). `--target DIR|HOST:DIR` and `--url URL` point it elsewhere (tested against a
  92. local directory, see STATUS.md).
  93. ## Data
  94. `storage/mpackdb/`: `users.db` (`identity` → this app's own user id, `users.hl`) plus, since
  95. step 2, the old tracker's data — `genres.db` (27), `persons.db` (15157), `shows.db` (9453),
  96. `seasons.db` (6430), `episodes.db` (231584), `follows.db` (128), `watches.db` (11692), all with
  97. fresh mpackdb ids and every reference re-pointed (`tools/migrate.hl`); the one old user is this
  98. app's user for ident short id `az5b2`. Counts and the referential-integrity proof:
  99. `STATUS.md` "ticket #2". Nothing of this is shown in the UI yet.
  100. ## Files
  101. | File | |
  102. |---|---|
  103. | `CONCEPT.md` | the creator's concept — do not edit |
  104. | `project.hl` | manifest: routes (`/login/callback`, `/login/failed`, `/login.js`, `/` component Home), the app's own session cookie |
  105. | `users.hl` | the ident exchange + the `usersTable`, copied from calendar.worldapi.org's `users.hl` |
  106. | `login.js` | bridge between `<ident-selector>`'s `ident-login` event and the shell, copied verbatim from calendar.worldapi.org |
  107. | `components/home.hl` | `/`: the empty homepage — no content, signed in or out |
  108. | `components/main.hl` | the shell (header: brand, `<ident-selector>`, log in / log out) |
  109. | `components/loginfailed.hl` | `/login/failed`: why a login didn't work |
  110. | `styles.hl` | all CSS (imports the tokens from `shared/tokens.hl`; accent green `#4ec9b0`) |
  111. | `shared/tokens.hl` | the WorldAPI tokens, vendored verbatim from `ident.worldapi.org/shared/tokens.hl` |
  112. | `tests/browser.mjs` | the gate (above) |
  113. | `tests/identkit.mjs` | starts a throwaway ident copy for the gate, copied from calendar.worldapi.org's `tests/` |
  114. | `tests/cdp.mjs`, `tests/ports.mjs` | the CDP browser driver, copied from `ident.worldapi.org/tests/` |
  115. | `docker-compose.yml`, `Dockerfile`, `deploy.sh` | Byrodin container; the deploy from Loreana (section "Deploy") |
  116. | `tools/migrate.hl` | one-off: old MongoDB export → `storage/mpackdb/` (step 2, idempotent, see `STATUS.md`) |
  117. | `tools/verify.hl` | one-off: proves the migrated data against a COPY of `storage/mpackdb/` (counts, zero dangling references, one show end to end) |
  118. ## Vendored Hybriel
  119. `bin/hybriel` + `plugins/` copied verbatim from `ident.worldapi.org` (2026-09-27), sha256
  120. `9e5e95b33680eb68a016e9e48a76c9f92193fd2ffdbdf437c1aab1bda2731a0d` — hybriel master
  121. 837fe120 (ident's mission 036), the newest vendored+gated build available locally. No local
  122. patch. Re-vendor the same way: copy `bin/hybriel` + `plugins/` from a current worldapi app,
  123. run the gate.

Branches

Latest commits

  • 05f407c5tracker: no border on any button except inverted ones (Log out, ident status and identities too); header brand weight 100mre
  • 17375427tracker#2: tools/migrate.hl + tools/verify.hl — old MongoDB data into mpackdb with new idsmre
  • 31aac936tracker#3: no border on the header and on filled buttons; inverted buttons keep theirsmre
  • 2ad9d29ctracker#1: login exactly like calendar (identity selector in the header, empty homepage)mre
  • 3691e176tracker#1: empty tracker with the ident login (state of 2026-09-27)mre