From 4e31c0a1364f7cb6dc8bfec8bde82603ccd89d06 Mon Sep 17 00:00:00 2001 From: Emile Date: Mon, 21 Oct 2019 16:02:56 +0200 Subject: subdividet the setup in sections --- setup.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/setup.sh b/setup.sh index bc45c83..221e12b 100755 --- a/setup.sh +++ b/setup.sh @@ -14,6 +14,10 @@ echo "- docker (with a running docker-server)" echo "- docker-compose" echo "- htpasswd (apache2-utils)" +# +# General confiuration +# + # get a hostname and a ctfname from the user read -e -p "HOSTNAME: " -i "ctf.flexerilla.team" HOSTNAME read -e -p "CTFNAME: " -i "FlexCTF" CTFNAME @@ -22,6 +26,10 @@ read -e -p "CTFNAME: " -i "FlexCTF" CTFNAME echo "HOSTNAME=$HOSTNAME" > .env echo "CTFNAME=$CTFNAME" >> .env +# +# Traefik configuration +# + # Read Traefik creds from the user read -e -p "Traefik username: " -i "traefik" TRAEFIK_USER read -e -p "Traefik password: " -i "secret" TRAEFIK_PASSWORD @@ -32,6 +40,10 @@ TRAEFIK_CREDS=$(htpasswd -nb $TRAEFIK_USER $TRAEFIK_PASSWORD) # Write the creds to the traefik users file echo "$TRAEFIK_CREDS" >> traefik_users +# +# Grafana configuration +# + # Grafana settings read -e -p "Grafana server: " -i "https://grafana.$HOSTNAME:3000" GF_SERVER_ROOT_URL read -e -p "Grafana admin pwd: " -i "secret" GF_SECURITY_ADMIN_PASSWORD @@ -40,6 +52,10 @@ read -e -p "Grafana admin pwd: " -i "secret" GF_SECURITY_ADMIN_PASSWORD echo "GF_SERVER_ROOT_URL=$GF_SERVER_ROOT_URL" > grafana.env echo "GF_SECURITY_ADMIN_PASSWORD=$GF_SECURITY_ADMIN_PASSWORD" >> grafana.env +# +# Pull images from the darknebu.la registry +# + echo "Login to the darknebu.la registry to pull the images:" docker login registry.darknebu.la @@ -49,6 +65,10 @@ echo "Pulling docker images needed..." docker pull registry.darknebu.la/circus/companion:latest docker pull registry.darknebu.la/circus/vpn:latest +# +# Start the docker-compose +# + # Ask if the circus should be started read -p "Do you want to start the circus now? (y/n) " -n 1 -r echo # (optional) move to a new line -- cgit 1.4.1