merge main#8
Merged
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.