- Accepts protocol 1 and 2 (utils/protocol.js); v2 bodies checked with the contracts' zod schemas (400 INVALID_REQUEST), v1 unchanged - v2 register/heartbeat carry product (409 WRONG_PRODUCT on a mismatch), register stores the install's public key, stats stored per product - v2 replies add linkedProducts (the church's other installs in use with a public key); v1 replies unchanged - Licence tokens carry customerId and product - Until releases per product, only Events installs get releases / "behind" - Tests: every contract sample through the real routes, replies checked against the contract response schemas Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
14 KiB
14 KiB
Changelog
All notable changes to the Cross Events Hub. Format: Keep a Changelog; versions follow Semantic Versioning.
[Unreleased]
Hub 2.0.0, Cross Code Hub, in steps (docs/HUB-2.0-PLAN.md).
Added
- Products (step 1): a licence and an install are for one product: Cross Events, Accounts,
Church Website or Church App (existing ones are Cross Events). Generate a licence for a product
on the customer's page; keys have the product's prefix (
CEH-Events as before,CCA-Accounts,CCW-Website,CCP-App). - One licence per product per customer that isn't revoked (a revoked one can be replaced), enforced by the database. Un-revoking a licence whose product has another open licence is refused.
- Accounts licence (free, never invoiced) created automatically with a customer's first other product licence.
npm run check:hub2: before deploying 2.0, lists customers with two open licences (the 2.0 migration stops on them, naming them). Run it against production first.@crosscode/contracts1.0.0, committed asbackend/vendor/crosscode-contracts-1.0.0.tgz.- Protocol v2 (step 2) next to v1 (
utils/protocol.js;/api/public-keylists[1, 2]): register and heartbeat say whichproductthey are (it must match the licence, else409 WRONG_PRODUCT), register sends the install's public key, the heartbeat's stats are per product, and the replies addlinkedProducts: the church's other installs in use that have a public key (product, id, address, key; nothing else). v2 bodies are checked against the contracts' schemas (400 INVALID_REQUESTsays what's wrong); v1 requests and replies are exactly as before. Tests put every contract sample through the routes and check the replies against the contract. - Licence tokens carry
customerIdandproduct(Cross Events 2.1 ignores them).
Changed
- Cross Code Hub in the dashboard, emails, PDFs and new two-factor set-ups (the
hel1.licence-token prefix stays: it's part of the protocol). - Installs register with protocol v1 only with a Cross Events licence (
409 WRONG_PRODUCTotherwise); the other products register with protocol v2 (step 2). Only Cross Events licences can be invoiced until billing per customer (step 4). Until releases per product (step 3), only Cross Events installs are told about releases or shown as behind. - Migration
20261104132032_products.
[1.7.0] - 2026-11-03
Added
- Billing (README "Billing"; nav → Billing). Invoices are drafted automatically 14 days before each licence's invoice date and emailed to the alert email with the draft PDF for approval; approved invoices go out on their date from 08:00 SA time. Drafts and approved invoices can be edited (lines, dates, recipient, notes), recalculated, sent early, put back to draft or voided; one-off invoices too. Unapproved invoices whose date has come are emailed about once and wait.
- Annual tier review: the first invoice for a period on or after a licence's review date uses the site's 12-month event-income band (Cross Events 2.0.2+) and can move the tier up or down; approving it emails the church a notice of licence change, and the tier changes when the invoice goes out. Notices can also be sent by hand (customer page → Billing). No band reported → the tier stays and the draft says so.
- Founding churches (customer page → Billing, or Billing → Churches and founding): 35% off on every tier, as its own invoice line; since-date and a note.
- Payments with receipts (REC-…), against an invoice or on account; invoices show paid, part paid, overdue. Statements for any dates, as a PDF or emailed.
- Every billing email is styled HTML with a PDF (invoice / tax invoice, receipt, statement, notice of licence change), logged per customer with any send error.
- Licences: billing cycle (none, monthly, yearly at 10 months' price), billing start, next invoice date, next review, custom monthly price. Customers: billing email, postal address, founding.
- Settings → Billing: on/off, business and banking details, VAT (off: plain invoices; on: prices VAT-inclusive, tax invoices with the VAT number), draft days, send hour, payment terms, number prefixes, invoice footer.
- Migration
20261103111645_invoicing; dependencypdfkit0.17.2. Teststests/billing.test.js(rules, dates, statements, and that the server's tiers matchfrontend/src/lib/tiers.ts);scripts/sample-billing-pdfs.jswrites sample PDFs.
Changed
sendMailtakeshtml,attachments,replyToandfromName(alerts are unchanged).
[1.6.2] - 2026-11-03
Added
- Billing tiers. The install page's Licence box shows the plan, the site's event income over
the last 12 months (
income.eventIncome12m, sent by Cross Events 2.0.2+; no donations or sponsorships) and the tier that income falls in, with its price and founding price. It notes when the licence's plan is a different tier. The tiers are infrontend/src/lib/tiers.ts(the public prices are in crosscode-sitesrc/data/pricing.mjs: change both together). - Plan on the licence card (customer page): Trial or one of the eight tiers (Seed to Network).
A licence still on the old
standardplan keeps it until it's changed.
Changed
- Protocol doc: 14 income bands up to
over R10 000 000(Cross Events 2.0.2), andeventIncome12m. Older installs still send the old bands; theirover R100 000can't be placed in a tier.
[1.6.1] - 2026-10-30
Changed
- Claude Sonnet 5.5 is the default AI model (was Haiku 5.5), after a trial of all five helpers on both: Haiku made factual mistakes in a report summary, over-counted feedback themes and misspelt words in messages. A Hub that already saved its AI settings keeps its model until it's changed on Settings → AI.
- Settings → AI has a model list — Sonnet 5.5, Haiku 5.5 and Opus 5.5 with their list prices, or another model ID typed in. Choosing one fills in its prices (still editable, with a note and "Use the list price" when they differ). Blank prices use the built-in ones.
- Cache reads are metered at each model's own price (Opus 5.5 reads at half the usual rate).
[1.6.0] - 2026-10-30
Added
- AI for Cross Events 2.0 (protocol §3b) — sites call AI through the Hub, which holds the Claude
API key, checks each licence's monthly cap and meters every call.
POST /api/installs/ai/statustells a site whether to show its AI buttons (hidden at a R0 cap, disabled once the month's allowance is used up);POST /api/installs/ai/completeruns one helper call (Claude Haiku 5.5, instructions prompt-cached, optional JSON schema). Both are signed like the heartbeat. - Metering in rand: real cost from the tokens, the model's price and an exchange rate set in the Hub; charged = real × (1 + markup). The cap counts charged rand. The worst case of each call is held against the cap in a locked transaction before Claude is called, so calls at the same moment can't push a month over; failed calls cost nothing, refused or cut-off answers cost what they used. Only the install, helper, tokens, cost and time are kept — never prompt or response text.
- Settings → AI: Claude API key (encrypted), model, prices, exchange rate, default markup, Test the saved key, and every site's use per month (real cost, charged, profit).
- Licences: an AI markup override next to the AI cap. Install page: this month's AI use against the cap, use by helper, and six months of real cost, charged and profit.
[1.5.0] - 2026-10-28
Added
- Changing an update request — when a site asked for a version that has since been overtaken and
asks again, the open request moves on to the latest version instead of being ignored: the alert
reads "latest is 1.47.3 (changed from 1.47.0)" and the alert address gets one email about the
change. The response says
changed: trueand givespreviousVersion(protocol §3a). Needs Cross Events 1.47.4 for the button; older sites keep working as before.
[1.4.1] - 2026-10-28
Changed
- Release notes are read from the default branch (
main), not from the newest tag. Notes still only show for tagged versions, so a section written ahead of a release stays hidden until it's tagged — and notes for versions already out can be added or corrected without a new release.
[1.4.0] - 2026-10-28
Added
- Releases from git — every
v1.2.3tag of the Cross Events repository is a release, and the newest tag is the latest version: no more setting it by hand. What's new in each version comes from the repo'sWHATS-NEW.md(written for churches;urgentorsecurityin a version's heading marks a security or serious bug fix). Synced every 15 minutes and with Sync now on the new Releases page, which shows each version, its notes and how many installs run it. Installs on an older version get the notes for every version they'd get, so the church can decide whether to ask for the update; urgent ones can't be put off. Set to the hope-events repository by default; a token is only needed if it becomes private. With the repository cleared, releases are added by hand on the same page. - Notices page — write a message for every install or chosen ones: a banner on their site for site admins and supervisors (from and until a time, e.g. planned maintenance), an email to the customer and the site's admin contact, or both. Banners can be edited or ended early.
- Withdrawn update requests — when a church withdraws its update request, the alert is resolved and you're emailed, so you don't update the site after all.
Changed
- Settings → "Releases and alerts" is now "Alerts"; the latest version follows the Releases page.
Cross Events 1.46.2 shows the notes and notices; older installs keep working and ignore them.
[1.3.0] - 2026-10-28
Added
- Search and pages on every list. Installs (searchable by church, address or version, with a health filter: critical, warnings, healthy, behind latest), Customers (name, contact, email, phone or site) and Alerts (message or install) each have a search box. Lists show 25 at a time with previous/next. The minute-by-minute refresh on Installs keeps you on the page you're on. An install's History shows 20 at a time.
Changed
- Settings is split into tabs: Releases and alerts, Email, Login and security, and Audit log.
The open tab is kept in the address (
/settings#email), so a reload or a link lands on it. The audit log has a search box and shows 30 entries at a time.
Fixed
- Sign out stayed at the bottom of the page on long pages, so it scrolled out of view. The side navigation now stays fixed to the window height.
[1.2.0] - 2026-10-28
Added
- Email (SMTP) on the Settings page: server, port, username, password and from address, stored
in the database (the password encrypted with
HUB_ENCRYPTION_KEY, and never sent back to the browser). Send test logs in to the mail server with what's in the form, saved or not, and sends a test email, showing the server's reason if it fails. Tests and their results are in the audit log.
Changed
- SMTP is no longer read from
backend/.env. On first start, an existingSMTP_*setup is copied into Settings once; after that theSMTP_*lines can be removed.ALERT_EMAILin.env.examplewas never used (the alert address is a setting) and is gone. - The audit log records that the SMTP password changed, never the password.
[1.1.2] - 2026-10-27
Added
scripts/deploy.shto update the Hub on the server: backs up the database, checks out the release, installs, migrates, builds, restarts PM2 and checks both apps answer. If any step fails it goes back to the previous version, restoring the database if new migrations had run. Seedeployment.md§12.
Changed
frontend/tsconfig.tsbuildinfois no longer kept in git (builds change it).
[1.1.1] - 2026-10-27
Fixed
- The install page's Usage card now shows Campuses (Off, or On with the number of active
campuses). The Hub already stored
campusesandcampusCountfrom the heartbeat but didn't show them;campusCountcomes from Cross Events 1.43.0+.
[1.1.0] - 2026-10-27
Added
- Update requests (
docs/hub-protocol.md§3a):POST /api/installs/update-request, signed like the heartbeat. When a church's site admin presses "Request update", the Hub opens anupdate_requestedalert on the install (shown under Alerts and in its history) and emails the alert address once; asking again while it's open doesn't email again. The alert resolves itself when the install's heartbeat reports a newer version.409 UP_TO_DATEif it's already on the latest release. Installs no longer show the deploy command.
Changed
- The signature check for install requests is shared by the heartbeat and update requests.
docs/hub-protocol.mdbrought in line with the install's copy (licence states from Cross Events 1.41.1).
[1.0.1] - 2026-10-27
Changed
- Renamed from Hope Events Hub to Cross Events Hub, following the rename of Hope Events to
Cross Events. Page titles, alert emails and the authenticator-app label now say Cross Events.
Protocol identifiers (
hel1.licence tokens,CEH-licence keys) are unchanged, so existing installs and licences keep working.
Added
- Logo in the sidebar and on the login page; favicon and Apple touch icon.
[1.0.0] - 2026-10-26
Added
- Hub v1 (
docs/hub-protocol.md, protocol 1):- Install API: public key, register (licence key → install id, secret and signed licence), heartbeat (HMAC-signed, 5-minute clock window) returning a fresh licence token.
- Licence tokens signed with Ed25519, valid 30 days, carrying status, expiry, grace days and limits (AI cap for Cross Events 2.0).
- Dashboard: installs with health, version (flagged when behind the latest release), licence and last heartbeat; install detail with health, usage, licence, history and notes.
- Customers and licences: generate keys (
CEH-XXXX-XXXX-XXXX-XXXX), set status (active / suspended / revoked), expiry, grace and AI cap, release a licence from a site. - Alerts every 5 minutes — offline, database, stale backup, low disk, errors, failing jobs, pending migrations, licence expiring/expired, behind latest — emailed once when they start.
- Heartbeats kept 30 days, then one a day.
- Login with two-factor (authenticator app) required, sign out everywhere, password change, audit log.