This commit is contained in:
vasco
2026-05-23 14:24:00 +01:00
parent ddcaf33130
commit 7a5767ef64
3 changed files with 29 additions and 19 deletions

View File

@@ -2,27 +2,34 @@
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
# instalar packages
instalar nodejs
# instalar juice-shop se nao existir
jspath="/var/juice-shop"
if [[ ! -d "$jspath" ]]; then
mkdir "$jspath"
curl -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"
tar -xzvf js.tar.gz "$jspath"
rm js.tar.gz
cd "$jspath"
npm i
fi
# fazer so depois de instalar tudo
ativar_firewall
# correr juice shop via npm
cd "$jspath"
npm start