From 3e74712c4483eaeaf7c019fa23605ed89b6ac0ce Mon Sep 17 00:00:00 2001 From: Dorian Date: Sat, 7 Mar 2026 11:04:32 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20production=20hardening=20=E2=80=94=20ba?= =?UTF-8?q?ckground=20fights,=20queue=20tuning,=20CORS,=20cycling=20taglin?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Background fight loop: mock bots auto-fight every ~45s for site activity - Quiet hours (2-8 UTC) run 4x slower, jitter prevents robotic timing - Configurable via FIGHT_LOOP_ENABLED, FIGHT_LOOP_INTERVAL_MS - Queue timeout: 30s in prod (was 3s), configurable via QUEUE_TIMEOUT_MS - CORS: env-configurable via CORS_ORIGIN (default '*') - Homepage: 40 cycling taglines with typewriter effect - docker-compose: document all new env vars Co-Authored-By: Claude Opus 4.6 --- docker-compose.yml | 9 ++ frontend/src/pages/HomePage.vue | 170 +++++++++++++++++++++++++++++--- server/src/app.ts | 4 +- server/src/engine/background.ts | 101 +++++++++++++++++++ server/src/engine/queue.ts | 3 +- server/src/index.ts | 4 + 6 files changed, 276 insertions(+), 15 deletions(-) create mode 100644 server/src/engine/background.ts diff --git a/docker-compose.yml b/docker-compose.yml index f10cfed..d6438a0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,15 @@ services: environment: - NODE_ENV=production - PORT=9100 + # Queue: how long (ms) before falling back to mock bot (default 30s in prod) + # - QUEUE_TIMEOUT_MS=30000 + # CORS: set to your domain in prod, or leave for same-origin + # - CORS_ORIGIN=https://botfights.example.com + # Background fights: mock bots fight each other for site activity + - FIGHT_LOOP_ENABLED=true + # - FIGHT_LOOP_INTERVAL_MS=45000 + # - FIGHT_LOOP_QUIET_START=2 + # - FIGHT_LOOP_QUIET_END=8 volumes: botfights-data: diff --git a/frontend/src/pages/HomePage.vue b/frontend/src/pages/HomePage.vue index a46e7af..14b64e7 100644 --- a/frontend/src/pages/HomePage.vue +++ b/frontend/src/pages/HomePage.vue @@ -1,5 +1,5 @@