HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: /home/u300739242/domains/wayoutmaps.nubify.agency/public_html/eventmaps/verify-production.sh
#!/bin/bash

echo "🔍 VERIFICACIÓN DE CONFIGURACIÓN PARA PRODUCCIÓN"
echo "=================================================="
echo ""

# Colores
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color

# 1. Verificar archivo .env
echo "1️⃣  Verificando archivo .env..."
if [ -f .env ]; then
    echo -e "${GREEN}✅ Archivo .env existe${NC}"
    
    # Verificar Google Maps API Key
    if grep -q "GOOGLE_MAPS_API_KEY=" .env; then
        MAPS_KEY=$(grep "GOOGLE_MAPS_API_KEY=" .env | cut -d '=' -f2)
        if [ -z "$MAPS_KEY" ]; then
            echo -e "${RED}❌ GOOGLE_MAPS_API_KEY está vacío${NC}"
        else
            echo -e "${GREEN}✅ GOOGLE_MAPS_API_KEY configurado${NC}"
        fi
    else
        echo -e "${RED}❌ GOOGLE_MAPS_API_KEY no encontrado en .env${NC}"
    fi
    
    # Verificar APP_ENV
    if grep -q "APP_ENV=production" .env; then
        echo -e "${GREEN}✅ APP_ENV=production${NC}"
    else
        echo -e "${YELLOW}⚠️  APP_ENV no está en 'production'${NC}"
    fi
else
    echo -e "${RED}❌ Archivo .env no existe${NC}"
fi

echo ""

# 2. Verificar permisos de storage
echo "2️⃣  Verificando permisos de storage..."
if [ -d storage ]; then
    STORAGE_PERMS=$(stat -f "%OLp" storage 2>/dev/null || stat -c "%a" storage 2>/dev/null)
    if [ "$STORAGE_PERMS" = "775" ] || [ "$STORAGE_PERMS" = "777" ]; then
        echo -e "${GREEN}✅ Permisos de storage: $STORAGE_PERMS${NC}"
    else
        echo -e "${YELLOW}⚠️  Permisos de storage: $STORAGE_PERMS (recomendado: 775)${NC}"
        echo "   Ejecuta: chmod -R 775 storage"
    fi
else
    echo -e "${RED}❌ Directorio storage no existe${NC}"
fi

echo ""

# 3. Verificar cache
echo "3️⃣  Verificando cache de vistas..."
if [ -d storage/framework/views ]; then
    VIEW_CACHE_COUNT=$(find storage/framework/views -name "*.php" | wc -l)
    echo -e "${YELLOW}📦 Archivos en cache de vistas: $VIEW_CACHE_COUNT${NC}"
    echo "   Para limpiar: php artisan view:clear"
else
    echo -e "${RED}❌ Directorio de cache de vistas no existe${NC}"
fi

echo ""

# 4. Verificar base de datos
echo "4️⃣  Verificando conexión a base de datos..."
php artisan tinker --execute="try { DB::connection()->getPdo(); echo '✅ Conexión a BD exitosa'; } catch (\Exception \$e) { echo '❌ Error de conexión: ' . \$e->getMessage(); }" 2>/dev/null

echo ""
echo ""

# 5. Verificar tabla events
echo "5️⃣  Verificando tabla events..."
php check-location-setting.php 2>/dev/null

echo ""

# 6. Verificar assets compilados
echo "6️⃣  Verificando assets compilados..."
if [ -d public/build ]; then
    echo -e "${GREEN}✅ Directorio public/build existe${NC}"
    BUILD_FILES=$(find public/build -type f | wc -l)
    echo "   Archivos compilados: $BUILD_FILES"
else
    echo -e "${YELLOW}⚠️  Directorio public/build no existe${NC}"
    echo "   Ejecuta: npm run build"
fi

echo ""

# 7. Verificar archivo de vista
echo "7️⃣  Verificando archivo de vista..."
if [ -f resources/views/public/map/show.blade.php ]; then
    echo -e "${GREEN}✅ Archivo show.blade.php existe${NC}"
    
    # Verificar si el botón de ubicación está en el código
    if grep -q "location-button" resources/views/public/map/show.blade.php; then
        echo -e "${GREEN}✅ Botón de ubicación encontrado en el código${NC}"
    else
        echo -e "${RED}❌ Botón de ubicación NO encontrado en el código${NC}"
    fi
else
    echo -e "${RED}❌ Archivo show.blade.php no existe${NC}"
fi

echo ""
echo "=================================================="
echo "📋 RESUMEN DE COMANDOS RECOMENDADOS"
echo "=================================================="
echo ""
echo "Si encontraste problemas, ejecuta en este orden:"
echo ""
echo "1. Limpiar cache:"
echo "   bash clear-all-cache.sh"
echo ""
echo "2. Habilitar ubicación para evento:"
echo "   php artisan tinker --execute=\"App\Models\Event::find(10)->update(['enable_user_location' => true]);\""
echo ""
echo "3. Compilar assets (si usas Vite):"
echo "   npm run build"
echo ""
echo "4. Regenerar cache optimizado:"
echo "   php artisan optimize"
echo ""
echo "5. Verificar en navegador con Ctrl+Shift+R (hard reload)"
echo ""