Update hivegrid-cloud reference to latest main

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
davidandClaude Fable 5 committed 2026-07-08 16:15:37 +02:00
1 parent e98d38e716
commit 7b21524c86
3781 files changed
+373484 -225607

No files matched your search

@@ -12,7 +12,7 @@ statements.
- Use the Pino logger appropriate to your runtime — never `console.*`.
- Pino argument order: **object first, message string second**.
- Never log raw PII (email, password, token, full prompt body, full
webhook payload, Stripe card data).
webhook payload, Legacy-Provider card data).
- Errors go in the `err` field so Pino's built-in serializer kicks in.
## Which logger?
@@ -22,7 +22,7 @@ statements.
| React Router web (SSR / loaders / actions / `.server.ts`) | `webLogger` (or `createScopedLogger("scope")`) | `apps/web/app/utils/logger.server.ts` |
| Hono API service | `apiLogger` | `apps/api/src/logger.ts` |
| BullMQ worker | `workerLogger` | `apps/worker/src/logger.ts` |
| Package code (`packages/*/src/**`) | `createChildLogger(defaultLogger, { component: "<pkg-name>", scope: "<feature>" })` from `@toolctrl/logger` | `packages/logger/src/index.ts` |
| Package code (`packages/*/src/**`) | `createChildLogger(defaultLogger, { component: "<pkg-name>", scope: "<feature>" })` from `@hivegrid/logger` | `packages/logger/src/index.ts` |
For larger files / modules, scope your logger:
@@ -78,7 +78,7 @@ Never log these — even if the user "doesn't think they matter":
- AI **prompt bodies** — only log `{ promptHash, promptLength, model, tenantId }`.
See `apps/web/app/modules/promptBuilder/services/.server/PromptBuilderService.ts`
`hashPrompt()` for the SHA-256 helper.
- Stripe **webhook bodies** — log only `{ eventType, eventId }`.
- Legacy-Provider **webhook bodies** — log only `{ eventType, eventId }`.
- ConvertKit / CRM API **response bodies** (contain subscriber email).
- Request **headers** containing `authorization`, `cookie`, `set-cookie`.
@@ -170,24 +170,22 @@ promptLogger.info(
);
```
### Stripe / webhook (PII-safe)
### Legacy-Provider / webhook (PII-safe)
```ts
pricingLogger.info(
{
op: "stripe.webhook.received",
op: "legacyProvider.webhook.received",
eventType: event.type,
eventId: event.id,
livemode: event.livemode,
},
"Stripe webhook received",
"Legacy-Provider webhook received",
);
```
## See also
- `docs/improvement-plan/02-observability/logging-migration.md` — full
task spec (Task #34) including PII rationale.
- `packages/logger/src/index.ts` — Pino setup + redact paths.
- `scripts/observability/scan-console.ts` — inventory script.
- `docs/observability/console-migration-inventory.md` — auto-generated
@@ -17,7 +17,7 @@ the three application processes and renders five dashboards.
/metrics
```
- All three apps are instrumented via [`@toolctrl/metrics`](../../packages/metrics).
- All three apps are instrumented via [`@hivegrid/metrics`](../../packages/metrics).
- `/status` is public, JSON, 200 / 503 — suitable for Uptime Kuma.
- `/metrics` is bearer-token protected, returns Prom text-format.
- Both endpoints are gated by `METRICS_ENABLED=true`; default off in dev.
@@ -62,7 +62,7 @@ new-account, invitation.
| `active_tenants` | gauge | — | Tenant growth. |
| `active_users_24h` | gauge | — | DAU. |
| `ai_tokens_consumed_total` | counter | provider, model, tenant_bucket | AI spend allocation. |
| `stripe_webhook_events_total` | counter | event_type, status | Stripe traffic + spoof attempts. |
| `billing_provider_webhook_events_total` | counter | event_type, status | Billing webhook traffic + spoof attempts. |
| `mail_sent_total` | counter | provider, status | Email reliability. |
| `webhook_delivery_attempts_total` | counter | status | Outbound webhook health (success / retry / dlq / rejected). |
| `csrf_token_rotation_total` | counter | — | Auth churn. |
@@ -1,8 +1,7 @@
# Performance Baseline — Phase 02 Quickwins (Task #36)
This document tracks the expected and observed effect of the 8 quickwin
optimizations shipped under task #36
(`docs/improvement-plan/02-observability/performance-quickwins.md`).
optimizations shipped under task #36.
## Status
@@ -63,7 +62,7 @@ evidence and should be recorded only from the target environment.
| Prisma query count / request (admin users list) | TBD | TBD | TBD |
| p95 latency, signed-URL endpoint | TBD | TBD | TBD |
| p95 latency, login flow | TBD | TBD | TBD |
| Cache evictions per Stripe webhook | TBD | TBD | TBD |
| Cache evictions per Legacy-Provider webhook | TBD | TBD | TBD |
| CSRF cookie size (bytes) | ~136 hex equiv. | 64 | -53% |
## Notes
@@ -73,9 +72,7 @@ evidence and should be recorded only from the target environment.
- Item 5 was already in tree from `83a57f1c fix: enforce csrf on settings
mutations`. It is recorded here for completeness and now carries an
explicit no-body-read assertion.
- Path corrections were necessary on items 2 and 6 — see the per-item
Progress Log entries in
`docs/improvement-plan/02-observability/performance-quickwins.md`.
- Path corrections were necessary on items 2 and 6.
## Footer
@@ -47,7 +47,7 @@ The following components/routes MUST be annotated by the time the staging-smoke
### Billing & Payment
- Any Stripe Elements iframe — automatically masked by Stripe (no action needed).
- Any Legacy-Provider Elements iframe — automatically masked by Legacy-Provider (no action needed).
- Custom payment forms (e.g. invoice address) → `sentry-block`.
- Saved-card list display → `sentry-mask`.
@@ -92,6 +92,5 @@ Never add `*` to `networkDetailAllowUrls`.
## Cross-references
- Task spec: `docs/improvement-plan/02-observability/sentry-wiring-web.md`
- Server-side PII strategy: `apps/web/app/sentry.server.ts` (`requestDataIntegration` with `ip: false`)
- Query-string scrubbing: `apps/web/app/sentry.client.ts#scrubSensitiveQueryParams`
@@ -1,12 +1,9 @@
# Self-Hosted Sentry — Operations Runbook
This runbook covers the **self-hosted Sentry deployment** that lives in
`infra/sentry/`. It is the operational companion to
`docs/improvement-plan/02-observability/sentry-selfhost-setup.md` (the
planning artefact) and assumes you have current operator-approved SSH access to
the `boilerplate-staging` host. The archived
`docs/improvement-plan/archive/STAGING-ACCESS.md` file is historical inventory
only; prefer live Coolify/Hetzner access records when they differ.
`infra/sentry/`. It assumes you have current operator-approved SSH access to
the target host. Prefer live Coolify/Hetzner access records over historical
staging inventory.
For the lightweight alternative (GlitchTip, no Performance/Replay/OTLP), see
[`sentry-glitchtip-alternative.md`](./sentry-glitchtip-alternative.md).
@@ -33,7 +30,7 @@ For the lightweight alternative (GlitchTip, no Performance/Replay/OTLP), see
```bash
cd /data/coolify/services/sentry
git clone git@git.tool-ctrl.de:toolctrl-labs/boilerplate.git .
git clone git@git.tool-ctrl.de:toolctrl-labs/HiveGrid-Cloud.git .
cd infra/sentry
cp .env.example .env
# Edit .env — fill SENTRY_ADMIN_EMAIL, SENTRY_ADMIN_PASSWORD,
@@ -69,18 +66,18 @@ For the lightweight alternative (GlitchTip, no Performance/Replay/OTLP), see
```
5. **Create the three Sentry projects** in the Sentry UI:
- `boilerplate-api`
- `boilerplate-worker`
- `boilerplate-web`
- `hivegrid-api`
- `hivegrid-worker`
- `hivegrid-web`
Copy their DSNs into `infra/sentry/.env` (`SENTRY_DSN_API`,
`SENTRY_DSN_WORKER`, `SENTRY_DSN_WEB`) and into the Coolify secret
vault for the respective app containers. The five Coolify worker apps
(`worker-general`, `worker-mail`, `worker-import`, `worker-webhook`,
`worker-plugin`) intentionally share the server-side
`boilerplate-worker` project and `SENTRY_DSN_WORKER` unless the operator
`hivegrid-worker` project and `SENTRY_DSN_WORKER` unless the operator
explicitly creates per-group Sentry projects later. Per-project
allowed-domains list is filled in for the `boilerplate-web` project only
allowed-domains list is filled in for the `hivegrid-web` project only
(API + Worker DSNs are server-side, no browser exposure).
6. **Enable 2FA** on the admin account immediately (User Settings →
@@ -254,11 +251,11 @@ a one-time operator pass plus a quarterly review.
at 100 events/sec. Verify by sending a burst and watching for
`429` responses.
- [ ] **Per-project allowed-domains list filled.** Project Settings →
Client Keys → Allowed Domains. Set for `boilerplate-web` to:
Client Keys → Allowed Domains. Set for `hivegrid-web` to:
`https://boiler.saas-ctrl.com`,
`https://www.boiler.saas-ctrl.com`,
`https://admin.boiler.saas-ctrl.com`. Leave **empty** for the
`boilerplate-api` and `boilerplate-worker` projects (server-side
`hivegrid-api` and `hivegrid-worker` projects (server-side
DSNs only).
- [ ] **Postgres / ClickHouse / Kafka / Redis NOT public.**
`docker-compose.override.yml` uses `ports: !reset []` to strip
@@ -278,9 +275,8 @@ a one-time operator pass plus a quarterly review.
backups. Copy from Coolify vault to a hardware-backed password
manager (1Password, BitWarden Premium with TOTP, YubiKey-backed
pass).
- [ ] **Traefik dashboard port 8080 firewalled.** See
`docs/improvement-plan/archive/STAGING-ACCESS.md` open item; close at Hetzner Cloud Firewall
level or front it with basic-auth.
- [ ] **Traefik dashboard port 8080 firewalled.** Close at Hetzner Cloud
Firewall level or front it with basic-auth.
- [ ] **`.env` permissions ≤ 0600.** `ls -l infra/sentry/.env`. The
installer enforces 0600 when it copies the file into the upstream
tree.
@@ -336,7 +332,7 @@ none`.
### 3. Store secrets in Gitea Actions
In Gitea (`git.tool-ctrl.de/toolctrl-labs/boilerplate`) open
In Gitea (`git.tool-ctrl.de/toolctrl-labs/HiveGrid-Cloud`) open
**Repository Settings → Actions → Secrets** and create the same three
secrets (`SENTRY_AUTH_TOKEN`, `SENTRY_ORG`, `SENTRY_URL`) with
identical values. Gitea's secret scoping rules mirror GitHub's, so the
@@ -379,7 +375,7 @@ SENTRY_AUTH_TOKEN=<token> \
SENTRY_ORG=sentry \
SENTRY_URL=https://sentry.boiler.saas-ctrl.com \
bash scripts/ci/sentry-release.sh \
--project boilerplate-api \
--project hivegrid-api \
--environment preview \
--release "$(git rev-parse HEAD)" \
--sourcemaps none