Skip to content

merge main#8

Merged
derpixler merged 16 commits into
feat/analytics-dashboardfrom
main
Jun 15, 2026
Merged

merge main#8
derpixler merged 16 commits into
feat/analytics-dashboardfrom
main

Conversation

@derpixler

Copy link
Copy Markdown
Owner

No description provided.

derpixler and others added 16 commits June 13, 2026 11:57
- ADMIN_TOKEN: remove "raido-admin" default fallback — hub refuses to
  start if the env var is not set explicitly
- docker_mgr: validate station_id against [a-z0-9][a-z0-9_-]{0,62}
  before using it to construct file system paths (path traversal)
- persona_generator: content safety check now fail-closed — LLM
  unavailability rejects the persona instead of silently approving it
- hub/web: add esc() HTML-escape helper; apply to all LLM-sourced
  values rendered via innerHTML in renderStationPreview/renderDjPreview

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add slowapi (0.1.9) and apply per-IP rate limits to visitor-facing
endpoints so LLM costs cannot be exhausted by anonymous traffic:

- /generate-persona*, /generate-persona/station, /generate-persona/dj
  limited to PERSONA_RATE_LIMIT (default 3/hour, env-configurable)
- /admin/drop-comment and /admin/drop-request moved to public URLs
  /drop-comment and /drop-request, limited to DROP_RATE_LIMIT
  (default 5/hour) — listeners can send comments/requests without
  an admin token
- Hub frontend: dropContent() routes listener_comment and
  music_request to the new public endpoints without auth header;
  the drop buttons for those two categories are now always visible

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The 30-minute time filter on the play_history query caused the stream
to appear empty on connect whenever the station had been idle or was
freshly restarted — all tracks were outside the window. Revert to
LIMIT-only, matching the original behaviour before fdf7b25.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Track which personas are currently live by maintaining _runningSlugSet
in loadStations(). In the Generated Personas list, a running persona
shows a green "● on air" badge instead of the start and delete buttons,
preventing double-starts and accidental deletion of live stations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All system prompts moved from inline Python strings to domain-organized .prompt files:
- hub/prompts/persona/ — persona schema, system, tracks, station, DJ, safety
- hub/prompts/ads/ — ad generation
- hub/prompts/content/ — content population
- station/prompts/dj/ — DJ system (de/en), naming, ad reading (de/en)
- station/prompts/sanitizer/ — input filter

New prompt_loader.py utility in both hub/ and station/ for loading from files.
Dockerfiles updated to COPY prompts/ directory into containers.
Prompts can now be edited without code changes.
All system prompts moved from inline Python strings to domain-organized .prompt files:
- hub/prompts/persona/ — persona schema, system, tracks, station, DJ, safety
- hub/prompts/ads/ — ad generation
- hub/prompts/content/ — content population
- station/prompts/dj/ — DJ system (de/en), naming, ad reading (de/en)
- station/prompts/sanitizer/ — input filter

New prompt_loader.py utility in both hub/ and station/ for loading from files.
Dockerfiles updated to COPY prompts/ directory into containers.
Prompts can now be edited without code changes.
security: harden admin token, path traversal, content safety, XSS
feat: IP rate limiting for public endpoints via slowapi
refactor: Externalize all LLM prompts into .md files
feat: Token Usage Tracking — Call-Level Logging + Balance Checker
feat: show on-air indicator for running personas in hub UI
fix: show full track history on stream connect
@derpixler derpixler merged commit c79a0b5 into feat/analytics-dashboard Jun 15, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant