SKILL.md
Secrets Check Skill
Verify that all secrets are properly configured before deployment or when debugging issues.
When to Use
- Before deploying to production
- After adding a new API integration
- When debugging API errors (401, 403, timeouts)
- After rotating secrets
Required Environment Variables
Core (Required)
| Variable | Description | Where Used |
|---|---|---|
TELEGRAMBOTTOKEN |
Telegram Bot API token | Telegram connector |
MONGODB_URI |
MongoDB Atlas connection string | Storage layer |
NVIDIAAPIKEY |
NVIDIA NIM API key | LLM fallback |
APPSECRETKEY |
Flask/Quart session secret | Web verification |
VERIFYTOKENSECRET |
Token signing secret | Verification flow |
Optional
| Variable | Description | Default |
|---|---|---|
TOGETHERAPIKEY |
Together AI (legacy) | Not used |
DISCORDBOTTOKEN |
Discord bot | Skeleton |
WHATSAPPACCESSTOKEN |
WhatsApp Cloud API | Skeleton |
Quick Verification
Local Development
# Check .env exists
ls -la .env
# Verify required vars are set (redacted)
grep -E "^(TELEGRAM_BOT_TOKEN|MONGODB_URI|NVIDIA_API_KEY)=" .env | cut -d= -f1
# Check no secrets in code
grep -rE "(nvapi-|mongodb\+srv://[^\"']+:[^\"']+@)" --include="*.py" src/
Render Production
- Go to Render Dashboard → Your Service → Environment
- Verify these are set:
- TELEGRAMBOTTOKEN - MONGODBURI - NVIDIAAPIKEY - APPSECRETKEY - VERIFYTOKEN_SECRET
Checklist
Development Setup
-
.envfile exists (copied fromenv.example) -
TELEGRAMBOTTOKENis set -
MONGODB_URIis set and accessible -
NVIDIAAPIKEYis set (for LLM fallback) -
APPSECRETKEYis random (not default) -
VERIFYTOKENSECRETis random (not default)
Production Setup (Render)
- All required env vars in Render dashboard
- MongoDB Atlas IP allowlist includes only Render egress IPs (never use 0.0.0.0/0 in production)
- Webhook URL configured in Telegram
Code Security
- No hardcoded tokens in code
-
.envis in.gitignore -
env.examplehas placeholder values only
Common Issues
"NVIDIAAPIKEY not set" warning
LLM fallback won't work but bot continues (fail-open).
Fix: Add NVIDIAAPIKEY to Render environment.
MongoDB connection timeout
- Check
MONGODB_URIis correct - Verify IP allowlist in MongoDB Atlas
- Check network connectivity from Render
Telegram webhook not receiving messages
# Check webhook status
curl "https://api.telegram.org/bot<TOKEN>/getWebhookInfo"
# Set webhook
curl -X POST "https://api.telegram.org/bot<TOKEN>/setWebhook" \
-d "url=https://your-app.onrender.com/hooks/telegram"
401/403 from NVIDIA API
- Verify API key is valid
- Check key has correct permissions
- Try regenerating key in NVIDIA dashboard
Secret Rotation
When rotating production secrets:
# 1. Generate new secret
NEW_SECRET=$(openssl rand -hex 32)
echo "New secret: $NEW_SECRET"
# 2. Update in Render dashboard
# 3. Trigger redeploy (push to main or manual deploy)
# 4. Verify health check
curl https://your-app.onrender.com/health
Related Files
env.example- Template for environment variablesdocs/RUNBOOK.md- Full deployment guidesrc/settings.py- Settings loading logic