furt/scripts/cleanup_debug.sh

62 lines
2 KiB
Bash
Raw Normal View History

#!/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"