feat: update README and docker-compose for Kuma monitoring configuration

This commit is contained in:
Space-Banane
2026-01-27 17:42:54 +01:00
parent 51beafed0f
commit df078e2aa7
3 changed files with 9 additions and 6 deletions

View File

@@ -28,6 +28,9 @@ Create a `.env` file in the project root with your Discord bot token:
``` ```
DISCORD_BOT_TOKEN=your_discord_bot_token_here DISCORD_BOT_TOKEN=your_discord_bot_token_here
# Optional: Set Kuma monitoring variables:
# KUMA_PUSH_URL=https://your-uptime-kuma-instance.com/api/push/
# KUMA_PUSH_INTERVAL=60
``` ```
### 3. Run with Docker Compose ### 3. Run with Docker Compose

8
bot.go
View File

@@ -55,11 +55,11 @@ func main() {
} }
// Start Kuma push monitor if configured // Start Kuma push monitor if configured
kumaPushURL := os.Getenv("Kuma-Push-Url") kumaPushURL, ok := os.LookupEnv("KUMA_PUSH_URL")
if kumaPushURL != "" { if ok {
intervalStr := os.Getenv("Kuma-Push-Interval") intervalStr, ok := os.LookupEnv("KUMA_PUSH_INTERVAL")
interval := 60 // default to 60 seconds interval := 60 // default to 60 seconds
if intervalStr != "" { if ok && intervalStr != "" {
if parsed, err := strconv.Atoi(intervalStr); err == nil && parsed > 0 { if parsed, err := strconv.Atoi(intervalStr); err == nil && parsed > 0 {
interval = parsed interval = parsed
} }

View File

@@ -8,5 +8,5 @@ services:
env_file: env_file:
- .env - .env
# Optional: Set Kuma monitoring variables in .env file: # Optional: Set Kuma monitoring variables in .env file:
# Kuma-Push-Url=https://your-uptime-kuma-instance.com/api/push/xxxxx # KUMA_PUSH_URL=https://your-uptime-kuma-instance.com/api/push/xxxxx
# Kuma-Push-Interval=60 # KUMA_PUSH_INTERVAL=60