gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit8f3d9bc98f3d9bc9|||PR ident#42 keyed upsert and removemre8f3d9bc9/missions/006-ident-ip-limit-deploy-scripts.md

4.8 KB

  1. # Mission 006 (old 010) — ident per-IP limit + deploy scripts for ident and tickets
  2. One-shot worker. The architect (Claude Code on Byrodin) verifies your report and does the first real
  3. deploy to Byrodin himself. You do NOT touch Byrodin.
  4. ## Read first
  5. 1. `loreana:/media/STORAGE/projects/ident.worldapi.org/` `CONCEPT.md`, `README.md`, `STATUS.md`.
  6. 2. `loreana:/media/STORAGE/projects/tickets.worldapi.org/` `README.md`, `STATUS.md`.
  7. 3. `/CONTAINERS/projects/antcolony/README.md` — "Conventions for all apps", "Lessons learned".
  8. 4. How notes.worldapi.org runs on Byrodin (the model): `/CONTAINERS/projects/notes.worldapi.org/README.md`
  9. and `docker-compose.yml` (debian:12-slim, host network, app on 127.0.0.1:<port>, nginx proxies it,
  10. TLS ends at nginx; the manifest declares NO baseUrl and NO tls — README explains why).
  11. ## Hybriel (standard block)
  12. Read `/CONTAINERS/projects/antcolony/docs/hybriel-for-app-workers.md` first. Report new Hybriel findings
  13. under "Hybriel issues"; do not edit that guide.
  14. ## Part 1 — ident: per-IP limit for code requests
  15. Today the only limit is per email address (3 codes / 10 min), so a public ident could be used to mail
  16. many addresses. Add a limit per client IP on code sends (your numbers; list them).
  17. - **Client IP source**: behind nginx on Byrodin every request carries **`X-Client-IP`**, set by nginx
  18. (`/CONTAINERS/web/nginx/conf.d/cloudflare-client-ip.conf`): the CF-Connecting-IP when the request
  19. really came through Cloudflare, else the TCP peer. nginx always overwrites what a client sends, so
  20. ident trusts `X-Client-IP` and nothing else (never `CF-Connecting-IP` / `X-Forwarded-For` directly).
  21. - Without the header (dev on Loreana, no nginx): fall back to the connection's peer address if hl:webex
  22. exposes one, else one shared bucket — say which.
  23. - Both the web face and any API that triggers a mail are covered. Refusals are visible to the user.
  24. - Gate: extend with per-IP cases (two IPs via the header, the limit hits one, not the other; the
  25. header can't be bypassed by sending another IP header). Mail only into the sink.
  26. ## Part 2 — deploy readiness for BOTH apps
  27. Target on Byrodin (the architect creates it on first deploy):
  28. | app | Byrodin folder | container | port (127.0.0.1) |
  29. |---|---|---|---|
  30. | ident | `/CONTAINERS/projects/ident.worldapi.org` | `ident.worldapi.org` | 45002 |
  31. | tickets | `/CONTAINERS/projects/tickets.worldapi.org` | `tickets.worldapi.org` | 45003 |
  32. For each app:
  33. 1. A `docker-compose.yml` in the app folder (notes pattern: `debian:12-slim`, `network_mode: host`,
  34. `restart: unless-stopped`, whole folder mounted, runs the vendored `bin/hybriel`). The app must bind
  35. **127.0.0.1** on Byrodin (check how: HL_HOST or the app's own env; make it configurable, default
  36. unchanged for dev). Port via env.
  37. 2. A `deploy.sh` run ON LOREANA: refuses to run if any gate fails (or takes `--skip-tests`, loud);
  38. rsyncs the code to `[email protected]:<Byrodin folder>` — **excluding** `storage/`, `.sessions/`,
  39. `.env`, `.scratch/`, `server.*`, `testapp/`, logs; then restarts the container over ssh
  40. (`docker compose up -d` / `restart`); then checks the public URL answers 200. Print every step.
  41. Loreana's ssh to Byrodin: see ident STATUS (`ssh -F /dev/null [email protected]` may be needed).
  42. **Write it, check it with `bash -n` and a `--dry-run` mode (rsync -n, no restart) — do NOT run it
  43. for real and do NOT connect to Byrodin.** Dry-run output against Byrodin is also not allowed; test
  44. the dry-run against a local target directory instead (make the target configurable).
  45. 3. Behind a TLS-terminating proxy: make sure nothing emits `http://` absolute URLs and cookies still
  46. work on https (notes' lesson). Check ident's session cookie and the selector/CORS code with an
  47. `https://tickets.worldapi.org` origin in mind (apps registered with https origins).
  48. 4. README of each app: "Deploy" section (first deploy is done by the architect; later: `./deploy.sh`).
  49. ## Mail — IMPORTANT (unchanged)
  50. ident's dev server on :8351 sends **real mail**. Never trigger an OTP on :8351. Gates use their own
  51. servers with `IDENT_MAIL_SINK`. **Do not read, print, copy or edit any `.env`.**
  52. ## Rules
  53. - No git. Only kill your own PIDs or the named pid files. Clean up headless Chromes. Scratch in the
  54. app's `.scratch/`. Do NOT POST to the live tickets server. Only ever open COPIES of mpackdb stores (#40).
  55. - If any action is refused by the permission system, don't retry or work around it; report it.
  56. - All existing gates of both apps must stay green. Restart the dev servers at the end as before
  57. (ident: `server.pid`, `testapp/testapp.pid`; tickets: `server.pid`) and check 200.
  58. - Update `README.md` / `STATUS.md` of both apps. Do NOT edit `CONCEPT.md`.
  59. ## Report (final answer, this structure)
  60. ```
  61. ## Done
  62. ## Verified (each: command run + observed output)
  63. ## Not verified / open
  64. ## Hybriel issues (repro, observed, expected)
  65. ## Questions for the creator
  66. ## Running (URL, PID, log path)
  67. ```

Branches

Latest commits

  • 8f3d9bc9|||PR ident#42 keyed upsert and removemre
  • 675493b1ident#42: editing an identity upserts the one edited row (face editIdentity answers { identity, row }); a create or delete keeps the whole list because the rows' position-dependent parts (default, Delete, Identity n) changemre
  • 45e55303ident#42: an app write patches one row: upsert on create, edit and new secret, one-argument remove on delete; the faces answer the changed app (or the deleted id), not the whole listmre
  • 991641d4Merge branch 'f10-access' into mainIdent
  • e56d8273|||PR ident#34 part 4: access and inbox fixed classesmre
  • df7696dbident#34: tests: access ticks selector quoting fixmre
  • 7215903eident#34: access: the unstyled classes all, app, tick, apptick, plus are dropped; the gate finds the app ticks by input[name=app]mre
  • 69b0a0ceident#34: access: the pick buttons use Style.pickCard instead of class pickmre
  • dc702419Merge branch 'f9-choose' into mainIdent
  • 8caec771|||PR ident#34 restore .choose hookmre
  • 0dbff960Merge branch 'f8-shared' into mainIdent
  • d69665f6|||PR ident#34 part 3: shared look classes (wide, avatar, chip/used, conn, choose, who, inboxlink) moved to statics or droppedmre
  • 3a64dc48ident#34: chipLook: radius as the same var() string (a bare token name in a static does not compile); selector gate selectormre
  • eb039073ident#34: tests: signin and migration find the choice without the classmre
  • 4b94a594ident#34: tests: fix selector of the identity choicemre
  • bebc88e4ident#34: main.hl drops the unstyled classes inboxlink and whomre
  • b4e7ad04ident#34: the identity choice link/button has no class (rule on #chooselist a)mre
  • 3c33d6eaident#34: the connection link in inbox has no class (rule on #conns a)mre
  • dc97ec0dident#34: the Notif. chip and the Used in link share chipLook (Style.pChip) instead of the classes chip/used/notifmre
  • 378bd432ident#34: the identity picture look is a static in styles.hl (Style.pAvatar); sizes stay with each listmre