60 Commits

Author SHA1 Message Date
itsrubberduck
b6a492bb49 hotkey support 2026-06-20 03:17:53 +02:00
leubeem
0154c6d624 fix(security): mandatory cron secret + reject placeholder JWT secrets (SEC-07, OPS-02, SEC-09)
SEC-07 — committed secrets:
- Replace real-looking defaults in .env.example (JWT_SECRET/JWT_REFRESH_SECRET
  "changeme", MANUAL_INVITE_PASSWORD "pm.local@zghl.de") with CHANGE_ME
  placeholders, and drop the personal DOME_LIGHT_WEBHOOK_URL default.
- Add a Nitro startup plugin (server/plugins/validate-secrets.ts) that refuses
  to boot in production when JWT_SECRET is unset, looks like a placeholder, or
  is shorter than 32 chars (warns only in development).

OPS-02 / SEC-09 — cron endpoints:
- requireCronSecret now fails closed: when no CRON_SECRET/KPI_CRON_SECRET is
  configured the endpoint returns 503 instead of being publicly callable
  (previously it allowed the request with a warning). Both cron routes already
  call the guard. Prefer the x-cron-secret header over the loggable ?secret=
  query param; document CRON_SECRET in .env.example.

Operational note: production deployments must now set JWT_SECRET (>=32 chars)
and CRON_SECRET, or the server won't start / crons return 503.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 11:07:27 +02:00
leubeem
f8fdd8bc79 feat(server): per-user AI usage tracking, cost alerting, and endpoint hardening
Usage tracking:
- new UsageEvent collection records every STT/TTS/LLM call per user with
  provider, model, volume (audio seconds, characters, tokens) and an
  estimated USD cost; self-hosted providers (Speaches/Piper) and cache
  hits record at $0
- pricing table for whisper-1, tts-1, gpt-5-nano & co. in server/utils/usage.ts
- weekly KPI mail gains an "AI-Nutzung & Kosten" section: weekly and
  rolling 30-day cost, per-kind breakdown, top 5 users by cost
- quota alert mail when rolling 30-day cost exceeds USAGE_ALERT_USD
  (default $5), at most once per calendar month (UsageAlertDelivery)

Hardening:
- /api/atc/say now requires an authenticated session (middleware
  exemption removed); useFlightLabAudio sends the bearer token
- /api/service/tools/latency requires auth (was a public LLM endpoint)
- per-user rate limits: PTT 20/min, say 60/min, latency 5/min
- cron endpoints (waitlist-drip, weekly-kpi-report) require a shared
  secret via ?secret= or x-cron-secret (CRON_SECRET, falls back to
  KPI_CRON_SECRET); allowed with a warning while unset so existing
  deployments keep working
