quick commit
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 6m9s
CI/CD Pipeline / Security Scanning (push) Successful in 26s
CI/CD Pipeline / Tests (3.11) (push) Failing after 5m24s
CI/CD Pipeline / Tests (3.12) (push) Failing after 5m23s
CI/CD Pipeline / Build Docker Image (push) Has been skipped
CI/CD Pipeline / Deploy to Staging (push) Has been skipped
CI/CD Pipeline / Deploy to Production (push) Has been skipped
CI/CD Pipeline / Notification (push) Successful in 1s

This commit is contained in:
2026-01-17 20:24:43 +01:00
parent 95cc3cdb8f
commit 831eed8dbc
82 changed files with 8860 additions and 167 deletions

View File

@@ -51,7 +51,7 @@ GuardDen is a comprehensive Discord moderation bot designed to protect your comm
4. **Configure Bot Settings:**
- Disable **Public Bot** if you only want yourself to add it
- Copy the **Token** (click "Reset Token") - this is your `DISCORD_TOKEN`
- Copy the **Token** (click "Reset Token") - this is your `GUARDDEN_DISCORD_TOKEN`
5. **Enable Privileged Gateway Intents** (all three required):
- **Presence Intent** - for user status tracking
@@ -138,11 +138,23 @@ GuardDen is a comprehensive Discord moderation bot designed to protect your comm
|----------|-------------|---------|
| `GUARDDEN_DISCORD_TOKEN` | Your Discord bot token | Required |
| `GUARDDEN_DISCORD_PREFIX` | Default command prefix | `!` |
| `GUARDDEN_ALLOWED_GUILDS` | Comma-separated guild allowlist | (empty = all) |
| `GUARDDEN_OWNER_IDS` | Comma-separated owner user IDs | (empty = admins) |
| `GUARDDEN_DATABASE_URL` | PostgreSQL connection URL | `postgresql://guardden:guardden@localhost:5432/guardden` |
| `GUARDDEN_LOG_LEVEL` | Logging level | `INFO` |
| `GUARDDEN_AI_PROVIDER` | AI provider (anthropic/openai/none) | `none` |
| `GUARDDEN_ANTHROPIC_API_KEY` | Anthropic API key (if using Claude) | - |
| `GUARDDEN_OPENAI_API_KEY` | OpenAI API key (if using GPT) | - |
| `GUARDDEN_DASHBOARD_BASE_URL` | Dashboard base URL for OAuth callbacks | `http://localhost:8080` |
| `GUARDDEN_DASHBOARD_SECRET_KEY` | Session secret for dashboard | Required |
| `GUARDDEN_DASHBOARD_ENTRA_TENANT_ID` | Entra tenant ID | Required |
| `GUARDDEN_DASHBOARD_ENTRA_CLIENT_ID` | Entra client ID | Required |
| `GUARDDEN_DASHBOARD_ENTRA_CLIENT_SECRET` | Entra client secret | Required |
| `GUARDDEN_DASHBOARD_DISCORD_CLIENT_ID` | Discord OAuth client ID | Required |
| `GUARDDEN_DASHBOARD_DISCORD_CLIENT_SECRET` | Discord OAuth client secret | Required |
| `GUARDDEN_DASHBOARD_OWNER_DISCORD_ID` | Discord user ID allowed | Required |
| `GUARDDEN_DASHBOARD_OWNER_ENTRA_OBJECT_ID` | Entra object ID allowed | Required |
| `GUARDDEN_DASHBOARD_CORS_ORIGINS` | Dashboard CORS origins | (empty = none) |
### Per-Guild Settings
@@ -152,8 +164,9 @@ Each server can configure:
- Welcome channel
- Mute role and verified role
- Automod toggles (spam, links, banned words)
- Automod thresholds and scam allowlist
- Strike action thresholds
- AI moderation settings (enabled, sensitivity, NSFW detection)
- AI moderation settings (enabled, sensitivity, confidence threshold, log-only, NSFW detection)
- Verification settings (type, enabled)
## Commands
@@ -201,6 +214,10 @@ Each server can configure:
|---------|-------------|
| `!automod` | View automod status |
| `!automod test <text>` | Test text against filters |
| `!automod threshold <setting> <value>` | Update a single automod threshold |
| `!automod allowlist` | List allowlisted domains |
| `!automod allowlist add <domain>` | Add a domain to the allowlist |
| `!automod allowlist remove <domain>` | Remove a domain from the allowlist |
### AI Moderation (Admin only)
@@ -210,9 +227,17 @@ Each server can configure:
| `!ai enable` | Enable AI moderation |
| `!ai disable` | Disable AI moderation |
| `!ai sensitivity <0-100>` | Set AI sensitivity level |
| `!ai threshold <0.0-1.0>` | Set AI confidence threshold |
| `!ai logonly <true/false>` | Toggle AI log-only mode |
| `!ai nsfw <true/false>` | Toggle NSFW image detection |
| `!ai analyze <text>` | Test AI analysis on text |
### Diagnostics (Admin only)
| Command | Description |
|---------|-------------|
| `!health` | Check database and AI provider status |
### Verification (Admin only)
| Command | Description |
@@ -226,6 +251,17 @@ Each server can configure:
| `!verify test [type]` | Test a verification challenge |
| `!verify reset @user` | Reset verification for a user |
## Dashboard
The dashboard provides read-only visibility into moderation logs across all servers.
1. Configure Entra + Discord OAuth credentials in `.env`.
2. Build the frontend: `cd dashboard/frontend && npm install && npm run build`.
3. Run with Docker: `docker compose up dashboard`.
4. OAuth callbacks:
- Entra: `http://localhost:8080/auth/entra/callback`
- Discord: `http://localhost:8080/auth/discord/callback`
## Project Structure
```
@@ -252,6 +288,7 @@ guardden/
│ └── verification.py # Verification challenges
├── tests/ # Test suite
├── migrations/ # Database migrations
├── dashboard/ # Web dashboard (FastAPI + React)
├── docker-compose.yml # Docker deployment
└── pyproject.toml # Dependencies
```