From a1e3f9214bc1ca4d201aa4c29ceef918b203bfcb Mon Sep 17 00:00:00 2001 From: Joshua Oosthuizen Date: Tue, 27 Oct 2026 13:38:52 +0200 Subject: [PATCH] Rename to Cross Events Hub; add logo and favicon Hope Events is now Cross Events. Protocol identifiers (hel1. tokens, CEH- keys) are unchanged so existing installs keep working. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 15 ++++++++++-- README.md | 22 +++++++++++------- backend/.env.example | 2 +- backend/package.json | 2 +- backend/prisma/schema.prisma | 4 ++-- backend/scripts/generate-keys.js | 4 ++-- backend/src/utils/alerts.js | 2 +- backend/src/utils/totp.js | 2 +- deployment.md | 10 ++++---- docs/hub-protocol.md | 4 ++-- .../src/app/(hub)/customers/[id]/page.tsx | 2 +- frontend/src/app/(hub)/layout.tsx | 8 ++++--- frontend/src/app/(hub)/page.tsx | 2 +- frontend/src/app/(hub)/settings/page.tsx | 4 ++-- frontend/src/app/apple-icon.png | Bin 0 -> 678 bytes frontend/src/app/favicon.ico | Bin 0 -> 707 bytes frontend/src/app/icon.svg | 4 ++++ frontend/src/app/layout.tsx | 4 ++-- frontend/src/app/login/page.tsx | 4 +++- frontend/src/components/ui.tsx | 17 ++++++++++++++ 20 files changed, 76 insertions(+), 36 deletions(-) create mode 100644 frontend/src/app/apple-icon.png create mode 100644 frontend/src/app/favicon.ico create mode 100644 frontend/src/app/icon.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index 673830b..2f97de3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,21 @@ # Changelog -All notable changes to the Hope Events Hub. Format: [Keep a Changelog](https://keepachangelog.com/en/1.0.0/); +All notable changes to the Cross Events Hub. Format: [Keep a Changelog](https://keepachangelog.com/en/1.0.0/); versions follow [Semantic Versioning](https://semver.org/). ## [Unreleased] +### 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 @@ -13,7 +24,7 @@ versions follow [Semantic Versioning](https://semver.org/). - 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 Hope Events 2.0). + 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 / diff --git a/README.md b/README.md index bcc82db..6486fef 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,15 @@ -# Hope Events Hub +# Cross Events Hub -Joshua's central management app for every **Hope Events** install: customers, licences, +Joshua's central management app for every **Cross Events** install: customers, licences, install health and usage, and alerts. Customers never log in here. +> **Naming:** Cross Events was called **Hope Events** until October 2026. Older commits, the +> `hope-events` repo name and the `hel1.` licence-token prefix still use the old name. The +> prefix is part of the protocol, so it stays. + - `backend/` — Express + Prisma (Postgres) API, port 5200 - `frontend/` — Next.js dashboard, port 3200 -- `docs/hub-protocol.md` — the contract with Hope Events installs (a copy lives in the +- `docs/hub-protocol.md` — the contract with Cross Events installs (a copy lives in the `hope-events` repo; change both together) Installs only ever call the Hub (register, heartbeat); the Hub never reaches into an install @@ -32,25 +36,25 @@ npm run dev # http://localhost:3200 The first login sets up two-factor with an authenticator app (required). -To try it with Hope Events locally, point the install at the Hub with `HUB_URL=http://localhost:5200` -and `HUB_PUBLIC_KEY` (the public key shown in Hub → Settings) in Hope Events' `backend/.env`. +To try it with Cross Events locally, point the install at the Hub with `HUB_URL=http://localhost:5200` +and `HUB_PUBLIC_KEY` (the public key shown in Hub → Settings) in Cross Events' `backend/.env`. ## The licence signing key Licences are tokens signed with an Ed25519 key. **The private key exists only on the Hub server**; -installs check licences with the public key, which is built into Hope Events +installs check licences with the public key, which is built into Cross Events (`backend/src/hub/publicKey.js`). - Create the production key once, on the Hub server: `npm run generate-keys`. Back up `keys/hub-signing-key.pem` somewhere safe and offline. -- Put the public key it prints into Hope Events (`backend/src/hub/publicKey.js`) and release. -- Losing or replacing the key means every install needs a Hope Events update with the new +- Put the public key it prints into Cross Events (`backend/src/hub/publicKey.js`) and release. +- Losing or replacing the key means every install needs a Cross Events update with the new public key before it can trust new licences — so don't. - `HUB_ENCRYPTION_KEY` encrypts install secrets: it must never change after installs register. ## Deploying -Same pattern as Hope Events: on the server (`events-hub.crosscode.co.za`), behind nginx with +Same pattern as Cross Events: on the server (`events-hub.crosscode.co.za`), behind nginx with HTTPS, two PM2 processes (`backend`: `npm start`; `frontend`: `npm run build && npm start`), `TRUST_PROXY=1`, `FRONTEND_URL=https://events-hub.crosscode.co.za`, and the frontend's `NEXT_PUBLIC_API_URL` set to the public API address (e.g. `https://events-hub.crosscode.co.za` diff --git a/backend/.env.example b/backend/.env.example index 1752a32..bb2f4a3 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -1,4 +1,4 @@ -# ─── Hope Events Hub — backend ──────────────────────────────────────────────── +# ─── Cross Events Hub — backend ──────────────────────────────────────────────── PORT=5200 DATABASE_URL=postgresql://postgres:password@localhost:5432/events_hub # Where the Hub's dashboard runs (CORS, links in alert emails) diff --git a/backend/package.json b/backend/package.json index 649c327..78abf7d 100644 --- a/backend/package.json +++ b/backend/package.json @@ -2,7 +2,7 @@ "name": "events-hub-backend", "version": "1.0.0", "private": true, - "description": "Hope Events Hub — API for managing Hope Events installs, licences and heartbeats", + "description": "Cross Events Hub — API for managing Cross Events installs, licences and heartbeats", "main": "src/index.js", "engines": { "node": ">=20" diff --git a/backend/prisma/schema.prisma b/backend/prisma/schema.prisma index 5e47324..539560c 100644 --- a/backend/prisma/schema.prisma +++ b/backend/prisma/schema.prisma @@ -1,4 +1,4 @@ -// Hope Events Hub — customers, licences, installs and their heartbeats. +// Cross Events Hub — customers, licences, installs and their heartbeats. generator client { provider = "prisma-client-js" @@ -55,7 +55,7 @@ model Licence { // Null = no end date. expiresAt DateTime? graceDays Int @default(14) - // Hope Events 2.0: monthly AI spend cap (in cents, rand). 0 = AI off. + // Cross Events 2.0: monthly AI spend cap (in cents, rand). 0 = AI off. aiMonthlyCapCents Int @default(0) notes String? createdAt DateTime @default(now()) diff --git a/backend/scripts/generate-keys.js b/backend/scripts/generate-keys.js index a84c9c5..3f54294 100644 --- a/backend/scripts/generate-keys.js +++ b/backend/scripts/generate-keys.js @@ -5,7 +5,7 @@ * npm run generate-keys -- --force → replace it (every install then needs the new public key!) * * The private key stays on the Hub server only — back it up somewhere safe. The public key it - * prints goes into Hope Events (backend/src/hub/publicKey.js) so installs can check licences. + * prints goes into Cross Events (backend/src/hub/publicKey.js) so installs can check licences. */ const crypto = require('crypto'); @@ -26,5 +26,5 @@ fs.writeFileSync(file, privateKey.export({ type: 'pkcs8', format: 'pem' }), { mo console.log(`Private key written to ${file} — keep it secret and back it up.`); console.log('Set HUB_SIGNING_KEY_FILE to that path in .env.\n'); -console.log('Public key (for Hope Events, backend/src/hub/publicKey.js):\n'); +console.log('Public key (for Cross Events, backend/src/hub/publicKey.js):\n'); console.log(publicKey.export({ type: 'spki', format: 'pem' })); diff --git a/backend/src/utils/alerts.js b/backend/src/utils/alerts.js index b00b458..42fc3cf 100644 --- a/backend/src/utils/alerts.js +++ b/backend/src/utils/alerts.js @@ -105,7 +105,7 @@ async function runAlerts(now = new Date()) { if (newAlerts.length && settings.alert_email) { await sendMail({ to: settings.alert_email, - subject: `Hope Events Hub: ${newAlerts.length} new alert${newAlerts.length === 1 ? '' : 's'}`, + subject: `Cross Events Hub: ${newAlerts.length} new alert${newAlerts.length === 1 ? '' : 's'}`, text: `${newAlerts.join('\n')}\n\n${(process.env.FRONTEND_URL || '').replace(/\/$/, '')}/`, }).catch(e => console.warn('[alerts] email failed:', e?.message)); } diff --git a/backend/src/utils/totp.js b/backend/src/utils/totp.js index 478e2a9..95cff03 100644 --- a/backend/src/utils/totp.js +++ b/backend/src/utils/totp.js @@ -67,7 +67,7 @@ function verifyCode(secret, code, now = Date.now()) { } /** The otpauth:// link an authenticator app scans (as a QR code). */ -function otpauthUrl(secret, account, issuer = 'Hope Events Hub') { +function otpauthUrl(secret, account, issuer = 'Cross Events Hub') { return `otpauth://totp/${encodeURIComponent(issuer)}:${encodeURIComponent(account)}?secret=${secret}&issuer=${encodeURIComponent(issuer)}&algorithm=SHA1&digits=6&period=${STEP}`; } diff --git a/deployment.md b/deployment.md index 3ec344c..855ef17 100644 --- a/deployment.md +++ b/deployment.md @@ -26,7 +26,7 @@ Replace `` below with the system user FASTPANEL creates for the site. - PostgreSQL 14+ - Git access to this repo -If Hope Events is already deployed on this server, you already have all of these. +If Cross Events is already deployed on this server, you already have all of these. --- @@ -157,7 +157,7 @@ npm run generate-keys # only on the very first deploy; it refuses to ov npm run create-admin -- --email you@example.com --name "Your Name" ``` -`generate-keys` prints the **public key**. Put it into Hope Events +`generate-keys` prints the **public key**. Put it into Cross Events (`backend/src/hub/publicKey.js`) and release. Copy `keys/hub-signing-key.pem` somewhere safe and offline **now** (see step 11). @@ -186,7 +186,7 @@ pm2 start npm --name events-hub-frontend --cwd frontend -- start pm2 save ``` -The names are different from Hope Events' `backend` / `frontend` processes, so the two don't +The names are different from Cross Events' `backend` / `frontend` processes, so the two don't clash on the same server. Start on boot (run once; it prints a `sudo` command to paste): @@ -259,9 +259,9 @@ curl -s https://events-hub.crosscode.co.za/api/health # {"ok":true} ``` Then open `https://events-hub.crosscode.co.za`, log in, and set up two-factor (required on -first login). In **Settings**, check that the public key shown matches the one in Hope Events. +first login). In **Settings**, check that the public key shown matches the one in Cross Events. -Point Hope Events installs at the Hub with `HUB_URL=https://events-hub.crosscode.co.za` in their +Point Cross Events installs at the Hub with `HUB_URL=https://events-hub.crosscode.co.za` in their `backend/.env`. --- diff --git a/docs/hub-protocol.md b/docs/hub-protocol.md index 65779b6..6e8f462 100644 --- a/docs/hub-protocol.md +++ b/docs/hub-protocol.md @@ -1,6 +1,6 @@ # Hub protocol (version 1) -The contract between a **Hope Events install** (the church's site) and the **Hope Events +The contract between a **Cross Events install** (the church's site) and the **Cross Events Hub** (`events-hub.crosscode.co.za`). A copy of this file lives in both repositories (`joshua/hope-events` → `docs/hub-protocol.md`, `joshua/events-hub` → `docs/hub-protocol.md`); change both together. @@ -156,5 +156,5 @@ grace starts). Blocking the Hub can't keep a suspended licence active for more t ## 6. Later (not in v1) -- **AI proxy** (Hope Events 2.0): `POST /api/ai/complete`, signed like the heartbeat; the Hub holds +- **AI proxy** (Cross Events 2.0): `POST /api/ai/complete`, signed like the heartbeat; the Hub holds the Claude API key, meters each call in rand and enforces `limits.aiMonthlyCapCents`. diff --git a/frontend/src/app/(hub)/customers/[id]/page.tsx b/frontend/src/app/(hub)/customers/[id]/page.tsx index 7e634da..e1c0cc9 100644 --- a/frontend/src/app/(hub)/customers/[id]/page.tsx +++ b/frontend/src/app/(hub)/customers/[id]/page.tsx @@ -63,7 +63,7 @@ function LicenceCard({ licence, onSaved, setMsg }: { licence: Licence; onSaved:
{licence.install ? <>Used by {licence.install.url} · last heartbeat {ago(licence.install.lastHeartbeatAt)} - : "Not used yet — enter this key in the church's Hope Events setup (or Site settings → Licence)."} + : "Not used yet — enter this key in the church's Cross Events setup (or Site settings → Licence)."}
diff --git a/frontend/src/app/(hub)/layout.tsx b/frontend/src/app/(hub)/layout.tsx index b9211b6..7e1b00b 100644 --- a/frontend/src/app/(hub)/layout.tsx +++ b/frontend/src/app/(hub)/layout.tsx @@ -5,6 +5,7 @@ import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; import { LayoutDashboard, Building2, BellRing, Settings, LogOut } from "lucide-react"; import { api, getToken, setToken } from "@/lib/api"; +import { Logo } from "@/components/ui"; type Me = { id: string; name: string; email: string }; @@ -34,8 +35,8 @@ export default function HubLayout({ children }: { children: React.ReactNode }) {
-