Commit Graph

11 Commits

Author SHA1 Message Date
clxud 246a29f695 Extract website to SREBOT-web repo: remove web/, move seasons/locales/constants to repo root, fix imports 2026-07-02 02:45:22 +00:00
deploy 659785f8f3 perf: leaderboard SWR cache + threadpool fix for season-III stalls
- Fix 1: UV_THREADPOOL_SIZE=24 via start_server.sh wrapper (libuv reads OS
  environ; process.env and PM2 env blocks don't propagate on this system)
- Fix 2: Stale-while-revalidate for leaderboards — serve cached/stale data
  instantly, refresh in background; dedicated aggregateCache isolated from
  the 100-entry responseCache; single-flight dedup for concurrent computes
- Fix 3: Background warmer precomputes current + last-completed season
  leaderboards at +20s boot and every 4 min
- Fix 5: Adaptive TTL (5 min live, 24 h completed) via aggregateCacheTtl
- Fixes 1+2 combined: player page stall 95s -> 3.6s under concurrent heavy
  leaderboard load; warm hits served in 1-4ms (was 13-53s)
2026-06-30 12:08:02 +00:00
deploy 010e356dc8 pm2: add crash-loop governor to all apps; lower srebot max_memory_restart to 12000M
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 12:58:56 +00:00
NotSoToothless ffb31f3bb1 holy meow (#1357) 2026-06-28 06:20:20 -07:00
NotSoToothless 377f7b8397 meow (#1355) 2026-06-28 05:01:33 -07:00
NotSoToothless 0f3943c8bd meow (#1354) 2026-06-28 04:57:09 -07:00
NotSoToothless cbb532a711 Auto merge dev → main (#1353)
* feat(gateway): hashed key store with grant + hot reload

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(gateway): channel registry + aiohttp app (keyed auth, whoami, per-channel ws/proxy)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(gateway): manage_keys CLI (add/list/revoke)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(gateway): retire srebot_external, run relay-gateway under PM2

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(gateway): point ecosystem + README at relay-gateway

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(tss): replay outbox producer for relay gateway

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(tss): forward processed games to relay outbox

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(tss-api): db helpers, app skeleton, info endpoint, fixtures

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(tss-api): player, games, history, search endpoints

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(tss-api): live, match, scoreboard, matches-search, maps

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(tss-api): filter-required leaderboards (players/vehicles/stats)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(tss-api): tournament list/detail/standings/matches

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat: wire tss upstream through gateway + tssbot-api PM2 app

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 03:38:20 -07:00
NotSoToothless cb0a18f748 move venv to shared (#1291) 2026-05-31 01:43:19 -07:00
NotSoToothless ec08655a59 drop require('dotenv') from ecosystem.config.js files (#1230)
TSSBOT has no node_modules/ on the server (no package.json was ever
installed for it), so `require('dotenv').config()` crashes pm2 with
MODULE_NOT_FOUND when it loads the ecosystem file. The dotenv call was
already dead code: every spawned app loads its own .env in its own
process (botscript.py, server.js, web/server.js, webhook updater,
TSSBOT/start_bot.py all do load_dotenv / require('dotenv').config()
themselves). Remove the require from both ecosystem files.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 00:09:51 -07:00
NotSoToothless 3fb15d6282 consolidate runtime env into .env, drop ecosystem env blocks (#1229)
- Make .env the single source of truth for runtime config. Remove all
  `env:` blocks from SREBOT/ecosystem.config.js and TSSBOT/ecosystem.config.js
  so values can't silently shadow .env. Both ecosystem files load .env via
  `require('dotenv').config()` and PM2 inherits the resolved environment.

- Rename SREBOT_STORAGE_VOL_PATH → STORAGE_VOL_PATH across all readers
  (BOT/utils.py, BOT/receiver_bridge.py, BOT/render_recap.py, server.js,
  web/server.js, dateindex.js, scripts/*, srebot.service, tests/, README,
  and both .env files). STORAGE is shared between SREBOT and TSSBOT, so the
  variable shouldn't carry one bot's prefix.

- Rename per-process PORT env vars to disambiguated names so .env can be
  the source of truth without collisions:
    PORT (api)     → SREBOT_API_PORT     (server.js)
    PORT (web)     → SREBOT_WEB_PORT     (web/server.js)
    WEBHOOK_PORT   → SREBOT_WEBHOOK_PORT (github_webhook_updater.py)
  SREBOT_EXTERNAL_HOST/PORT/UPSTREAM_URL were already uniquely named;
  they just move from ecosystem env to .env.

- TSSBOT/.env: drop GITHUB_WEBHOOK_SECRET (only srebot-webhook consumes it)
  and the stale SREBOT_DEPLOY_PATH. SREBOT/.env: also drop the obsolete
  SREBOT_DEPLOY_PATH (ecosystem now hardcodes __dirname).

- ecosystem.config.js no longer references SREBOT_DEPLOY_PATH; deploy path
  is always __dirname of the ecosystem file.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 00:07:34 -07:00
FURRO404 2b399fdb81 add SREBOT, SHARED, TSSBOT contents (fixup for #1223)
PR #1223 only staged the deletions of the old paths because the new
top-level directories were still untracked when the commit was authored.
This commit adds the actual restructured tree: SREBOT/ (existing bot),
SHARED/ (vromfs, data_parser, ICONS/MAPS/FONTS, DAGOR_FILES,
update_game_files), and TSSBOT/ (skeleton).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 23:17:02 -07:00