gitoriaLog in with ident

calendar

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Branchmain2881119fcalendar mission 001 (4/4): code order — README layout + same-output test, STATUS, LOG, report; tests/letcount.py (sub-folders), tests/realdata-baseline.mjs, tests/realdata-compare.pymremain/project.hl

3.4 KB

  1. // project.hl — calendar.worldapi.org: THE MAP. Config, routes and WHO HEARS WHAT. Hybriel on hl:web.
  2. // The month view at `/` (ticket #1); login with ident and the user's private events (ticket #2).
  3. //
  4. // WHERE WHAT IS (README "Files"):
  5. // events, every write to events.db, the faces' answers lib/events.hl (+ lib/events-helpers.hl)
  6. // the default reminders (settings.db) lib/settings.hl
  7. // users, the ident exchange, both logins' user step lib/users.hl
  8. // /login/callback lib/api.hl (+ lib/api-helpers.hl)
  9. // env, table folder, lists, id checks lib/util.hl
  10. // the page shell, login/logout faces components/main.hl
  11. // `/` and the event faces, /login/failed, all CSS components/calendar.hl, loginfailed.hl, styles.hl
  12. // the month view (UI, dates, names, reminders, clock) components/month-view/
  13. import WebFramework from 'hl:web'
  14. import { env } from 'hl:proc'
  15. import Styles from './components/styles.hl'
  16. import { tagOf } from './lib/users.hl'
  17. import { loginCallback } from './lib/api.hl'
  18. import Calendar from './components/calendar.hl'
  19. import LoginFailed from './components/loginfailed.hl'
  20. static siteName = "Calendar"
  21. appTitle = siteName
  22. appThemeColor = '#191e23'
  23. appBackgroundColor = '#191e23'
  24. appIcons = [
  25. { src = '/icons/icon-192.png' sizes = '192x192' purpose = 'any' }
  26. { src = '/icons/icon-512.png' sizes = '512x512' purpose = 'any' }
  27. { src = '/icons/icon-192.png' sizes = '192x192' purpose = 'maskable' }
  28. { src = '/icons/icon-512.png' sizes = '512x512' purpose = 'maskable' }
  29. ]
  30. offline = [ Calendar ]
  31. styles = Styles
  32. routes = [
  33. { pattern = "/favicon.ico" direct = "" }
  34. // the login button's return writes the session: the request and the store go BY REFERENCE (lib/api.hl)
  35. { pattern = "/login/callback" function = (route, req) => { return loginCallback(route, &req, &server.sessions) } }
  36. { pattern = "/login/failed" component = LoginFailed }
  37. { pattern = "/login.js" file = "./login.js" headers = { 'Cache-Control' = 'no-cache' } }
  38. // the installable app (ticket #3): the icons (manifest and service worker are hl:web's own, from appIcons / offline)
  39. { pattern = "/icons/icon-192.png" file = "./icons/icon-192.png" headers = { 'Cache-Control' = 'no-cache' } }
  40. { pattern = "/icons/icon-512.png" file = "./icons/icon-512.png" headers = { 'Cache-Control' = 'no-cache' } }
  41. { pattern = "/" component = Calendar }
  42. ]
  43. // WHO GETS THE PUSH: the login state reaches the tabs of one session.
  44. // `calendarSignedIn` / `calendarSignedOut` go to the tabs of ONE session: the one whose login carries that random tag.
  45. audience = {
  46. calendarSignedIn = (tag, session) => { return tag != null && tagOf(session) == tag }
  47. calendarSignedOut = (tag, session) => { return tag != null && tagOf(session) == tag }
  48. }
  49. sessionDir = env('CALENDAR_SESSIONS') != null ? env('CALENDAR_SESSIONS') : null
  50. port = env('CALENDAR_PORT') != null ? toNumber(env('CALENDAR_PORT')) : 8380
  51. // HL_HOST = the interface hl:web binds: 127.0.0.1 on Byrodin behind nginx; unset = 0.0.0.0 (dev on Loreana).
  52. // CALENDAR_WATCH=0 = no dev watcher.
  53. watching = env('CALENDAR_WATCH') != '0'
  54. // The session idles out after the 14 days of sessionMaxAge, not after 15 minutes.
  55. sessionCookie = 'calendarsid'
  56. sessionIdle = 1209600
  57. server = new WebFramework(routes = routes, styles = styles, minify = true, port = port, watchMode = watching, sessionCookie = sessionCookie)
  58. on Error(e) { console.log('error absorbed: ' + e.message) }

Branches

  • mainmain branch

Latest commits

  • 2881119fcalendar mission 001 (4/4): code order — README layout + same-output test, STATUS, LOG, report; tests/letcount.py (sub-folders), tests/realdata-baseline.mjs, tests/realdata-compare.pymre
  • 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