From a65f8a768e04f9469a993c4282a48e791c9da077 Mon Sep 17 00:00:00 2001 From: Declan Chidlow Date: Wed, 25 Feb 2026 17:56:35 +0800 Subject: [PATCH] Slightly improve env docs --- .env.example | 50 ++++++++----------------- packages/bot/src/bot/modules/metrics.ts | 2 +- 2 files changed, 17 insertions(+), 35 deletions(-) diff --git a/.env.example b/.env.example index a0f4b87..5dbdc08 100644 --- a/.env.example +++ b/.env.example @@ -1,13 +1,7 @@ -# Copy this file to `.env.example` before editing +# Copy this file to `.env.example` before editing. -### IMPORTANT: ### -# After changing `BOT_PREFIX` or `PUBLIC_API_URL`, -# you need to rebuild the web container: -# "docker-compose build web" - -# Set a secure password for your database. -# Keep in mind that you can't easily change this -# after initializing the database. +# A secure password for your database. +# Keep in mind that you can't easily change this after initialising the database. DB_PASS= # Base URL of the Stoat API to connect to. @@ -17,46 +11,34 @@ STOAT_API_URL= # Your bot account's token. BOT_TOKEN= -# The default prefix, can be overridden by server owners. +# The default command prefix # Defaults to / BOT_PREFIX= -# List of messages to display in the bot's status, separated -# by '||'. Available "variables": {{servers}}, {{users}}, -# {{infractions_total}} and {{ping_ms}}. The bot will -# periodically cycle between these messages. Only works if -# BOT_STATUS_INTERVAL is also set. +# List of messages to cycle between as the bot's status, separated by '||'. +# Available variables: {{servers}}, {{users}}, {{infractions_total}} and {{ping_ms}}. +# This only works if BOT_STATUS_INTERVAL is also set. BOT_STATUS= # Delay (in seconds) between status changes. BOT_STATUS_INTERVAL= -# Private token used by the bot to communicate -# with the API. Keep this private! +# Private token used by the bot to communicate with its API. INTERNAL_API_TOKEN= -# Comma separated list of user IDs. -# Be careful with the people you add here - -# They will be able to use /eval and /shell, -# which gives them access to your server! +# Users who can use owner commands. +# Comma-separated list of user IDs. BOT_OWNERS= -# Optional: If set, enables Prometheus metrics -# on the specified port (Under /metrics). -# Note that no authentication can be configured; -# you should use a reverse proxy if you need -# BasicAuth or a different form of authentication. +# Optional: If set, enables Prometheus metrics on the specified port under /metrics. +# No authentication can be configured, so you should use a reverse proxy if you need BasicAuth or similar. BOT_METRICS_PORT= -# Optional: Set this to a channel ID if you -# want Prometheus metrics to return `msg_ping`. -# The bot will regularly send a message in that -# channel. +# Optional: If set, will regularly send a message in the provided channel so Prometheus metrics can track `msg_ping`. +# Expects channel ID BOT_METRICS_MSG_PING_CHANNEL= -# The URL from which your API and Web app are -# publicly reachable. Do not add a trailing -# slash to the URLs. - +# The URL from which your API and web app are publicly reachable. +# Do not add a trailing slash to the URLs. PUBLIC_API_URL=http://localhost:9000 PUBLIC_WEB_URL=http://localhost:8080 diff --git a/packages/bot/src/bot/modules/metrics.ts b/packages/bot/src/bot/modules/metrics.ts index 78a0c13..68f1e7b 100644 --- a/packages/bot/src/bot/modules/metrics.ts +++ b/packages/bot/src/bot/modules/metrics.ts @@ -9,7 +9,7 @@ prom.collectDefaultMetrics({ prefix: "automod_" }); const metrics = { commands: new prom.Counter({ name: "commands_executed", help: "Command usage stats", labelNames: ["command"] }), servers: new prom.Gauge({ name: "server_count", help: "Amount of servers the bot is in" }), - wsPing: new prom.Gauge({ name: "ws_ping", help: "WebSocket ping as returned by stoat.js" }), + wsPing: new prom.Gauge({ name: "ws_ping", help: "WebSocket ping as returned by Stoat.js" }), msgPing: new prom.Gauge({ name: "msg_ping", help: "Amount of time it takes for the bot to send a message" }), }; -- 2.51.2