This project uses environment variables for sensitive configuration. Never commit your .env file or expose your API keys.
DISCORD_BOT_TOKEN- Your Discord bot token (keep secret!)CLIENT_ID- Your Discord application client IDGROQ_API_KEY- Your Groq API key for AI features
MAPBOX_API_KEY- For enhanced earthquake maps (recommended)GUILD_ID- For development/testing in a specific serverCHANNEL_ID- For development/testingDB_PATH- Custom database locationPOLLING_INTERVAL_MINUTES- How often to check for earthquakes (default: 5)
-
Copy
.env.exampleto.env:cp .env.example .env
-
Fill in your actual API keys in
.env -
Never commit
.envto git - it's already in.gitignore
If you accidentally commit secrets to git:
-
Immediately rotate all exposed credentials:
- Discord: Regenerate bot token at Discord Developer Portal
- Mapbox: Revoke and create new token at Mapbox Account
- Groq: Revoke and create new key at Groq Console
-
Remove from git history:
# Option 1: Using BFG Repo Cleaner (recommended) # Download from https://rtyley.github.io/bfg-repo-cleaner/ bfg --delete-files .env git reflog expire --expire=now --all git gc --prune=now --aggressive # Option 2: Using git filter-branch git filter-branch --force --index-filter \ "git rm --cached --ignore-unmatch .env" \ --prune-empty --tag-name-filter cat -- --all
-
Force push to all remotes:
git push origin --force --all git push origin --force --tags
-
Update your
.envwith the new credentials
- β
Use
.env.exampleas a template (no real secrets) - β
Keep
.envin.gitignore - β Rotate keys regularly
- β Use different keys for development and production
- β Limit API key permissions to only what's needed
- β Never share your
.envfile - β Never commit secrets to git
- β Never post secrets in issues or discussions
If you discover a security vulnerability, please email the maintainer directly rather than opening a public issue.