movi webserver para o firewall

This commit is contained in:
vasco
2026-05-26 13:37:17 +01:00
parent b4ff1c0018
commit 8ee1c901fe
4 changed files with 31 additions and 43 deletions

View File

@@ -8,6 +8,14 @@ IP_INTERNAL="10.60.0.1"
sudo ifconfig enp0s8 $IP_EXTERNAL netmask 255.255.255.0
sudo ifconfig enp0s9 $IP_INTERNAL netmask 255.255.255.0
# 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 mod security e apache
instalar epel-release
instalar httpd
@@ -25,5 +33,20 @@ sudo iptables-save > /etc/sysconfig/iptables
sudo cp conf/httpd.conf /etc/httpd/httpd.conf
# apache
s enable --now httpd
# 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
# apache WAF (desativado por default)
s stop httpd
s disable httpd
# correr juice shop via npm
cd "$jspath"
npm start