- Remove production_test_sequence.sh (DAW-specific production tests) - Remove setup_env.sh (obsolete .env setup, replaced by furt.conf) - Sanitize test scripts: replace dragons-at-work.de with example.com - Sanitize API keys: replace dev keys with placeholder values - Remove hardcoded DAW fallbacks from http_server.lua and smtp.lua - Update .gitignore to exclude production-specific test files Tests remain functional for developers with example domains. All internal DAW infrastructure details removed from package. Closes #101
61 lines
2 KiB
Bash
Executable file
61 lines
2 KiB
Bash
Executable file
#!/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"
|
|
|