- PTT records the actual transcribed audio duration for billing accuracy

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 23:17:03 +02:00
leubeem
1e31c7b2e7 Cleanup old unused code and add id sessionId to /api/atc/ptt 2026-05-20 14:13:26 +02:00
itsrubberduck
f38b47acbd Wochenreport 2026-05-06 17:38:36 +02:00
itsrubberduck
73b3d19e33 personal waitlist link 2026-02-17 19:04:52 +01:00
itsrubberduck
8f45c3397d fix typescript errors and update dependencies 2026-02-17 18:13:04 +01:00
itsrubberduck
d34fba5cba add server log 2026-02-17 15:31:32 +01:00
itsrubberduck
3d5a18df6a use 6 digit codes for bridge 2026-02-16 15:47:12 +01:00
itsrubberduck
76471c4bd4 Unify bridge auth header and add live telemetry panel 2026-02-15 16:04:07 +01:00
itsrubberduck
77ecd49334 feat(flightlab): sidebar, progress bars, skip speech, SimBridge telemetry & auth
- Add collapsible sidebar with phase stepper (jump between phases)
- Add SimBridge conditions panel in sidebar (live values, progress bars, targets)
- Add global progress bar (top edge, glowing) + phase-local TTS progress bar
- Add skip button to skip TTS speech while ATC is speaking
- Add skipSpeech() to audio composable (stops current Pizzicato sound)
- Wire up bridge data.post.ts with user auth (JWT) + example payload
- Add server-side telemetry store with pub/sub for Bridge→WS relay
- Extend WS handler with subscribe-telemetry message + userId tracking
- Extend sync composable with subscribeTelemetry() + onTelemetry() callback
- Add require-auth middleware to all flightlab pages
- Fix instructor station ECONNREFUSED via import.meta.client guard
- Add animations: phase transitions, button lists, fade-scale, check-pop, pulse

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 10:14:33 +01:00
itsrubberduck
d90b494334 fix pm 2026-02-13 08:50:02 +01:00
Remi
93fed93d41 Add unsubscribe endpoint and email footers 2025-11-20 23:29:44 +01:00
Remi
040783f679 Style feedback drip email like invites 2025-11-20 21:26:55 +01:00
Remi
86727e7749 Normalize taxi routes for clearer speech 2025-10-18 21:29:56 +02:00
Remi
124d76760b Add reply-to support for admin notifications 2025-10-18 16:33:06 +02:00
Remi
faebc91ebb feat: surface pilot intent from llm decisions 2025-10-16 21:07:21 +02:00
Remi
d9de0c1c93 feat: integrate llm-backed routing with fallback 2025-10-16 19:55:13 +02:00
Remi
4480469c4b Allow configuring OpenAI base URL 2025-10-16 11:15:31 +02:00
itsrubberduck
87b2e3b215 merge 2025-10-12 15:42:18 +02:00
Remi
0bcaf85c23 Add waitlist invitation sending from admin 2025-10-07 12:34:02 +02:00
Remi
5e519cfd03 Simplify decision routing to avoid unnecessary LLM calls 2025-09-25 23:47:05 +02:00
Remi
648003184e Align regex auto selection trace with LLM decisions 2025-09-25 23:35:23 +02:00
Remi
66121fc4fa Refactor route decision selection 2025-09-25 23:00:31 +02:00
Remi
e3c76f452c Point bridge download to GitHub 2025-09-24 00:01:00 +02:00
Remi
d37b8a631c Improve flow activation handling and expose active nodes 2025-09-23 23:12:02 +02:00
Remi
ba93c494c9 Add session timeline logging and admin sessions view 2025-09-21 23:08:10 +02:00
Remi
10cae457f9 Enable flow-aware decision routing 2025-09-21 21:16:33 +02:00
Remi
8189e30946 Extend access token lifetime 2025-09-20 20:53:06 +02:00
Remi
cf6748b9bc Build decision flow editor and runtime integration 2025-09-20 18:33:32 +02:00
itsrubberduck
6999235668 stash 2025-09-20 16:36:35 +02:00
itsrubberduck
59c97d89fc merge 2025-09-20 09:50:20 +02:00
Remi
9577458482 Fix remaining German comment 2025-09-20 09:46:34 +02:00
Remi
1711ed1e5e refactor: share llm decision types 2025-09-20 09:27:45 +02:00
Remi
b22b460513 refactor: centralize radio speech normalization 2025-09-19 09:20:04 +02:00
Remi
db4e30292c Add waitlist admin view and log OpenAI decision traces 2025-09-18 23:30:56 +02:00
Remi
6eb8b98e22 Fix admin notifications formatting 2025-09-18 19:54:04 +02:00
Remi
8a823a4b18 Add readback correction states and improve validation 2025-09-18 19:54:04 +02:00
Remi
de737c5fb7 Refine ATC decision routing and ATIS handling 2025-09-18 19:41:32 +02:00
itsrubberduck
b4710ca0cf log llm call body 2025-09-18 18:21:01 +02:00
Remi
422035dff7 Add ATIS quick actions and airport frequency data 2025-09-18 18:16:40 +02:00
itsrubberduck
31f3aece9e add other flights 2025-09-18 18:08:28 +02:00
Remi
3efd64a5b2 Finalize admin tools and transmission fault flow 2025-09-18 14:03:26 +02:00
Remi
e17169655d Harden runtime config and input validation 2025-09-18 14:03:25 +02:00
Remi
a4b8a0ca2f Align public messaging and add news banners 2025-09-17 19:22:56 +02:00
itsrubberduck
d033f03f88 merge 2025-09-17 17:27:38 +02:00
Remi
c084e4da3a Update contact email to info@opensquawk.de 2025-09-17 17:21:12 +02:00
Remi
1741405c3f Add password reset flow 2025-09-17 16:21:11 +02:00
Remi
e6755d2042 Revise landing messaging and add news feed 2025-09-17 15:44:41 +02:00
Remi
fe66a4c04c Implement authentication, waitlist, and logging upgrades 2025-09-16 17:28:34 +02:00