82 Commits
Author SHA1 Message Date
joshua be3945b8be Merge branch 'feat/link-public-key' v2.2.0 2026-11-18 13:02:21 +02:00
joshuaandClaude Opus 5.5 4aecc05c07 Hub 2.2.0: contracts 1.4.0 as it will be tagged (FEED_PATHS, typesVersions)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 12:36:40 +02:00
joshuaandClaude Opus 5.5 1fceb92745 Hub 2.2.0: changelog
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 12:06:09 +02:00
joshuaandClaude Opus 5.5 106d71e566 Hub 2.2.0: a public key on the v2 heartbeat, Clear public key
Installs that registered with protocol v1 move to v2 by sending their
public key on a signed v2 heartbeat: saved / matches / mismatch, never a
failed heartbeat. Clear public key (2FA again) for a rebuilt server.
Contracts 1.4.0 vendored; hub-protocol.md §6 updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 12:05:59 +02:00
joshuaandClaude Opus 5.5 7428337aa5 Release 2.1.1
Adopt passes the church's address (needed for domains that don't start with events.), and
Link existing says the short name is a name, not a folder. The changelog entry for the fix,
missing from its commit, is added here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v2.1.1
2026-11-18 10:02:39 +02:00
joshua 754083648a Merge branch 'fix/adopt-address' 2026-11-18 09:58:16 +02:00
joshuaandClaude Opus 5.5 a2e97a5ea9 Adopt: pass the church's address; Link: the short name is a name
crosscode adopt can only work out the church's address from an events.<address> domain, and
the Hub never sent --address, so adopting a site like events-demo.crosscode.co.za failed on the
server. The adopt form now asks for the address (required for such domains), the Hub refuses to
plan the move without it, and it goes into the job's arguments.

Link existing: the short name field and its error say it's a name like `hope`, not a folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 09:58:16 +02:00
joshuaandClaude Opus 5.5 197edf3c1a README: servers and the agent (2.1), where the protocol lives
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls1vMdni7EfytGYqQTprME
2026-11-17 22:41:10 +02:00
joshuaandClaude Opus 5.5 a6e9f6bc97 Release 2.1.0
Servers and the agent: New install, scheduled and emergency updates,
batches, adopt, uninstall with an encrypted export, server stats and
alerts. Also dates 2.0.2 correctly (2026-11-17).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls1vMdni7EfytGYqQTprME
v2.1.0
2026-11-17 22:25:50 +02:00
joshua 22fdd3a388 Merge branch 'feat/servers-agent' 2026-11-17 22:23:43 +02:00
joshuaandClaude Opus 5.5 1952acc057 Registration: linking a Hub install never blocks registering
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls1vMdni7EfytGYqQTprME
2026-11-17 19:06:06 +02:00
joshuaandClaude Opus 5.5 1be6d32aa6 Banners reach a site the Hub installed
Found in the VM test: a Hub-installed site registers with its licence
key, but its deployment was never linked to that registration, so update
and closing banners were silently skipped. Registration now makes the
link, and a notice makes it for sites that registered before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls1vMdni7EfytGYqQTprME
2026-11-17 19:05:37 +02:00
joshuaandClaude Opus 5.5 674a691d85 Settings: the servers settings (install defaults, port range, central IP) are saved
Found in the VM test: they were never added to the known settings, so
saving them was silently ignored and every install got the template's
defaults. A test now saves and reads them back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 15:44:27 +02:00
joshuaandClaude Opus 5.5 016d1ea17e New install: a failed or removed install's short name can be used again
Found in the VM test: after a failed install, retrying with the same
short name was refused, and the unique short name per product would
have blocked it anyway. A failed install's record is replaced; a removed
one keeps its history under another name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 15:39:36 +02:00
joshuaandClaude Opus 5.5 b0d81ed195 Events env template copy: HUB_PUBLIC_KEY (a Hub other than production)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 15:35:50 +02:00
joshuaandClaude Opus 5.5 74c56b67e9 Release 2.0.2: refund a payment; void invoices that aren't paid
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v2.0.2
2026-11-17 13:36:09 +02:00
joshua 8698f60b96 Merge branch 'fix/void-refunded' 2026-11-17 13:36:03 +02:00
joshuaandClaude Opus 5.5 4fa67e23c0 Servers migration after the refunds one (2.0.2 ships first)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 13:34:35 +02:00
joshua 1816f3088a Merge branch 'fix/void-refunded'
# Conflicts:
#	CHANGELOG.md
2026-11-17 13:34:19 +02:00
joshuaandClaude Opus 5.5 3706b73879 Billing: refund a payment; void invoices that aren't paid (none, or all refunded)
Void was refused while any payment was recorded, so a paid-then-refunded
invoice could only be voided by deleting the payment and losing the
record. A payment can now be marked refunded: kept with its receipt, no
longer counted as paid, shown on the statement as money going back out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 13:34:08 +02:00
joshuaandClaude Opus 5.5 3ed8979e19 Changelog: servers and the agent (planned 2.1.0)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 13:19:03 +02:00
joshuaandClaude Opus 5.5 591266c758 Docs: upgrading to 2.1 (job key, ports, servers), changelog
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 13:18:49 +02:00
joshuaandClaude Opus 5.5 c8359c77e9 Servers and the agent, dashboard (2.1.0): servers, installs, updates, jobs, ports, download page
- Servers: add with a one-time join command, each server's CPU / RAM
  charts (24 h, 7 days, 90 days, spikes over 85% marked, table view),
  configuration, PM2 processes, sites, jobs and alerts.
