From 7ebad5d2495073c21b02ab2b64f83c9367d6435b Mon Sep 17 00:00:00 2001 From: latte Date: Tue, 27 Jan 2026 20:15:39 +0100 Subject: [PATCH] fix: Add config.yml support for Docker deployment Mount config.yml into Docker container and provide example template. Changes: - Mount config.yml as read-only volume in docker-compose.yml - Create config.example.yml template for users - Add config.yml to .gitignore (contains sensitive settings) - Update README.md with config file setup instructions Fixes 'Config file not found' error in Docker deployment. Users should: 1. Copy config.example.yml to config.yml 2. Edit config.yml with their settings 3. Run docker compose up -d --- .gitignore | 3 +++ README.md | 16 ++++++++--- config.example.yml | 67 ++++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 1 + 4 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 config.example.yml diff --git a/.gitignore b/.gitignore index 31f9ad3..85df54e 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,9 @@ env/ .env .env.local +# Configuration (contains sensitive data) +config.yml + # Data data/ *.db diff --git a/README.md b/README.md index b83b9e0..c4c848a 100644 --- a/README.md +++ b/README.md @@ -60,10 +60,15 @@ A lightweight, cost-conscious Discord moderation bot focused on essential protec cd guardden ``` -2. Create your environment file: +2. Create your configuration files: ```bash + # Environment variables cp .env.example .env # Edit .env and add your Discord token + + # Bot configuration + cp config.example.yml config.yml + # Edit config.yml with your settings ``` 3. Start with Docker Compose: @@ -84,10 +89,15 @@ A lightweight, cost-conscious Discord moderation bot focused on essential protec pip install -e ".[dev,ai]" ``` -3. Set up environment variables: +3. Set up configuration: ```bash + # Environment variables cp .env.example .env - # Edit .env with your configuration + # Edit .env with your Discord token + + # Bot configuration + cp config.example.yml config.yml + # Edit config.yml with your settings ``` 4. Start PostgreSQL (or use Docker): diff --git a/config.example.yml b/config.example.yml new file mode 100644 index 0000000..82cf76c --- /dev/null +++ b/config.example.yml @@ -0,0 +1,67 @@ +# GuardDen Configuration +# Single YAML file for bot configuration + +# Bot Settings +bot: + prefix: "!" + owner_ids: + # Add your Discord user ID here + # Example: - 123456789012345678 + +# Spam Detection (No AI cost) +automod: + enabled: true + anti_spam_enabled: true + message_rate_limit: 5 # Max messages per window + message_rate_window: 5 # Window in seconds + duplicate_threshold: 3 # Duplicate messages trigger + mention_limit: 5 # Max mentions per message + mention_rate_limit: 10 # Max mentions per window + mention_rate_window: 60 # Mention window in seconds + +# AI Moderation (Images, GIFs only) +ai_moderation: + enabled: true + sensitivity: 80 # 0-100, higher = stricter + nsfw_only_filtering: true # Only filter sexual/nude content + + # Cost Controls (Conservative: ~$25/month for 1-2 guilds) + max_checks_per_hour_per_guild: 25 # Very conservative limit + max_checks_per_user_per_hour: 5 # Prevent user abuse + max_images_per_message: 2 # Check max 2 images per message + max_image_size_mb: 3 # Skip images larger than 3MB + + # Feature Toggles + check_embed_images: true # Check GIFs from Discord picker (enabled per user request) + check_video_thumbnails: false # Skip video thumbnails (disabled per user request) + url_image_check_enabled: false # Skip URL image downloads (disabled per user request) + +# User Blocklist (No AI cost) +# Block all images, GIFs, embeds, and URLs from these users +# Add Discord user IDs here +blocked_user_ids: + # Example: - 123456789012345678 + +# NSFW Video Domain Blocklist (No AI cost) +# These domains are blocked instantly without AI analysis +nsfw_video_domains: + - pornhub.com + - xvideos.com + - xnxx.com + - redtube.com + - youporn.com + - tube8.com + - spankwire.com + - keezmovies.com + - extremetube.com + - pornerbros.com + - eporner.com + - tnaflix.com + - drtuber.com + - upornia.com + - perfectgirls.net + - xhamster.com + - hqporner.com + - porn.com + - sex.com + - wetpussy.com diff --git a/docker-compose.yml b/docker-compose.yml index 873d963..4cfce2c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,6 +22,7 @@ services: volumes: - guardden_data:/app/data - guardden_logs:/app/logs + - ./config.yml:/app/config.yml:ro networks: - guardden healthcheck: