tracker
All repositories: gitoria
8.2 KB
# tracker.worldapi.orgThe new tracker: a Hybriel app that will track the TV shows (and later movies) the creatorfollows and watches. **`CONCEPT.md` (the creator's) is the source of truth** — read it first;nothing is built that it does not describe. Built step by step, one ticket per step(tracker.worldapi.org#1, #2, …).**Built so far — step 1, ticket #1**: the shell. The header carries the ident login (anidentity selector, like calendar/gitoria) and sign-out; the homepage itself stays empty. Noshows, no data, no design carried over from the old app.Written in **Hybriel** on **hl:web**, same stack and conventions as `ident.worldapi.org`(vendored plugins/binary copied from there, see "Vendored Hybriel").## Run (dev, Loreana)```bashcd /media/STORAGE/projects/tracker.worldapi.orgTRACKER_PORT=8700 setsid nohup ./bin/hybriel project.hl > server.log 2>&1 < /dev/null & echo $! > server.pid# stop: kill $(cat server.pid)```* Config (env; the real environment outranks nothing here — there is no `.env` reader inproject.hl, unlike ident's SMTP settings — set these in the shell or `docker-compose.yml`):| Variable | Default | ||---|---|---|| `TRACKER_PORT` | 45008 | || `TRACKER_URL` | `http://127.0.0.1:<port>` | this app's own origin — the ident login button's `return=` is built from it || `IDENT_URL` | `https://ident.worldapi.org` | || `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 || `TRACKER_WATCH` | on | `0` = no dev watcher (the container) || `TRACKER_STORAGE` | `./storage/mpackdb` | the `usersTable` directory || `TRACKER_SESSIONS` | `./.sessions` (hl:web's own default) | this app's own session store || `HL_HOST` (or `HOST`) | 0.0.0.0 | interface to bind; `127.0.0.1` on Byrodin |Without `TRACKER_KEY`/`TRACKER_SECRET`, `/` still renders (signed out, the selector and "Login with ident" show in the header); a login attempt answers `'login is not set up on thisserver (TRACKER_KEY / TRACKER_SECRET missing)'` instead of exchanging a code — so the app isnever a dead 500 while waiting for that one-time setup.## What it does (step 1)* **Login, copied unchanged from calendar.worldapi.org** (rejected once for a centeredsign-in and no header selector — architect, 2026-09-27): ident only, no own passwords(ident's login button flow, ident.worldapi.org README "How apps use ident"), the identityselector (`<ident-selector>`, ident's `/selector.js`) sits in the header(`components/main.hl`, `userBox`), a plain "Log in with ident" link beside it when signedout. Choosing an identity in the selector fires `ident-login` (one-time code); `login.js`(an external-component bridge, allowed per the creator: "login.js is correct, as thats forexternals in general") hands the code to a hidden input, whose `change` calls the serverface `trackerLogin` (`users.hl` `exchangeCode`, `POST <ident>/api/exchange` — nothing else:ident does not hand over a display name yet, ident#23 done / ident#11 on hold), which makesor finds this app's own user record (`usersTable`, `storage/mpackdb/users.db`) and sets`session.user = { id }`. `/login/callback` is the same exchange as a plain redirect (thelogin button's return URL) for a client that has no socket yet. "Log out" in the headercalls `trackerLogOut`; ident's own login is untouched. This app's own session cookie is`trackersid` (cookies ignore ports, an own name keeps it apart from ident's `identsid` onthe same dev host, hybriel#10/#17).* **The empty homepage** (`/`, `components/home.hl`): no content at all, signed in or out —the header alone carries the login state. Nothing else.* **One mpackdb table**: `storage/mpackdb/users.db` (`identity` → this app's user id — nodisplay name, no other per-user data yet). Step 2 (tracker.worldapi.org#2, open) brings theold tracker's data across.## Test```bashnode tests/browser.mjs # THE GATE: this app's own server + its OWN ident (a copy of# ident's code without .env, codes to a mail sink — no live# ident, no real mail; tests/identkit.mjs, same as calendar's# gate) + a real headless Chrome: signed out (header shows the# selector + "Log in with ident", the page itself is empty) -># sign in -> header shows "Log out", page still empty -> sign# out -> signed out again -> a reload stays signed out.# 12 checks. Own servers :8700 (this app) / :8701 (ident copy);# own storage .scratch/gate-store; Chrome on 8702-8709.ps -eo pid,args | grep [h]l-browser-tier # must print nothing afterwards```## Deploy (Byrodin)Target: `/CONTAINERS/projects/tracker.worldapi.org` on Byrodin, container`tracker.worldapi.org` (`docker-compose.yml`: debian:12-slim, host network,`HL_HOST=127.0.0.1`, `TRACKER_PORT=45008`, `TRACKER_WATCH=0`, the folder mounted at`/home/tracker`, `./bin/hybriel project.hl`), public https://tracker.worldapi.org/ vianginx (TLS ends there; no baseUrl/tls in the app, like ident/notes).* **First deploy: done by the architect** (folder, nginx vhost with WebSocket Upgradeheaders, cert, DNS, **and registering this app in the live ident** — `/apps` → name +origin `https://tracker.worldapi.org` → the API key + secret go into `.env` next to`docker-compose.yml`, `TRACKER_KEY=… TRACKER_SECRET=…`).* **Later: `./deploy.sh`** on Loreana, in this folder: runs the gate (refuses on a failure;`--skip-tests` skips it LOUDLY), rsyncs the code to`[email protected]:/CONTAINERS/projects/tracker.worldapi.org` (never `storage/`,`.sessions/`, `.env`, `.scratch/`, `server.*`, logs — the preview is checked for them; no`--delete`), `docker compose up -d && docker compose restart` over `ssh -F /dev/null`,then waits for https://tracker.worldapi.org/ to answer 200.* `./deploy.sh --dry-run` = the gate + `rsync -n` + the commands it would run (no restart, noURL check). `--target DIR|HOST:DIR` and `--url URL` point it elsewhere (tested against alocal directory, see STATUS.md).## DataOne mpackdb table so far: `storage/mpackdb/users.db` (`identity` → this app's own user id,`users.hl`) — no shows, no other per-user data. Step 2 brings the old tracker's mpackdbtables (mongo export → mpackdb, new ids, references re-pointed).## Files| File | ||---|---|| `CONCEPT.md` | the creator's concept — do not edit || `project.hl` | manifest: routes (`/login/callback`, `/login/failed`, `/login.js`, `/` component Home), the app's own session cookie || `users.hl` | the ident exchange + the `usersTable`, copied from calendar.worldapi.org's `users.hl` || `login.js` | bridge between `<ident-selector>`'s `ident-login` event and the shell, copied verbatim from calendar.worldapi.org || `components/home.hl` | `/`: the empty homepage — no content, signed in or out || `components/main.hl` | the shell (header: brand, `<ident-selector>`, log in / log out) || `components/loginfailed.hl` | `/login/failed`: why a login didn't work || `styles.hl` | all CSS (imports the tokens from `shared/tokens.hl`; accent green `#4ec9b0`) || `shared/tokens.hl` | the WorldAPI tokens, vendored verbatim from `ident.worldapi.org/shared/tokens.hl` || `tests/browser.mjs` | the gate (above) || `tests/identkit.mjs` | starts a throwaway ident copy for the gate, copied from calendar.worldapi.org's `tests/` || `tests/cdp.mjs`, `tests/ports.mjs` | the CDP browser driver, copied from `ident.worldapi.org/tests/` || `docker-compose.yml`, `Dockerfile`, `deploy.sh` | Byrodin container; the deploy from Loreana (section "Deploy") |## Vendored Hybriel`bin/hybriel` + `plugins/` copied verbatim from `ident.worldapi.org` (2026-09-27), sha256`9e5e95b33680eb68a016e9e48a76c9f92193fd2ffdbdf437c1aab1bda2731a0d` — hybriel master837fe120 (ident's mission 036), the newest vendored+gated build available locally. No localpatch. Re-vendor the same way: copy `bin/hybriel` + `plugins/` from a current worldapi app,run the gate.
Branches
- mainmain branch