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>
This commit is contained in:
NotSoToothless
2026-05-14 00:09:51 -07:00
committed by GitHub
parent cd0576b88a
commit 72833465dc
+6 -6
View File
@@ -1,15 +1,15 @@
// Single source of truth for runtime config is TSSBOT/.env (loaded here). // Single source of truth for runtime config is TSSBOT/.env. start_bot.py
// Do NOT add `env:` blocks to apps below — they would override the .env values // loads it directly (load_dotenv(_HERE / ".env")). Do NOT add `env:` blocks
// and create two parallel config sources to reason about. // below or `require('dotenv')` here — either would create a second config
require('dotenv').config(); // source that can silently shadow .env, and the dotenv require would fail
// outright on hosts that don't have node_modules/ installed in TSSBOT.
const DEPLOY_PATH = __dirname; const DEPLOY_PATH = __dirname;
// Reuse SREBOT's venv by default — both bots share BOTS/SHARED and most // Reuse SREBOT's venv by default — both bots share BOTS/SHARED and most
// runtime deps (discord.py, dotenv, …). Split into TSSBOT/.venv once the // runtime deps (discord.py, dotenv, …). Split into TSSBOT/.venv once the
// dep sets diverge meaningfully. // dep sets diverge meaningfully.
const PY_INTERPRETER = const PY_INTERPRETER = `${DEPLOY_PATH}/../SREBOT/.venv/bin/python`;
process.env.TSSBOT_PY_INTERPRETER || `${DEPLOY_PATH}/../SREBOT/.venv/bin/python`;
module.exports = { module.exports = {
apps: [ apps: [