#!/bin/bash # furt-lua/scripts/cleanup_debug.sh # Clean up debug code and prepare for production echo "๐Ÿงน Cleaning up debug code for production..." # Remove debug config script if [ -f "debug_config.lua" ]; then rm debug_config.lua echo "โœ… Removed debug_config.lua" fi # Check for any remaining DEBUG statements echo -e "\n๐Ÿ” Checking for remaining DEBUG statements:" debug_files=$(grep -r "DEBUG:" src/ 2>/dev/null || true) if [ -n "$debug_files" ]; then echo "โš ๏ธ Found DEBUG statements:" echo "$debug_files" echo "Please remove these manually!" else echo "โœ… No DEBUG statements found" fi # Check for any console.log or print statements that might be debug echo -e "\n๐Ÿ” Checking for debug print statements:" print_files=$(grep -r "print(" src/ | grep -v "-- Allow print" | grep -v "print.*error" || true) if [ -n "$print_files" ]; then echo "โš ๏ธ Found print statements (review if needed for production):" echo "$print_files" else echo "โœ… No debug print statements found" fi # Check test endpoint (should be disabled in production) echo -e "\n๐Ÿ” Checking for test endpoints:" test_endpoints=$(grep -r "/test" src/ || true) if [ -n "$test_endpoints" ]; then echo "โš ๏ธ Found test endpoints (disable in production):" echo "$test_endpoints" else echo "โœ… No test endpoints found" fi # Verify API keys are not hardcoded echo -e "\n๐Ÿ” Checking for hardcoded API keys:" hardcoded_keys=$(grep -r "change-me-in-production" config/ src/ || true) if [ -n "$hardcoded_keys" ]; then echo "โš ๏ธ Found development API keys (change for production):" echo "$hardcoded_keys" else echo "โœ… No hardcoded development keys found" fi echo -e "\nโœ… Debug cleanup complete!" echo "๐Ÿ“‹ Production checklist:" echo " - [ ] Change API keys in .env" echo " - [ ] Disable /test endpoint" echo " - [ ] Set CORS_ALLOWED_ORIGINS for production" echo " - [ ] Configure production SMTP settings" echo " - [ ] Review log levels"