- All sensitive data moved to
.envfile -
.envadded to.gitignore -
.env.examplecreated as template - Config validation ensures required vars are set
- Bot token: In
.envonly - User ID: In
.envonly - Webhook secret: Auto-generated, saved to
.webhook_secret - Domain: In
.envonly
Files that WILL NOT be committed:
.env(actual secrets).webhook_secret(webhook token)logs/(may contain sensitive data)*.pyc(compiled Python)
Files that WILL be committed:
.env.example(template only).gitignore(security config)- All source code (no hardcoded secrets)
- Remove hardcoded user ID from README.md
- Remove hardcoded domain from docs
- Use placeholders in examples
Files that need sanitization before open source:
-
README.md
- Line 58: User ID
155489713 - Line 70: Domain
remohp.ermalogi.com
- Line 58: User ID
-
QUICKSTART.md
- Line 17: Bot token
- Line 89: User ID
- Line 102: Domain
-
HOW_TO_RUN.md
- Lines 17, 44, 49: Domain references
-
TROUBLESHOOTING.md
- Lines 10, 37, 58, 92: Domain references
-
cloudflared-config.yml
- Lines 10, 11: Domain
Action: Replace with placeholders like your-domain.com and YOUR_USER_ID
- Move all secrets to
.env - Add
.envto.gitignore - Create
.env.example - Sanitize documentation files
- Review all code for TODO/FIXME comments
- Add LICENSE file (recommend MIT)
- Add CONTRIBUTING.md guide
- Update README.md with setup instructions
- Test fresh install from repo
- Never commit
.envfile - Copy
.env.exampleto.envand fill your values - Keep your bot token private
- Don't share webhook secret
- Use environment variables in production
- Rotate secrets regularly
- Monitor bot logs for unauthorized access
- Use HTTPS only (Cloudflare Tunnel provides this)
| Item | Protection | Status |
|---|---|---|
| Bot Token | .env + .gitignore |
β Secure |
| User ID | .env + .gitignore |
β Secure |
| Webhook Secret | .webhook_secret + .gitignore |
β Secure |
| Domain | .env + .gitignore |
β Secure |
| Code | Public (safe to share) | β Safe |
| Docs | Need placeholders |
If you accidentally commit secrets to git:
- Immediately revoke the bot token via @BotFather
- Create new bot and update
.env - Regenerate webhook secret: Delete
.webhook_secretand restart - Rotate Cloudflare Tunnel if domain exposed
- Review git history: Use
git filter-branchor BFG Repo-Cleaner
Run the sanitization script (coming next) to clean up documentation files.