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 <noreply@anthropic.com>
This commit is contained in:
+13
-2
@@ -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 /
|
||||
|
||||
@@ -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`
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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' }));
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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}`;
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -26,7 +26,7 @@ Replace `<siteuser>` 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`.
|
||||
|
||||
---
|
||||
|
||||
@@ -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`.
|
||||
|
||||
@@ -63,7 +63,7 @@ function LicenceCard({ licence, onSaved, setMsg }: { licence: Licence; onSaved:
|
||||
<div className="text-sm text-slate-600">
|
||||
{licence.install
|
||||
? <>Used by <Link href={`/installs/${licence.install.id}`} className="text-indigo-600 hover:underline">{licence.install.url}</Link> · 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)."}
|
||||
</div>
|
||||
<div className="grid gap-3 sm:grid-cols-4">
|
||||
<div>
|
||||
|
||||
@@ -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 }) {
|
||||
<div className="flex min-h-screen">
|
||||
<aside className="hidden w-56 shrink-0 border-r border-slate-200 bg-white p-4 md:flex md:flex-col">
|
||||
<div className="mb-6 px-2">
|
||||
<div className="text-base font-semibold">Hope Events Hub</div>
|
||||
<div className="text-xs text-slate-500">{me.name}</div>
|
||||
<Logo />
|
||||
<div className="mt-1 pl-[2.625rem] text-xs text-slate-500">{me.name}</div>
|
||||
</div>
|
||||
<nav className="space-y-1">
|
||||
{NAV.map(n => {
|
||||
@@ -52,7 +53,8 @@ export default function HubLayout({ children }: { children: React.ReactNode }) {
|
||||
</button>
|
||||
</aside>
|
||||
<div className="flex-1 min-w-0">
|
||||
<nav className="flex gap-1 overflow-x-auto border-b border-slate-200 bg-white px-3 py-2 md:hidden">
|
||||
<nav className="flex items-center gap-1 overflow-x-auto border-b border-slate-200 bg-white px-3 py-2 md:hidden">
|
||||
<Logo markOnly className="mr-1 h-7 w-7" />
|
||||
{NAV.map(n => (
|
||||
<Link key={n.href} href={n.href} className={`whitespace-nowrap rounded-lg px-3 py-1.5 text-sm ${active(n.href) ? "bg-indigo-50 font-medium text-indigo-700" : "text-slate-600"}`}>{n.label}</Link>
|
||||
))}
|
||||
|
||||
@@ -42,7 +42,7 @@ export default function OverviewPage() {
|
||||
|
||||
{data.installs.length === 0 ? (
|
||||
<div className="card text-sm text-slate-600">
|
||||
No installs yet. Add a <Link href="/customers" className="text-indigo-600 hover:underline">customer</Link>, generate a licence, and enter its key in the church's Hope Events setup.
|
||||
No installs yet. Add a <Link href="/customers" className="text-indigo-600 hover:underline">customer</Link>, generate a licence, and enter its key in the church's Cross Events setup.
|
||||
</div>
|
||||
) : (
|
||||
<div className="card overflow-x-auto p-0">
|
||||
|
||||
@@ -10,7 +10,7 @@ type AuditRow = { id: string; action: string; target: string | null; metadata: u
|
||||
type Msg = { type: "ok" | "err"; text: string } | null;
|
||||
|
||||
const FIELDS: { key: string; label: string; hint: string; type?: string }[] = [
|
||||
{ key: "latest_version", label: "Latest Hope Events release", hint: "e.g. 1.41.0 — installs on an older version show as behind, and see \"Update available\"." },
|
||||
{ key: "latest_version", label: "Latest Cross Events release", hint: "e.g. 1.41.0 — installs on an older version show as behind, and see \"Update available\"." },
|
||||
{ key: "alert_email", label: "Alert email", hint: "Where new alerts are sent.", type: "email" },
|
||||
{ key: "offline_minutes", label: "Offline after (minutes without a heartbeat)", hint: "Default 60.", type: "number" },
|
||||
{ key: "backup_max_age_hours", label: "Backup too old after (hours)", hint: "Default 48.", type: "number" },
|
||||
@@ -81,7 +81,7 @@ export default function SettingsPage() {
|
||||
<div className="space-y-6">
|
||||
<div className="card space-y-2">
|
||||
<h2 className="font-semibold">Licence signing key</h2>
|
||||
<p className="text-sm text-slate-600">Installs check licences with this public key (built into Hope Events: <code>backend/src/hub/publicKey.js</code>). The private key stays on this server only — keep a backup.</p>
|
||||
<p className="text-sm text-slate-600">Installs check licences with this public key (built into Cross Events: <code>backend/src/hub/publicKey.js</code>). The private key stays on this server only — keep a backup.</p>
|
||||
<pre className="overflow-x-auto rounded-lg bg-slate-50 p-3 text-xs">{publicKey}</pre>
|
||||
</div>
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 678 B |
Binary file not shown.
|
After Width: | Height: | Size: 707 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||
<rect width="64" height="64" rx="14" fill="#4f46e5"/>
|
||||
<path d="M28 12h8v10h10v8H36v22h-8V30H18v-8h10z" fill="#fff"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 189 B |
@@ -2,8 +2,8 @@ import type { Metadata } from "next";
|
||||
import "./globals.css";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Hope Events Hub",
|
||||
description: "Installs, licences and health for Hope Events",
|
||||
title: "Cross Events Hub",
|
||||
description: "Installs, licences and health for Cross Events",
|
||||
robots: { index: false, follow: false },
|
||||
};
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import React, { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { api, errorText, setToken } from "@/lib/api";
|
||||
import { Logo } from "@/components/ui";
|
||||
|
||||
type LoginResponse = { token?: string; twoFactorRequired?: boolean; challengeToken?: string; setupRequired?: boolean; setupToken?: string };
|
||||
type SetupResponse = { secret: string; otpauthUrl: string; qrDataUrl: string };
|
||||
@@ -55,7 +56,8 @@ export default function LoginPage() {
|
||||
return (
|
||||
<div className="flex min-h-screen items-center justify-center p-4">
|
||||
<div className="card w-full max-w-sm">
|
||||
<h1 className="text-xl font-semibold">Hope Events Hub</h1>
|
||||
<Logo markOnly className="mb-3 h-10 w-10" />
|
||||
<h1 className="text-xl font-semibold">Cross Events Hub</h1>
|
||||
{step === "password" && (
|
||||
<form onSubmit={submitPassword} className="mt-5 space-y-4">
|
||||
<div>
|
||||
|
||||
@@ -12,6 +12,23 @@ const STATUS_TONE: Record<string, string> = {
|
||||
};
|
||||
const STATUS_LABEL: Record<string, string> = { ok: "Healthy", warning: "Warning", critical: "Critical", info: "Info" };
|
||||
|
||||
/** The Cross Events Hub mark (same artwork as app/icon.svg), with the name beside it unless markOnly. */
|
||||
export function Logo({ className = "h-8 w-8", markOnly }: { className?: string; markOnly?: boolean }) {
|
||||
const mark = (
|
||||
<svg viewBox="0 0 64 64" className={`${className} shrink-0`} aria-hidden="true">
|
||||
<rect width="64" height="64" rx="14" fill="#4f46e5" />
|
||||
<path d="M28 12h8v10h10v8H36v22h-8V30H18v-8h10z" fill="#fff" />
|
||||
</svg>
|
||||
);
|
||||
if (markOnly) return mark;
|
||||
return (
|
||||
<span className="flex items-center gap-2.5">
|
||||
{mark}
|
||||
<span className="font-semibold leading-tight">Cross Events Hub</span>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
export function Badge({ value, label }: { value: Problem["level"] | "ok" | LicenceStatus; label?: string }) {
|
||||
return (
|
||||
<span className={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ring-1 ring-inset ${STATUS_TONE[value] || STATUS_TONE.info}`}>
|
||||
|
||||
Reference in New Issue
Block a user