gitoriaLog in with ident

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit31aac93631aac936tracker#3: no border on the header and on filled buttons; inverted buttons keep theirsmre31aac936/README.md

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

Branches

Latest commits

  • 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