Files
FSI/WEB_SERVER.sh
vasco 7a5767ef64 fix
2026-05-23 14:24:00 +01:00

36 lines
900 B
Bash

#!/bin/bash
source CONFIG.sh
# instalar packages
if ! command -v node &> /dev/null || [[ "$(node -v)" != v24.* ]]; then
echo "Configurando repositório do Node.js 24..."
curl -fsSL https://rpm.nodesource.com/setup_24.x | sudo bash -
sudo yum remove -y nodejs
fi
instalar nodejs
# instalar juice-shop se nao existir
jspath="/var/juice-shop"
if [[ ! -f "$jspath/package.json" ]]; then
sudo mkdir -p "$jspath"
curl -L -o js.tar.gz "https://github.com/juice-shop/juice-shop/releases/download/v20.0.0/juice-shop-20.0.0_node24_linux_x64.tgz"
sudo tar -xzvf js.tar.gz -C "$jspath" --strip-components=1
rm js.tar.gz
sudo chown -R $USER:$USER "$jspath"
fi
# fazer so depois de instalar tudo
ativar_firewall
# interfaces
IP="10.60.0.2"
sudo ifconfig enp0s8 $IP netmask 255.255.255.0
sudo route add default gw 10.60.0.1
# correr juice shop via npm
cd "$jspath"
npm start