# Commands to Verify New Code is Loaded ## 1. Check PM2 Logs (Most Important) ```bash # View recent logs pm2 logs gnxsoft-frontend --lines 50 # Follow logs in real-time pm2 logs gnxsoft-frontend # Check for errors pm2 logs gnxsoft-frontend --err --lines 100 ``` ## 2. Check Build Timestamp ```bash # Check when .next directory was last modified ls -ld /var/www/GNX-WEB/frontEnd/.next # Check build info cat /var/www/GNX-WEB/frontEnd/.next/BUILD_ID 2>/dev/null || echo "No BUILD_ID found" # Check standalone build timestamp ls -lh /var/www/GNX-WEB/frontEnd/.next/standalone/server.js 2>/dev/null || echo "Standalone not found" ``` ## 3. Check if New Files Exist ```bash # Check security files ls -la /var/www/GNX-WEB/frontEnd/middleware.ts ls -la /var/www/GNX-WEB/frontEnd/lib/security/sanitize.ts ls -la /var/www/GNX-WEB/frontEnd/app/policy/layout.tsx ls -la /var/www/GNX-WEB/frontEnd/app/support-center/layout.tsx # Check package.json for new dependencies grep -A 2 "isomorphic-dompurify" /var/www/GNX-WEB/frontEnd/package.json ``` ## 4. Check Node Modules (New Dependencies) ```bash # Check if new packages are installed ls -la /var/www/GNX-WEB/frontEnd/node_modules/isomorphic-dompurify 2>/dev/null && echo "✅ isomorphic-dompurify installed" || echo "❌ Not installed" ls -la /var/www/GNX-WEB/frontEnd/node_modules/dompurify 2>/dev/null && echo "✅ dompurify installed" || echo "❌ Not installed" ``` ## 5. Test the Website ```bash # Test homepage curl -I http://localhost:1087 # Test policy page (should work now) curl -I http://localhost:1087/policy # Test support-center page curl -I http://localhost:1087/support-center # Check if middleware is active (should see security headers) curl -I http://localhost:1087 | grep -i "x-content-type-options\|x-frame-options" ``` ## 6. Check PM2 Process Info ```bash # Check process details pm2 describe gnxsoft-frontend # Check process uptime (should be recent if just restarted) pm2 list # Check if process is using new code pm2 show gnxsoft-frontend ``` ## 7. Verify Security Middleware is Active ```bash # Test a request and check for security headers curl -v http://localhost:1087 2>&1 | grep -i "x-content-type-options\|x-frame-options\|content-security-policy" # Test from external (if server is accessible) curl -I https://gnxsoft.com | grep -i "x-content-type-options" ``` ## 8. Check Application Version/Code ```bash # Check if middleware.ts has the latest code head -20 /var/www/GNX-WEB/frontEnd/middleware.ts # Check if sanitize.ts exists and has content wc -l /var/www/GNX-WEB/frontEnd/lib/security/sanitize.ts # Check package.json version grep '"version"' /var/www/GNX-WEB/frontEnd/package.json ``` ## 9. Quick Verification Script ```bash cd /var/www/GNX-WEB/frontEnd echo "=== Deployment Verification ===" echo "" echo "1. Build timestamp:" ls -ld .next 2>/dev/null | awk '{print $6, $7, $8}' echo "" echo "2. Security files:" [ -f middleware.ts ] && echo "✅ middleware.ts exists" || echo "❌ middleware.ts missing" [ -f lib/security/sanitize.ts ] && echo "✅ sanitize.ts exists" || echo "❌ sanitize.ts missing" [ -f app/policy/layout.tsx ] && echo "✅ policy/layout.tsx exists" || echo "❌ policy/layout.tsx missing" echo "" echo "3. Dependencies:" [ -d node_modules/isomorphic-dompurify ] && echo "✅ isomorphic-dompurify installed" || echo "❌ Not installed" echo "" echo "4. PM2 Status:" pm2 list | grep gnxsoft-frontend echo "" echo "5. Recent logs (last 5 lines):" pm2 logs gnxsoft-frontend --lines 5 --nostream ``` ## 10. Check for Specific Code Changes ```bash # Check if policy page has the new structure grep -A 5 "PolicyContentWithParams" /var/www/GNX-WEB/frontEnd/app/policy/page.tsx # Check if sanitizeHTML is being used grep -r "sanitizeHTML" /var/www/GNX-WEB/frontEnd/app/policy/page.tsx grep -r "sanitizeHTML" /var/www/GNX-WEB/frontEnd/components/pages/blog/BlogSingle.tsx ``` ## Most Reliable Check: ```bash # 1. Check PM2 logs for startup messages pm2 logs gnxsoft-frontend --lines 20 --nostream # 2. Test the website directly curl -I http://localhost:1087/policy # 3. Check if new security headers are present curl -I http://localhost:1087 2>&1 | head -20 ```