Last active
November 15, 2022 20:05
-
-
Save LevitatingBusinessMan/540a2ffb48976c9d1b5c84304f9a913a to your computer and use it in GitHub Desktop.
Create juice shops
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
lastport=`cat ~/.lastport || echo 4000` | |
newport=$(($lastport+1)) | |
docker run -d -e "CTF_KEY=juicelympicsgobrrrrr" -e "NODE_ENV=ctf" -p $newport:3000 bkimminich/juice-shop | |
echo $newport > ~/.lastport | |
vhost=`echo $RANDOM | md5sum | head -c 5` | |
cat << END | sudo tee /etc/nginx/vhosts/$vhost.conf | |
server { | |
listen 80; | |
server_name $vhost.levitati.ng; | |
location / { | |
proxy_pass http://localhost:$newport; | |
} | |
} | |
END | |
sudo nginx -s reload | |
echo $vhost.levitati.ng |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment