Maintenance & Best Practices
Regular Maintenance Schedule
Section titled “Regular Maintenance Schedule”- ✅ Monitor bot health
- ✅ Check error logs
- ✅ Review suspicious users
- ✅ Verify payment processing
Weekly
Section titled “Weekly”- ✅ Backup database
- ✅ Review user access logs
- ✅ Check resource usage
- ✅ Test recovery procedures
Monthly
Section titled “Monthly”- ✅ Update Docker images
- ✅ Review security settings
- ✅ Audit user permissions
- ✅ Plan improvements
Quarterly
Section titled “Quarterly”- ✅ Full security audit
- ✅ Review and rotate keys
- ✅ Performance tuning
- ✅ Compliance check
Database Backup
Section titled “Database Backup”-
Manual Backup
Terminal window docker compose exec postgres pg_dump \-U remnawave \-d remnawave \> backup_$(date +%Y%m%d_%H%M%S).sql -
Automated Backup Create
/usr/local/bin/backup-bot.sh:#!/bin/bashDATE=$(date +%Y%m%d_%H%M%S)docker compose -f /path/to/docker-compose.yaml exec postgres \pg_dump -U remnawave -d remnawave \> /backups/bot_$DATE.sqlgzip /backups/bot_$DATE.sql -
Add to Cron
Terminal window crontab -e# Run daily at 2 AM0 2 * * * /usr/local/bin/backup-bot.sh -
Test Restore
Terminal window # Verify backup is validgunzip -c backup_20241110_020000.sql.gz | head -100
Updates & Upgrades
Section titled “Updates & Upgrades”Update Bot
Section titled “Update Bot”# Check for updatesdocker pull ghcr.io/jolymmiels/remnawave-telegram-shop-bot:latest
# Updatedocker compose pulldocker compose downdocker compose up -d
# Verifydocker compose logs -f remnawave-telegram-shop-botUpdate Dependencies
Section titled “Update Dependencies”Monitor for security updates:
# Check for vulnerabilitiesdocker scout cves ghcr.io/jolymmiels/remnawave-telegram-shop-bot
# Update base image if issues founddocker compose build --pullVersion Compatibility
Section titled “Version Compatibility”Always check compatibility before updating:
| Remnawave | Bot |
|---|---|
| 1.6 | 2.3.6 |
| 2.0.0 - 2.1.9 | 3.2.4 |
| 2.2.* | 3.2.5 |
| 2.3.* | 3.5.* |
Security Hardening
Section titled “Security Hardening”Environment Security
Section titled “Environment Security”# Never commit .envecho ".env" >> .gitignore
# Restrict file permissionschmod 600 .env
# Use strong passwordsopenssl rand -base64 32API Key Rotation
Section titled “API Key Rotation”# Every 90 days1. Generate new key in payment/Remnawave dashboard2. Update .env file3. Restart bot4. Delete old key after verificationAccess Control
Section titled “Access Control”- Limit admin Telegram IDs
- Use strong authentication
- Enable 2FA where available
- Monitor access logs
Performance Optimization
Section titled “Performance Optimization”Database Optimization
Section titled “Database Optimization”# Connect to PostgreSQLdocker compose exec postgres psql -U remnawave -d remnawave
# Check table sizesSELECT schemaname, tablename, pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename))FROM pg_tablesORDER BY pg_total_relation_size(schemaname||'.'||tablename) DESC;
# Vacuum and analyzeVACUUM ANALYZE;
# Check index usageSELECT * FROM pg_stat_user_indexes ORDER BY idx_scan DESC;Server Resources
Section titled “Server Resources”Monitor and adjust:
# Check usagedocker stats remnawave-telegram-shop-bot
# Update limits in docker-compose.yamlservices: remnawave-telegram-shop-bot: deploy: resources: limits: cpus: '1' memory: 1GDisaster Recovery
Section titled “Disaster Recovery”Backup Restoration
Section titled “Backup Restoration”# Stop servicesdocker compose down
# Restore databasegunzip -c backup_latest.sql.gz | \ docker compose exec -T postgres \ psql -U remnawave -d remnawave
# Start servicesdocker compose up -dVerification After Restore
Section titled “Verification After Restore”# Check data integritydocker compose exec postgres psql -U remnawave -d remnawave \ -c "SELECT COUNT(*) FROM subscriptions;"
# Test botdocker compose logs -f remnawave-telegram-shop-botCapacity Planning
Section titled “Capacity Planning”Plan for growth:
Current Users: 1,000Growth Rate: 20% per monthEstimate: 3,200 users in 6 months
Resource Needs:- Database: +50GB- Bot Memory: +200MB- Network: +100MbpsDocumentation
Section titled “Documentation”Keep detailed records:
- ✅ Configuration changes
- ✅ Security incidents
- ✅ Performance issues
- ✅ User complaints
- ✅ System upgrades
Troubleshooting Common Issues
Section titled “Troubleshooting Common Issues”| Issue | Cause | Solution |
|---|---|---|
| Bot slow | High traffic | Scale up resources |
| DB full | Large tables | Archive old data |
| Payments fail | API issue | Check connectivity |
| Memory leak | Buggy version | Update bot |
Support Resources
Section titled “Support Resources”- GitHub Issues: Report bugs
- Documentation: This site
- Telegram Community: Join group
- Commercial Support: Available (contact)