feat: footer, auto-pause on no viewers, and Redsys question submissions

- Footer: add site-footer with one-liner + Cloud Host branding linking to cloudhost.es (mobile only, hidden on desktop)
- Auto-pause: game pauses automatically after AUTOPAUSE_DELAY_MS (default 60s) with no viewers connected; auto-resumes when first viewer connects; shows "Esperando espectadores…" in the UI
- Redsys: new /pregunta page lets viewers pay 1€ via Redsys to submit a fill-in question; submitted questions are used as prompts in the next round instead of AI generation; new redsys.ts implements HMAC_SHA256_V1 signing (3DES key derivation + HMAC-SHA256); notification endpoint at /api/redsys/notificacion handles server-to-server confirmation
- db.ts: questions table with createPendingQuestion / markQuestionPaid / getNextPendingQuestion / markQuestionUsed
- .env.sample: added AUTOPAUSE_DELAY_MS, PUBLIC_URL, REDSYS_* vars

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 14:03:30 +01:00
parent 4b0b9f8f50
commit 2fac92356d
12 changed files with 747 additions and 20 deletions

View File

@@ -26,3 +26,21 @@ MAX_WS_NEW_PER_SEC=50
# Viewer vote broadcast debounce in ms (default: 250)
VIEWER_VOTE_BROADCAST_DEBOUNCE_MS=250
# Auto-pause: seconds of inactivity before pausing when no viewers are connected (default: 60000 ms)
AUTOPAUSE_DELAY_MS=60000
# ── Redsys (optional — enables paid user question submissions at /pregunta) ────
# Public base URL of this server (used for Redsys redirect/notification URLs)
# Example: https://argument.es
PUBLIC_URL=https://argument.es
# Redsys merchant credentials (get these from your bank / Redsys portal)
REDSYS_MERCHANT_CODE=
REDSYS_TERMINAL=1
# Base64-encoded Redsys secret key (SHA-256 key from the merchant portal)
REDSYS_SECRET_KEY=
# Set to "false" to use the live Redsys gateway (default: test environment)
REDSYS_TEST=true