Commit graph

63 commits

Author SHA1 Message Date
Troll (Hermes Agent)
52415c41fe Show request ID in kiosk queue
Each active request in the kiosk Live Queue now displays its
request number before the customer name (e.g. #42 jess) so
multiple requests from the same email can be distinguished.

Bumps version to 0.5.4.
2026-08-05 20:31:55 +00:00
Troll (Hermes Agent)
52558010e8 Add Live Queue slide to kiosk rotation
- Added a third kiosk slide showing the active customer queue.
- Customer names are derived from the local-part of their email address.
- Statuses are mapped to friendly labels:
    pending -> Received
    prompt_ready / songs_uploaded -> Trollgorithm Recording in Studio
    revisions_requested -> Waiting for Customer Response
    awaiting_payment -> Payment Due
- Completed/delivered statuses are not shown.
- If the queue overflows, a note points customers to the status page.
- Added queue-only mode (kiosk_cycle_seconds = 1) and updated the
  cycle logic to rotate QR -> pricing -> queue.
- Updated /admin/settings help text for the new mode.

Bumps version to 0.5.3.
2026-08-05 20:27:33 +00:00
Troll (Hermes Agent)
7eb72e511d Add delete-songs controls to admin request page
Operators can now select Version A and/or Version B in the Upload Songs
section and click 'Delete Selected Songs'. The handler removes the
chosen MP3 files, clears their DB paths, resets customer_approved to
'none', and sets the request status back to 'prompt_ready' so new
songs can be uploaded.

Bumps version to 0.5.1.
2026-08-05 20:05:20 +00:00
Troll (Hermes Agent)
da7dd0e9ee Include lyrics in delivery email
The final delivery email now appends a Song Lyrics section in the same
format shown on the customer player page: section headers like
[Chorus] are stripped, blank lines are preserved as stanza breaks,
and the lyric lines are rendered as plain text.

Bumps version to 0.4.8.
2026-08-05 17:44:11 +00:00
Troll (Hermes Agent)
3f7bbf4b12 Add required pronouns dropdown and fix admin vocal gender selector
- Added a required Pronouns dropdown to /request and /admin/request:
  He/Him/His, She/Her/Hers, They/Them/Their.
- Moved Email to the top of the customer request form; Pronouns sit just below Name.
- Added  column to the requests schema with automatic migration.
- Stored pronouns are included in confirmation emails and Hermes prompt copy.
- Fixed /admin/request so Preferred singer voice / gender is a dropdown
  matching the customer form instead of a free-text input.
- Updated README to describe pronouns and the structured style selectors.

Bumps version to 0.4.7.
2026-08-05 17:21:38 +00:00
Troll (Hermes Agent)
10ee182558 Replace free-text genre field with structured style dropdowns
The customer request form previously had an open 'Style / genre / mood'
text field, which produced inconsistent genre descriptions and confused
Suno. Replace it with three dropdowns:

- Decade / era (required) — loaded from /mnt/Storage/Decades.txt
- Basic style (required) — loaded from /mnt/Storage/Music Genres.txt
- Additional style (optional) — same genre list

The combined value is stored in the existing style_genre column as a
comma-separated string (e.g. '1980's, Pop, Funk'), so no schema change
is required. The admin request page exposes the same dropdowns for
corrections, and the copy-to-Hermes prompt formats the style as a clean
sentence like '1980's-era Pop with Funk influences'.

The canonical lists live in /mnt/Storage; bundled copies under lists/
act as a fallback when that mount is unavailable in the container.

Bumps version to 0.4.6 and updates README.
2026-08-05 17:03:28 +00:00
Troll (Hermes Agent)
235507f499 Extend callback token expiry from 1 hour to 7 days
The signed callback token for /api/prompt/<rid> expired after 1 hour.
That was too short for a workflow where the operator may copy the URL and
paste it to Hermes, then wait for a response. Extend to 7 days.

Also fixes the misleading 401 on expired tokens (token check runs before
API key check). The new /api/key-test endpoint lets callers verify the
API key independently.

Bump version 0.4.4 -> 0.4.5.
2026-08-05 14:44:25 +00:00
Troll (Hermes Agent)
2637cdba61 Add /api/key-test diagnostic endpoint for API key verification
Provides a simple GET endpoint that validates the Authorization Bearer
token against HERMES_API_KEY and returns JSON:
  {"ok": true, "reason": "valid"} or
  {"ok": false, "reason": "key_mismatch" / "missing_bearer" / "not_configured"}

Rate limited to 4 per minute to prevent brute-force guessing.

Bump version 0.4.3 -> 0.4.4.
2026-08-05 14:41:39 +00:00
Troll (Hermes Agent)
4b48e0a44f Fix TypeError when revision_count is stored as TEXT
The previous schema migration added revision_count as TEXT. SQLite stores
the default as TEXT, but the app does integer arithmetic on it, causing:

  TypeError: unsupported operand type(s) for -: 'int' and 'str'

- init_db() now adds revision_count as INTEGER.
- app.py casts revision_count to int in play() and revise() and when
  incrementing in revise(), so existing TEXT values also work.

Bump version 0.4.2 -> 0.4.3.
2026-08-05 14:25:07 +00:00
Troll (Hermes Agent)
3f9de1449c Fix 500 on customer revision when revision_history table is missing
Deployed databases can persist without the revision_history table,
causing /play/<token>/revise to crash with sqlite3.OperationalError.

- log_revision() now creates the table on the fly if it is missing.
- app.py runs init_db() at import time (safe CREATE TABLE IF NOT EXISTS)
  so new deployments auto-create missing tables on startup.

Bump patch version 0.4.0 -> 0.4.1.
2026-08-05 13:42:10 +00:00
Troll (Hermes Agent)
7ab8388741 Allow Hermes callback endpoint to accept revision prompts
/api/prompt/<rid> previously rejected any request not in 'pending'
status. This blocked the revision workflow from using the callback.

Now the endpoint accepts 'pending' (sets status to 'prompt_ready') and
'revisions_requested' (keeps status as 'revisions_requested' so the
operator still sees it needs new song uploads).
2026-08-05 03:30:51 +00:00
Troll (Hermes Agent)
db249e80bd Add VERSION file and live version display on settings page
- New VERSION file at project root, starting at 0.3.0.
- config.py reads VERSION and exposes it as Config.VERSION.
- Admin settings page now renders the live version from config.
- Semantic versioning convention: MAJOR for breaking/user-facing changes,
  MINOR for new features, PATCH for bug fixes and small polish.
2026-08-05 03:17:16 +00:00
Troll (Hermes Agent)
9524a24715 Fix TypeError when loading max_revisions from settings JSON
The customer player page (/play/<token>) and revision endpoint were
reading max_revisions directly from booth_settings.json, where it is
stored as a string. Arithmetic/comparison with revision_count (an int)
raised TypeError and caused a 500 error when opening the customer player.

Add get_max_revisions() helper that always returns a non-negative int,
and use it in play(), revise(), and admin_settings().
2026-08-05 03:04:48 +00:00
Troll (Hermes Agent)
968a6fb43c Add Cancelled status and cancel request button 2026-08-04 17:56:02 +00:00
Troll (Hermes Agent)
c726525c8e Add public kiosk page with QR/pricing cycle and configurable slide timing 2026-08-04 17:41:33 +00:00
Troll (Hermes Agent)
a25bf3a9c9 Add admin Pricing page with fixed and custom items 2026-08-04 17:17:57 +00:00
Troll (Hermes Agent)
a3fd5938a5 Detect missing tables in DB health check and always show schema fix button 2026-08-04 16:59:54 +00:00
Troll (Hermes Agent)
cda4d57859 Add revision history log and music files ZIP backup 2026-08-04 16:54:51 +00:00
Troll (Hermes Agent)
0c90b5a298 Make all customer info fields editable from admin request page 2026-08-04 16:32:17 +00:00
Troll (Hermes Agent)
da917692f0 Add admin Sales report page 2026-08-04 01:20:56 +00:00
Troll (Hermes Agent)
d02d0b3d25 Add stems_link support for Pingvin-Share-X delivery 2026-08-04 01:10:15 +00:00
Troll (Hermes Agent)
a72da4c5da ui: remove Hermes API key regenerate button from admin settings
Key is now managed via HERMES_API_KEY env var only.
2026-08-03 22:55:55 +00:00
Troll (Hermes Agent)
107e558aea revert: HERMES_API_KEY env var takes precedence over runtime settings
Simpler ops model: set the key in Portainer environment variables.
2026-08-03 22:54:45 +00:00
Troll (Hermes Agent)
fc700f2d82 fix: tolerate plaintext Hermes API key in booth_settings.json
The regenerate button stores encrypted keys, but legacy/manual writes may
save plaintext. get_hermes_api_key now falls back to returning the raw
value if Fernet decryption fails.
2026-08-03 22:47:57 +00:00
Troll (Hermes Agent)
06d87eb600 fix: persist runtime settings next to database so they survive redeploys 2026-08-03 22:37:57 +00:00
Troll (Hermes Agent)
b6a0987236 fix: isolate metadata keys passed to admin settings template
Previously passed the entire runtime_settings dict as metadata, which could
clobber/overlap email form fields. Now only artist/album/year/comment are passed.
2026-08-03 19:11:23 +00:00
Troll (Hermes Agent)
d5d4882d07 feat: require customer approval before mark paid/deliver
- Disable checkboxes, payment ref input, and submit button in admin UI when customer has not approved.
- Add server-side guard in mark_paid_deliver action.
2026-08-03 19:07:22 +00:00
Troll (Hermes Agent)
3057eb8eda feat: stream MP3s through backend proxy endpoint
- Replace /audio/<token>/<v>.mp3 with /api/stream/<token>/<v>.mp3.
- Stream bytes from private storage with Accept-Ranges and Content-Range support.
- Keep old /audio route returning 404.
- Update player page JS to use new stream endpoint.
2026-08-03 18:59:00 +00:00
Troll (Hermes Agent)
56493f5ea7 feat: disable direct MP3 download from customer player page
- Add controlsList=nodownload to audio elements.
- Serve audio with Content-Disposition: inline to discourage browser save dialogs.
2026-08-03 18:49:26 +00:00
Troll (Hermes Agent)
6a60aa686c feat: Hermes prompt callback endpoint + API key management
- Add /api/prompt/<rid> callback endpoint with dual auth:
  per-request signed URL token + Bearer API key.
- Add HERMES_API_KEY config and runtime key helpers in app.py.
- Update admin request page to copy request details + callback URL.
- Add API key management to admin settings: regenerate, mask, show-once.
- Update .env.example, docker-compose.yml, README, REVIEW docs.
2026-08-03 17:16:56 +00:00
Troll (Hermes Agent)
0aa3eab084 fix: record payment ref immediately; show it on admin request page 2026-08-02 23:23:45 +00:00
Troll (Hermes Agent)
3e25c3638b feat: add operator-only notes field per request 2026-08-02 22:10:42 +00:00
Troll (Hermes Agent)
2ac99fde8b feat: add /status order lookup page linked from request form 2026-08-02 22:00:27 +00:00
Troll (Hermes Agent)
5e26650b90 feat: add booth open/closed toggle on settings page 2026-08-02 18:17:59 +00:00
Troll (Hermes Agent)
c39265ab42 fix: keep metadata and email fields populated after saving settings 2026-08-02 18:05:51 +00:00
Troll (Hermes Agent)
023b4fade7 feat: add /faq page and link from request form 2026-08-02 17:31:08 +00:00
Troll (Hermes Agent)
382b05d7f8 fix: keep form values and show email error on request page 2026-08-02 17:05:27 +00:00
Troll (Hermes Agent)
bf9f9e09fd feat: editable customer email in admin + email validation on public form 2026-08-02 16:51:32 +00:00
Troll (Hermes Agent)
4af9322c9d docs: update comments and README to reflect current feature set
- Refresh app.py module and route docstrings for runtime settings,
  MP3 tagging, rate limiting, revision workflow, and admin actions.
- Clarify config.py and models.py comments.
- Update template comments/CSS for dashboard filters, request detail,
  player page, and settings page.
- Rewrite README.md with current features, status flow, file layout,
  deployment variables, and troubleshooting.
- Refresh REVIEW.md quick-reference.
- Add MAX_REVISIONS to docker-compose.yml environment list.
- Expand requirements.txt comment coverage.

No version history or changelog included.
2026-08-02 00:07:24 +00:00
Troll (Hermes Agent)
ec313601b6 Add email logo to repo static/ and reference it from app root path for container 2026-08-01 23:50:44 +00:00
Troll (Hermes Agent)
8d9c86e1b7 Use optimized DM-Logo_email.png (500px wide, 16KB) for email logo 2026-08-01 23:46:50 +00:00
Troll (Hermes Agent)
72fa09a6e1 Hardcode email logo to DM-Logo_compress.png and remove configurable logo path 2026-08-01 23:41:31 +00:00
Troll (Hermes Agent)
60909c7122 Use DM-Logo_compress.png directly for email logo, remove Pillow resize logic 2026-08-01 23:35:09 +00:00
Troll (Hermes Agent)
918eaa682c Fix email logo: resize/compress to small JPEG, make path configurable in settings, add Pillow 2026-08-01 23:32:14 +00:00
Troll (Hermes Agent)
48db5c5461 Add SMTP test email button and recipient field on settings page 2026-08-01 23:24:33 +00:00
Troll (Hermes Agent)
8e5c2f5867 Move email SMTP config to settings page with encrypted password storage; add cryptography dependency 2026-08-01 23:20:23 +00:00
Troll (Hermes Agent)
b2004bb5ec Add confirmation email, logo + tagline signature on all customer emails 2026-08-01 23:06:19 +00:00
Troll (Hermes Agent)
5ebce2baff Add dashboard auto-refresh, status filters, rate limiting, database backup/restore 2026-08-01 22:52:32 +00:00
Troll (Hermes Agent)
77e23ba52c Fix MP3 comment tagging and remove Genre from settings metadata 2026-08-01 22:35:51 +00:00
Troll (Hermes Agent)
d74a715216 Add MP3 metadata settings and auto-tag uploaded files with title, artist, album, year, genre, comment 2026-08-01 22:00:08 +00:00