gitoriaLog in with ident

calendar

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit3b2a4cd03b2a4cd0calendar mission 001 (3/4): code order — let only where reassigned (147 dropped incl. components/month-view; 110 left: 67 reassigned, 43 loop-bound); gates 78/0 (3 of 4 runs; 1 known 'next month' flake) + 18/0, live-data run = step 2mre3b2a4cd0/lib/util.hl

1.6 KB

  1. // lib/util.hl — SMALL SHARED HELPERS (calendar mission 001, code order; as in notes): the environment, the table folder, lists and the
  2. // id checks. Each lives here once; the topic files import them.
  3. import { env } from 'hl:proc'
  4. // an environment variable (or `.env` beside project.hl), trimmed; unset or blank → fallback
  5. static envOr = (name, fallback) => {
  6. v = env(name)
  7. return v != null && v.trim() != '' ? v.trim() : fallback
  8. }
  9. // CALENDAR_STORAGE = the table directory (default ./storage/mpackdb, relative to project.hl)
  10. static storageDir = envOr('CALENDAR_STORAGE', './storage/mpackdb')
  11. static countOfList = (list) => {
  12. if (list == null) { return 0 }
  13. n = list.length
  14. return n == null ? 0 : n
  15. }
  16. static firstOf = (list) => { return countOfList(list) > 0 ? list[0] : null }
  17. // only lowercase hex (ident's one-time codes are 48 hex)
  18. static isHex = (s, max) => {
  19. if (s == null || hlTypeName(s) != 'String' || s.length == 0 || s.length > max) { return false }
  20. let i = 0
  21. while (i < s.length) {
  22. let c = s.charCodeAt(i)
  23. if (!((c >= 48 && c <= 57) || (c >= 97 && c <= 102))) { return false }
  24. i = i + 1
  25. }
  26. return true
  27. }
  28. // an identity id as ident answers it: its public SHORT ID since ident#23 (5 characters like `a68sz`: 2-9 and a-z),
  29. // before that the old per-app id (32 hex) — lower case letters and digits, at most 64 (mission 039; isHex refused `a68sz`)
  30. static isIdentId = (s) => {
  31. if (s == null || hlTypeName(s) != 'String' || s.length == 0 || s.length > 64) { return false }
  32. let i = 0
  33. while (i < s.length) {
  34. let c = s.charCodeAt(i)
  35. if (!((c >= 48 && c <= 57) || (c >= 97 && c <= 122))) { return false }
  36. i = i + 1
  37. }
  38. return true
  39. }

Branches

Latest commits

  • 3b2a4cd0calendar mission 001 (3/4): code order — let only where reassigned (147 dropped incl. components/month-view; 110 left: 67 reassigned, 43 loop-bound); gates 78/0 (3 of 4 runs; 1 known 'next month' flake) + 18/0, live-data run = step 2mre
  • f5ce6b1dcalendar mission 001 (2/4): code order — topics, map, thin faces: lib/util.hl, lib/events(-helpers).hl (+calendarView/settingsView/soonOf), lib/settings.hl, lib/users.hl (+userOfLoginCode, tagOf), lib/api(-helpers).hl; project.hl = map; login route takes &req/&sessions (failed-login reason now kept); gates 78/0 + 18/0mre
  • c6fbd011calendar mission 001 (1/4): code order — files moved: lib/events.hl, lib/users.hl, components/styles.hl (imports only); gates 78/0 + 18/0, live-data run identicalmre
  • d6c59290calendar: Hybriel master 06617221 (plugin allocators 3a781359 + 413f60e4, mpackdb 2cb7ae5e, http1 773de63e); gates 78/0 + 18/0mre
  • 7bd0337ccalendar: Hybriel master 190aa11d (fc838894 GC correctness, #126 closure scopes, #127); gates 78/0 + 18/0mre
  • ff41310ccalendar: Hybriel master 8efba065 (#126 memory, #48 lambda copy; audit: no & needed)mre
  • 14ba08c7antcolony#40: mission references point to the moved missionsmre
  • 99c73346antcolony#40: history (LOG.md), worker briefs (missions/) and reports moved here from antcolony, numbered per project; old numbers in antcolony docs/mission-map.mdmre
  • 76edaa62calendar: Hybriel master ff51cf46 (re-vendor round, static workaround removed)mre
  • 90a3fc2cdeploy.sh: back up live storage/.sessions/.env before every deploy (newest 5 kept)mre
  • 6722b72ddeploy.sh: never send .git or .gitignore to Byrodinmre
  • be099807State of 2026-09-27, before the move to gitoriamre