Files
FWS-DiscordBot/.env.example
nocodeandClaude Opus 5 a1e1de7734 feat(web): publish a public status page at /status
Checking whether the service is up required an account, so the answer
lived where the people asking could not reach it.

The page is rendered on the server with no script at all and refreshes
through a meta tag: a status page that needs a working browser is
useless at the moment it is read. Two rules follow from it being public.
A repository the forge does not list as public keeps its environment
visible but loses its name, and the banner always states the worst true
thing — a failed deployment forbids the green headline even while the
bot answers. WEB_PUBLIC_STATUS=false removes page and route together.

/api/status gives the same in JSON, which is what a monitor should watch
rather than /api/health — the latter only says the process is alive.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-24 18:46:26 +02:00

114 lines
4.5 KiB
Bash

# =============================================================================
# FWS-Bot — environment configuration example
# Copy this file to `.env` and fill in the values. Never commit `.env`.
# =============================================================================
# --- Runtime -----------------------------------------------------------------
# development | production | test
NODE_ENV=development
# debug | info | warn | error
LOG_LEVEL=info
LOG_DIR=./logs
# Number of days functional/technical logs are kept (M11-T08)
LOG_RETENTION_DAYS=30
# --- Discord application (M2-T01) -------------------------------------------
# Developer Portal > Bot > Token
DISCORD_TOKEN=
# Developer Portal > General Information > Application ID
DISCORD_CLIENT_ID=
# FWS server ID (slash commands are registered on this guild)
DISCORD_GUILD_ID=
# --- FWS roles (M3-T01) — Discord role IDs ----------------------------------
ROLE_OWNER_ID=
ROLE_DEV_ID=
ROLE_STAFF_ID=
# Role given to new members on join (M7-T03)
ROLE_MEMBER_ID=
# --- Discord channels (M0-T04 / M9-T01) — channel IDs -----------------------
CHANNEL_WELCOME_ID=
CHANNEL_RULES_ID=
CHANNEL_ANNOUNCEMENTS_ID=
CHANNEL_LOGS_ID=
CHANNEL_MOD_LOGS_ID=
CHANNEL_TICKETS_LOGS_ID=
CHANNEL_NOTIF_ISSUES_ID=
CHANNEL_NOTIF_PULL_REQUESTS_ID=
CHANNEL_NOTIF_COMMITS_ID=
CHANNEL_NOTIF_RELEASES_ID=
CHANNEL_NOTIF_ERRORS_ID=
# Category under which private ticket channels are created (M6)
CATEGORY_TICKETS_ID=
# --- Salons vocaux temporaires (M14) ----------------------------------------
# Salon vocal « rejoindre pour créer » : y entrer crée un salon temporaire
CHANNEL_VOICE_TRIGGER_ID=
# Catégorie d'accueil des salons vocaux créés (facultatif)
CATEGORY_VOICE_ID=
# Délai avant qu'un salon généré devenu vide soit supprimé, en ms (0 = immédiat)
VOICE_EMPTY_GRACE_MS=5000
# --- Statuts du bot (M15) -----------------------------------------------------
# Rythme par défaut de la rotation, en secondes (modifiable à chaud par /status interval)
BOT_STATUS_INTERVAL_SECONDS=60
# --- Gitea (M5-T01) ----------------------------------------------------------
GITEA_URL=https://gitea.nocode-var.tech
# Token with least privilege (read:repository, write:issue). Never log it.
GITEA_TOKEN=
GITEA_OWNER=FWS
GITEA_REPO=FWS-Arch
GITEA_TIMEOUT_MS=10000
GITEA_MAX_RETRIES=2
# --- Gitea webhooks (M9-T02) -------------------------------------------------
WEBHOOK_ENABLED=false
WEBHOOK_HOST=0.0.0.0
WEBHOOK_PORT=3000
WEBHOOK_PATH=/webhooks/gitea
# Shared secret configured in Gitea > Settings > Webhooks
GITEA_WEBHOOK_SECRET=
# --- Tableau de bord web (M16) -----------------------------------------------
# Site d'administration servi par le bot : `npm run setup` pour l'assistant .env,
# puis http://WEB_HOST:WEB_PORT une fois le bot démarré.
WEB_ENABLED=false
# 127.0.0.1 derrière un reverse proxy installé sur la même machine.
# 0.0.0.0 dans un conteneur ou sur un panel d'hébergement (Pterodactyl, Docker) :
# sinon le site n'écoute que sur la boucle locale et reste injoignable.
WEB_HOST=127.0.0.1
WEB_PORT=3080
# URL publique du tableau de bord, utilisée pour la redirection OAuth2 Discord.
# Doit correspondre exactement à une redirection déclarée dans le Developer Portal.
WEB_PUBLIC_URL=http://localhost:3080
# Clé de signature des cookies de session (64 caractères hex).
# Générer avec : node -e "console.log(require('node:crypto').randomBytes(32).toString('hex'))"
WEB_SESSION_SECRET=
WEB_SESSION_TTL_HOURS=12
# Developer Portal > OAuth2 > Client Secret. Requis pour la connexion au tableau de bord.
DISCORD_CLIENT_SECRET=
# Jeton d'amorçage : ouvre l'assistant de configuration sans compte Discord.
# À vider une fois le .env rempli.
WEB_SETUP_TOKEN=
# Publie /status : bot en ligne, derniers déploiements, dernières releases.
# Les dépôts privés n'y apparaissent jamais par leur nom.
WEB_PUBLIC_STATUS=true
# Autorise les cibles de déploiement de type « commande shell » (Owner uniquement).
WEB_ALLOW_COMMAND_DEPLOYS=false
# Autorise le bouton « Redémarrer le bot » (nécessite un superviseur type systemd/pm2).
WEB_ALLOW_RESTART=false
WEB_DEPLOY_TIMEOUT_MS=900000
WEB_RATE_LIMIT_PER_MINUTE=240
# --- SQLite (M1-T05) ---------------------------------------------------------
DATABASE_PATH=./data/fws-bot.sqlite
BACKUP_DIR=./data/backups
# --- FWS links (M0-T06 / M4-T04) ---------------------------------------------
FWS_WEBSITE_URL=
FWS_DOCS_URL=
FWS_DISCORD_INVITE_URL=
FWS_ARCH_REPO_URL=