- Installs: New install (server chooser with free RAM, CPU and sites),
  Link existing, FastPanel steps and Proxy done, schedule / emergency
  update, adopt, uninstall (2FA and the short name).
- Updates: one release to many installs (a batch), planned jobs.
- Jobs with their reports; Ports & defaults; the public download page
  that decrypts an export in the browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 13:18:20 +02:00
joshuaandClaude Opus 5.5 041461f2b5 Servers and the agent, backend (2.1.0): join, jobs, schedules, port list, stats, alerts
- Agent API /api/agent/v1: join with a one-time token, then poll, stats,
  report and export upload, all signed with the server's Ed25519 key.
- Jobs signed with a separate job key (HUB_JOB_SIGNING_KEY_FILE) when
  delivered, config sealed to the server; one at a time per server;
  missed when not picked up in their window.
- New install (licence, ports, preflight against the release's env
  template), Proxy done with public URL checks, scheduled / emergency
  (2FA, reason) / batch updates with email and banner, uninstall with
  an encrypted export first (the key is never stored), adopt and
  linking existing installs, purge after 30 days.
- Port list, install defaults, server configuration (encrypted), stats
  per minute / hour with roll-up, server alerts. contracts 1.3.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 13:12:28 +02:00
joshuaandClaude Opus 5.5 9aa06ae894 Docs: token AI status is shown from Cross Events 2.2.0 (was planned for 2.3.0)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:38:33 +02:00
joshuaandClaude Opus 5.5 44e65bb563 Release 2.0.1: AI use in tokens for churches, default markup 15%
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v2.0.1
2026-11-17 11:27:45 +02:00
joshua a0ceecbb25 Merge branch 'feat/ai-tokens' 2026-11-17 11:27:32 +02:00
joshuaandClaude Opus 5.5 fd76961391 AI: default markup 15% (was 40%)
Saved settings and per-customer markups are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:25:59 +02:00
joshuaandClaude Opus 5.5 7cd59ed651 AI status: tokens used and an estimated allowance in tokens, for churches (2.0.1)
Churches see their AI use as input/output tokens; rand stays on the Hub.
The status also carries usedInputTokens/usedOutputTokens and
capInputTokens/capOutputTokens (half the cap priced as input, half as
output). Cents unchanged for older installs. Protocol §3b updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 10:58:49 +02:00
joshua bee19b494e Merge branch 'docs/roadmap-moved' 2026-11-05 09:48:40 +02:00
joshuaandClaude Opus 5.5 5f416c828b Docs: point to the roadmap and protocol in crosscode-platform
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 09:48:37 +02:00
joshuaandClaude Opus 5.5 dbcfc92d65 Merge branch 'release/2.0' (2.0.0: release commit)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v2.0.0
2026-11-05 09:07:47 +02:00
joshuaandClaude Opus 5.5 595cdf71a5 Merge branch 'release/2.0' (2.0.0)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 09:07:29 +02:00
joshuaandClaude Opus 5.5 3579d7abe6 Release 2.0.0: Cross Code Hub
Docs: protocol v2 (hub-protocol.md §6), README, deployment.md
(Upgrading to 2.0), plan marked done, CHANGELOG 2.0.0; versions 2.0.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 09:07:16 +02:00
joshuaandClaude Opus 5.5 8a0ed7f155 Merge branch 'feat/hub2-dashboard' into release/2.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 09:03:40 +02:00
joshuaandClaude Opus 5.5 e697564ff5 Hub 2.0 step 7: dashboard per product, revenue, linked products
Dashboard: monthly recurring revenue after discounts, overdue invoices,
per-product installs, latest version, behind, critical and licences.
Install page: the church's other products and whether they're listed to
this site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 09:03:39 +02:00
joshuaandClaude Opus 5.5 255ac6ae6e Merge branch 'feat/hub2-ai' into release/2.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 08:55:45 +02:00
joshuaandClaude Opus 5.5 59e6b9f03c Hub 2.0 step 6: AI cap and markup per church
The cap and markup move from the licence to the customer (migrated), use
is counted over all the church's installs under one lock per church, and
the licence token carries the church's cap. Settings → AI shows product.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 08:55:43 +02:00
joshuaandClaude Opus 5.5 6e51780103 Merge branch 'feat/hub2-address' into release/2.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 16:24:11 +02:00
joshuaandClaude Opus 5.5 fbbf72dcd8 Hub 2.0 step 5: the church's address
Own domain R0, Cross Code address R10, domain included R25 (custom price
for other endings), once per invoice and never discounted; renewal date
with a reminder 30 days before, once per renewal, and Renewed to move it on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 16:24:10 +02:00
joshuaandClaude Opus 5.5 fff1c6f4ef Merge branch 'feat/hub2-billing' into release/2.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 16:18:25 +02:00
joshuaandClaude Opus 5.5 7478e84e9d Hub 2.0 step 4: billing per customer
- One invoice per customer per period for all its products; the schedule
  moves from Licence to Customer (migration copies it, so billing carries
  on unchanged); licences get billedFrom / billedUntil
