1
0
Fork 0
polaris-task-force/.env.example
Z8MB1E e72b849774 feat(scripts): tee bin script logs to daily files
Add createBinLogger (src/scripts/lib/binFileLogger.ts): every log call
is appended synchronously to logs/<bin-key>/<YYYY-MM-DD>.log (UTC) in
addition to the console logger — sync writes because bin scripts
process.exit() immediately. Bin bodies are wrapped in try/catch so a
fatal error is logged to file and exits code 1. Override the directory
with BIN_LOG_DIR. logs/ is gitignored.

game-tick, market-tick, and processShipmentTick adopt the logger;
generate-mission follows with its clone fix; mission-tick lands with
its feature. Document BIN_LOG_DIR in .env.example and the logging in
AGENTS.md / README.
2026-08-25 12:29:07 -04:00

60 lines
No EOL
2.4 KiB
Text

# --- Database (PostgreSQL) ---
# Coolify: leave this BLANK in the application's env here — Coolify injects
# DATABASE_URI automatically from the per-environment PostgreSQL service
# (Project → New Resource → PostgreSQL). Use the format Coolify emits.
# Local docker compose: override via POSTGRES_USER/_PASSWORD/_DB in your
# local `.env` (the compose file rewrites DATABASE_URI from those).
DATABASE_URI=postgres://ptfapp:polaristaskforcedb@127.0.0.1:5432/ptf-app-dev
# Random 32+ char secret used to sign Payload sessions / JWTs.
# Generate with: `openssl rand -hex 16`
PAYLOAD_SECRET=YOUR_SECRET_HERE
# --- Public URL of the running app ---
# Used by the game-tick script (POST /api/game-tick/notify) and by Payload
# for absolute admin URLs. In Coolify set this to your environment's
# public domain (e.g. https://dev.ptf.example.com).
APP_URL=http://localhost:3000
# --- Game tick notify secret ---
# Shared secret that guards the /api/game-tick/notify endpoint. Generate
# the same value here and pass it to the scheduled `docker exec` job on
# Coolify (or to your cron). See DEPLOYMENT.md.
GAME_TICK_NOTIFY_SECRET=YOUR_GAME_TICK_NOTIFY_SECRET
# --- Bin script file logging ---
# Optional. Payload bin scripts (game-tick, market-tick, mission-tick,
# generate-mission) tee their logs to daily files. Defaults to <repo>/logs
# (inside containers: /app/logs — mount a persistent volume or point this at
# a persisted path, e.g. /app/media/logs, to keep them across restarts).
# BIN_LOG_DIR=
# --- Payload email (nodemailer / SMTP relay) ---
# Optional. Leave blank to disable outbound email (password resets, etc).
EMAIL_FROM_ADDRESS=
EMAIL_FROM_NAME=
EMAIL_HOST=
EMAIL_PORT=587
EMAIL_USERNAME=
EMAIL_PASSWORD=
# --- Docker compose tunables (local dev only — not used by Coolify) ---
POSTGRES_USER=ptfapp
POSTGRES_PASSWORD=polaristaskforcedb
POSTGRES_DB=ptf-app-dev
POSTGRES_PORT=5432
APP_PORT=3000
# --- Discord bot (presence-gated) ---
# The bot ships inside the Docker image but starts ONLY when DISCORD_TOKEN is
# set in the environment (Coolify per-env gate — set it in prod only; leave
# unset in dev/stage). DISCORD_GUILD_ID is REQUIRED whenever the token is set
# (the bot config throws at import if it's missing). All other DISCORD_* vars
# are optional.
# DISCORD_TOKEN=
# DISCORD_GUILD_ID=
# DISCORD_OPS_CHANNEL_ID=
# DISCORD_ANNOUNCE_CHANNEL_ID=
# DISCORD_STAFF_ROLE_IDS=
# DISCORD_ATTENDANCE_POLL_MS=
# DISCORD_NOTIFICATION_POLL_MS=