-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·63 lines (51 loc) · 1.9 KB
/
setup.sh
File metadata and controls
executable file
·63 lines (51 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# HybridSecScan - Script de instalación y configuración del sistema
# Configura el entorno completo para análisis de seguridad híbrido
# Uso: bash setup.sh
set -e
echo "Configurando HybridSecScan - Sistema de Auditoría Híbrida..."
# Verificar Python
if ! command -v python3 &> /dev/null; then
echo "Error: Python 3 no está instalado. Instale Python 3.11 o superior."
exit 1
fi
# Verificar Node.js
if ! command -v node &> /dev/null; then
echo "Error: Node.js no está instalado. Instale Node.js para el frontend."
exit 1
fi
# Crear entorno virtual Python
echo "Creando entorno virtual aislado de Python..."
python3 -m venv venv
source venv/bin/activate
# Instalar dependencias Python
echo "Instalando dependencias de Python en entorno aislado..."
pip install --upgrade pip
pip install -r requirements.txt
# Instalar herramientas SAST adicionales si no están ya instaladas
echo "Instalando herramientas de análisis estático de seguridad..."
pip install semgrep || echo "Advertencia: Semgrep ya instalado o error en instalación"
# Configurar frontend
echo "Configurando interfaz de usuario frontend..."
cd frontend
npm install
cd ..
# Crear base de datos
echo "Inicializando esquema de base de datos..."
cd backend
python -c "from main import engine, Base; Base.metadata.create_all(bind=engine); print('Base de datos creada correctamente')"
cd ..
# Verificar instalación
echo "Verificando instalación del sistema..."
echo "Python: $(python3 --version)"
echo "Node.js: $(node --version)"
echo "Bandit: $(python -m bandit --version 2>/dev/null || echo 'No instalado')"
echo "Semgrep: $(semgrep --version 2>/dev/null || echo 'No instalado')"
echo ""
echo "Instalación completada exitosamente."
echo ""
echo "Para iniciar la aplicación:"
echo "1. Backend: cd backend && uvicorn main:app --reload"
echo "2. Frontend: cd frontend && npm run dev"
echo ""
echo "Luego acceda a: http://localhost:5173"