Initial commit

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
root
2026-02-10 08:22:19 -06:00
commit 519788c633
39 changed files with 17121 additions and 0 deletions

125
.env.example Normal file
View File

@@ -0,0 +1,125 @@
# =============================================================================
# GMAILDISCORDZAMMAD BRIDGE Example environment (no secrets)
# Copy to .env and fill in real values. See README for full docs.
# =============================================================================
# --- Discord: Core ---
DISCORD_TOKEN= # Bot token from Discord Developer Portal
DISCORD_APPLICATION_ID= # Application (client) ID
DISCORD_GUILD_ID= # Server (guild) ID where the bot runs
# --- Discord: Channel & category IDs ---
# Ticket creation: set one or both; /panel and /email-routing choose behavior
DISCORD_TICKET_CATEGORY_ID= # Category for Discord-originated ticket channels
TICKET_CATEGORY_ID= # Category for email-originated ticket channels
DISCORD_THREAD_CHANNEL_ID= # Text channel for Discord ticket threads (optional)
EMAIL_THREAD_CHANNEL_ID= # Text channel for email ticket threads (optional)
# Overflow categories when main hits 50 channels (comma-separated, optional)
# EMAIL_TICKET_OVERFLOW_CATEGORY_IDS=
# DISCORD_TICKET_OVERFLOW_CATEGORY_IDS=
# Escalation categories (tier 2 and tier 3)
DISCORD_ESCALATED_CATEGORY_ID= # Fallback escalation category (Discord)
EMAIL_ESCALATED_CATEGORY_ID= # Fallback escalation category (email)
DISCORD_ESCALATED2_CHANNEL_ID= # Tier 2 escalation category/channel (Discord)
DISCORD_ESCALATED3_CHANNEL_ID= # Tier 3 escalation category/channel (Discord)
EMAIL_ESCALATED2_CHANNEL_ID= # Tier 2 escalation category/channel (email)
EMAIL_ESCALATED3_CHANNEL_ID= # Tier 3 escalation category/channel (email)
# Logging, transcripts, and utility
ROLE_ID_TO_PING= # Role ID to ping on new tickets
TRANSCRIPT_CHANNEL_ID= # Channel for ticket transcripts on close
LOGGING_CHANNEL_ID= # Channel for lifecycle log messages
DEBUGGING_CHANNEL_ID= # Channel for error logs (escalate, poll, etc.); optional
BACKUP_EXPORT_CHANNEL_ID= # Channel where /backup and /export post .txt files; optional
ACCOUNT_INFO_CHANNEL_ID= # Channel for account info lookups; optional
DISCORD_CHANNEL_ID= # General Discord channel (if used)
# --- Discord: Ticket copy & buttons ---
ESCALATION_MESSAGE= # Message shown when a ticket is escalated
BUTTON_LABEL_CLOSE=Close Ticket
BUTTON_LABEL_CLAIM=Claim
BUTTON_LABEL_UNCLAIM=Unclaim
BUTTON_EMOJI_CLOSE=🔒
BUTTON_EMOJI_CLAIM=📌
BUTTON_EMOJI_UNCLAIM=🔓
# --- Google / Gmail ---
GOOGLE_CLIENT_ID= # OAuth2 Client ID from Google Cloud Console
GOOGLE_CLIENT_SECRET= # OAuth2 Client Secret
REFRESH_TOKEN= # OAuth2 refresh token for the support inbox
MY_EMAIL= # Support inbox email address
# --- Zammad ---
ZAMMAD_TOKEN= # Zammad API token
ZAMMAD_URL= # Base URL of Zammad (e.g. https://zammad.example.com or ${NGROK_URL})
ZAMMAD_CLIENT_ID= # Zammad OAuth client ID (if used)
ZAMMAD_CLIENT_SECRET= # Zammad OAuth client secret (if used)
ZAMMAD_EMAIL_GROUP=Email Users # Zammad group for email-sourced tickets
ZAMMAD_DISCORD_GROUP=Discord Users # Zammad group for Discord-sourced tickets
# --- Server & URLs ---
NGROK_URL= # ngrok or public URL (optional; used if ZAMMAD_URL=${NGROK_URL})
ZAMMAD_PORT=3050 # Port for Zammad-related server (if any)
DISCORD_ONLY_PORT=5000 # Port for healthcheck / Discord-only server
# --- Database ---
MONGODB_URI= # MongoDB connection string (e.g. mongodb+srv://user:pass@cluster/dbname)
# --- Branding & copy ---
SUPPORT_NAME=Support
LOGO_URL= # URL of logo shown in embeds (optional)
EMAIL_SIGNATURE= # HTML signature for outgoing emails (use \n for line breaks)
TICKET_CLOSE_SUBJECT_PREFIX=[Resolved]
TICKET_CLOSE_MESSAGE= # Body of closure email
TICKET_CLOSE_SIGNATURE= # Signature on closure email
# --- Ticket limits & permissions ---
GLOBAL_TICKET_LIMIT=5 # Max concurrent open tickets globally
TICKET_LIMIT_PER_CATEGORY=3 # Max tickets per category
RATE_LIMIT_TICKETS_PER_USER=0 # Max tickets per user per window (0 = disabled)
RATE_LIMIT_WINDOW_MINUTES=60 # Window in minutes for per-user rate limit
BLACKLISTED_ROLES= # Comma-separated role IDs that cannot open tickets
ADDITIONAL_STAFF_ROLES= # Comma-separated role IDs with staff permissions
# --- Auto-close ---
AUTO_CLOSE_ENABLED=false
AUTO_CLOSE_AFTER_HOURS=72
AUTO_CLOSE_MESSAGE= # Message when ticket is auto-closed
# --- Reminders ---
REMINDER_ENABLED=false
REMINDER_AFTER_HOURS=24
REMINDER_MESSAGE= # Supports {hours}
TICKET_WELCOME_MESSAGE= # Message when ticket channel is created
TICKET_CLAIMED_MESSAGE= # Supports {staff_name}
TICKET_UNCLAIMED_MESSAGE=
# --- Priority (low, normal, medium, high; default: normal) ---
PRIORITY_ENABLED=false
DEFAULT_PRIORITY=normal
PRIORITY_HIGH_EMOJI=🔴
PRIORITY_MEDIUM_EMOJI=🟡
PRIORITY_LOW_EMOJI=🟢
# --- Claiming ---
CLAIM_TIMEOUT_ENABLED=false
CLAIM_TIMEOUT_HOURS=48
AUTO_UNCLAIM_ENABLED=false
AUTO_UNCLAIM_AFTER_HOURS=24
ALLOW_CLAIM_OVERWRITE=false
# --- Thread-style tickets (legacy) ---
USE_THREADS=false
THREAD_PARENT_CHANNEL=
# --- Game list (comma-separated; used for detection and tags) ---
GAME_LIST=Project Zomboid, Minecraft, ...
# --- Embed colors (hex with 0x prefix) ---
EMBED_COLOR_OPEN=0x00FF00
EMBED_COLOR_CLOSED=0xFF0000
EMBED_COLOR_CLAIMED=0xFFFF00
EMBED_COLOR_ESCALATED=0xFF6600
EMBED_COLOR_INFO=0x1e2124