- Website (R99, 5 GB) and App (on active members) prices next to the
  Events tiers; founding prices per product, then bundles (15% two, 25%
  three); extra website storage R20 per 5 GB, never discounted
- A product added to a billed customer starts after its free month; days
  before its first full period are prorated, never charged twice
- Annual review per product (Events income, App members), one notice of
  licence change per product; invoices, PDFs and emails name products
- Customer page: schedule, per-product billing, next-invoice preview
- Invoices from before 2.0 kept as they were (still recalculable)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 16:18:23 +02:00
joshuaandClaude Opus 5.5 937c1fa38e Merge branch 'feat/hub2-releases' into release/2.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 15:57:47 +02:00
joshuaandClaude Opus 5.5 816452e1c2 Hub 2.0 step 3: releases per product, with requirements
- Release.product and requires; unique (product, version); latest version
  per product (latest_version stays Cross Events' latest)
- Release sources per product (Releases page): repository, tag prefix,
  notes file. Defaults: every product from crosscode-platform plus Cross
  Events' v1.2.3 tags from hope-events. A product's releases are only
  removed when all its sources were read and found tags
- "— requires accounts 1.2.0" in a notes heading: Request update answers
  409 REQUIREMENT_NOT_MET until the church's install of that product is new
  enough; install page and Releases page show it; v2 replies carry requires
- @crosscode/contracts 1.1.0 vendored (optional requires on releases)
- Alerts, dashboard and install lists compare against each product's latest

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 15:57:46 +02:00
joshuaandClaude Opus 5.5 0318b4f6f4 Merge branch 'feat/hub2-protocol' into release/2.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 15:37:03 +02:00
joshuaandClaude Opus 5.5 ab6a0c6914 Hub 2.0 step 2: protocol v2 next to v1
- 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>
2026-11-04 15:37:02 +02:00
joshuaandClaude Opus 5.5 56370419bb Merge branch 'feat/hub2-products' into release/2.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 15:28:07 +02:00
joshuaandClaude Opus 5.5 ad602b2846 Hub 2.0 step 1: products foundation
- Product enum (events, accounts, website, app) on Licence and Install,
  Install.publicKey; existing rows are events
- One open licence per product per customer: partial unique index, with a
  migration guard that names customers with duplicates (npm run check:hub2
  lists them beforehand)
- Licence keys per product (CEH-, CCA-, CCW-, CCP-); free Accounts licence
  created with the first other product licence
- Protocol v1 registers Events licences only (409 WRONG_PRODUCT); only Events
  licences can be invoiced until billing per customer
- Cross Code Hub in the UI, emails and PDFs
- @crosscode/contracts 1.0.0 vendored (backend/vendor)
- Steps merge into release/2.0, not main (plan updated)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 15:28:06 +02:00
joshuaandClaude Opus 5.5 fe0f2638c6 Merge branch 'docs/hub-2-plan'
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 15:18:18 +02:00
joshuaandClaude Opus 5.5 788ab39dd1 Docs: Hub 2.0.0 plan
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 15:18:17 +02:00