calendar
All repositories: gitoria
4.3 KB
// project.hl — calendar.worldapi.org: THE MAP. Config, routes and WHO HEARS WHAT. Hybriel on hl:web.// The month view at `/` (ticket #1); login with ident and the user's private events (ticket #2).//// WHERE WHAT IS (README "Files"):// events, every write to events.db, the faces' answers lib/events.hl (+ lib/events-helpers.hl)// the default reminders (settings.db) lib/settings.hl// users, the ident exchange, both logins' user step lib/users.hl// /login/callback lib/api.hl (+ lib/api-helpers.hl)// env, table folder, lists, id checks lib/util.hl// the page shell, login/logout faces components/main.hl// `/` and the event faces, /login/failed, all CSS components/calendar.hl, loginfailed.hl, styles.hl// Web Push: subscriptions + the clock that sends lib/push.hl (faces calPushSave / calPushOff in calendar.hl)// the month view (UI, dates, names, reminders, clock) components/month-view/import WebFramework from 'hl:web'import { env } from 'hl:proc'import Styles from './components/styles.hl'import { dark, darker } from './shared/tokens.hl'import { tagOf } from './lib/users.hl'import { loginCallback } from './lib/api.hl'import Calendar from './components/calendar.hl'import LoginFailed from './components/loginfailed.hl'import Push from './lib/push.hl'import { envOr } from './lib/util.hl'static siteName = "Calendar"appTitle = siteNameappThemeColor = darker.valueappBackgroundColor = dark.valueappIcons = [{ src = '/icons/icon-192.png' sizes = '192x192' purpose = 'any' }{ src = '/icons/icon-512.png' sizes = '512x512' purpose = 'any' }{ src = '/icons/icon-192.png' sizes = '192x192' purpose = 'maskable' }{ src = '/icons/icon-512.png' sizes = '512x512' purpose = 'maskable' }]offline = [ Calendar ]styles = Stylesroutes = [{ pattern = "/favicon.ico" direct = "" }// the login button's return writes the session: the request and the store go BY REFERENCE (lib/api.hl){ pattern = "/login/callback" function = (route, req) => { return loginCallback(route, &req, &server.sessions) } }{ pattern = "/login/failed" component = LoginFailed }{ pattern = "/login.js" file = "./login.js" headers = { 'Cache-Control' = 'no-cache' } }// the installable app (ticket #3): the icons (manifest and service worker are hl:web's own, from appIcons / offline){ pattern = "/icons/icon-192.png" file = "./icons/icon-192.png" headers = { 'Cache-Control' = 'no-cache' } }{ pattern = "/icons/icon-512.png" file = "./icons/icon-512.png" headers = { 'Cache-Control' = 'no-cache' } }{ pattern = "/" component = Calendar }]// WHO GETS THE PUSH: the login state reaches the tabs of one session.// `calendarSignedIn` / `calendarSignedOut` go to the tabs of ONE session: the one whose login carries that random tag.audience = {calendarSignedIn = (tag, session) => { return tag != null && tagOf(session) == tag }calendarSignedOut = (tag, session) => { return tag != null && tagOf(session) == tag }}sessionDir = env('CALENDAR_SESSIONS') != null ? env('CALENDAR_SESSIONS') : nullport = env('CALENDAR_PORT') != null ? toNumber(env('CALENDAR_PORT')) : 8380// HL_HOST = the interface hl:web binds: 127.0.0.1 on Byrodin behind nginx; unset = 0.0.0.0 (dev on Loreana).// CALENDAR_WATCH=0 = no dev watcher.watching = env('CALENDAR_WATCH') != '0'// The session idles out after the 14 days of sessionMaxAge, not after 15 minutes.sessionCookie = 'calendarsid'sessionIdle = 1209600// WEB PUSH (calendar#9): the VAPID key pair and contact, all three or none (tools/vapid-keys.hl makes the pair; README "Web Push").// Unset = no push: the page still shows reminders while it is open.pushPublic = envOr('CALENDAR_PUSH_PUBLIC', '')pushPrivate = envOr('CALENDAR_PUSH_PRIVATE', '')pushContact = envOr('CALENDAR_PUSH_SUBJECT', '')pushOn = pushPublic != '' && pushPrivate != '' && pushContact != ''// the sender's clock lives on an INSTANCE of lib/push.hlpush = new Push()server = new WebFramework(routes = routes, styles = styles, minify = true, port = port, watchMode = watching, sessionCookie = sessionCookie, pushKey = pushOn ? pushPublic : null, pushPrivateKey = pushOn ? pushPrivate : null, pushSubject = pushOn ? pushContact : null)on Error(e) { console.log('error absorbed: ' + e.message) }
Branches
Latest commits
- ebda0fd1calendar mission 008 (A7): server-side reminder plan on hl:time (push-plan.hl; hl:time fromLocal in a browser static is refused: repro .scratch/hltime-client), push gate 9/9mre
- d063dad3calendar mission 008 (A7): Web Push (WIP): lib/push.hl subscriptions + sender clock, faces calPushSave/calPushOff, button subscribes, VAPID tool, tests/push.mjs; instantOf on hl:timemre
- cf175c80calendar mission 008 (A7): re-vendor Hybriel master 0e3c9830 (bin 9d957fed, plugins whole: hl:crypto Web Push primitives, hl:web sendPush)mre
- 9bf3c38bcalendar mission 008: re-vendor Hybriel f9833544 (gates old = new); Web Push stopped: hl:crypto half missing on mastermre
- 186f969bcalendar mission 007: signed-in gate for the first-pointer race (fails on 3c5604f), README theme section, reportmre
- ba9b4955calendar mission 006: first pointer event no longer re-runs the month (stale overwrite race), gate check, e2e settings cleanup, reportmre
- bd730759calendar mission 006: theme move (WIP): brief, report, LOG, STATUSmre
- b117b153calendar mission 006 WIP: reminder row fields keep 44 px; e2e script flagsmre
- 53e3b0debrowser gate: Log out through the user menu, theme colour rgb(15, 20, 25)mre
- 90bf9e2ecalendar mission 006 WIP: theme dbe3de7, theme shell (AppHeader/MainMenu/UserMenu/Sidebar/ContentFirst), styles cut to the app's own rules, check-theme gate, e2e toolsmre
- 3c5604f9identkit: refuse a taken ident port, cold-start deadline, abort on dead ident, clear no-code error (as notes)mre
- 4996bbe7paths: projects moved into /media/STORAGE/projects/WorldAPI/mre
- f5bf0803calendar mission 004: re-vendor Hybriel to the shared static build 0f396652; compose cache volume + tmpfs; notify-paths gate in deploy.sh; gate start waits 150 s; reportmre
- eb86526fmission brief 004mre
- 2f953b16deploy.sh: wait up to DEPLOY_URL_WAIT (120 s) for 200 after the restart, as the other apps (cold compile, hybriel#148)mre
- 9078e1b7calendar mission 003 (2/2): report, LOG, STATUS (cause: timers only in an open, front, touched page; gate old 5/2 new 7/0; Hybriel gaps Web Push + page-shown hook, STOP)mre
- 31ffe910calendar mission 003 (1/2): calendar#9 — missed reminders shown when the app is back, timers set again when it is shownmre
- 26c997d3mission brief 003mre
- c6809c76calendar mission 002: report, LOG, STATUS (test bug; fixed gate 78/0 at 00:30 05:40 12:00 19:59 20:01; 23:30 not run, quota stop)mre
- 00f72783calendar mission 002 (2/2): TEST bug — the reminder steps get their own identity (carol): alice's all-day Vacation (20th-22nd) from the events steps added 2 reminders from the 12th 20:00 to the 19th 23:00; Tokyo check no longer skipped in the Tokyo eveningmre