Skip to content

Commit

Permalink
Update setup.sh
Browse files Browse the repository at this point in the history
Fixed errors
  • Loading branch information
michaelsantosti committed Feb 2, 2023
1 parent 7abfbe3 commit e873b55
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,34 @@ sudo apt-get install docker-ce docker-ce-cli containerd.io -y
sudo usermod -aG docker ubuntu

#Install Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

#Install Certbot
sudo apt-get update -y
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update -y
sudo apt-get install certbot -y

# Bind a Work Directory
DIR_CTFD=${DIR_WORK}/CTFd
clear
echo
echo Working Directory: ${DIR_CTFD}
echo

# Catching Domain Name
echo Insira o dominio do CTFd:
echo
echo Insert CTFd domain address (example.com):
read domainctfd
echo
echo Insert valid email ([email protected]):
read domainemail

#Create Certificates
sudo certbot certonly -n --standalone --agree-tos -d $domainctfd
sudo certbot certonly -n --standalone --agree-tos -d $domainctfd -email $domainemail

# Copy config files
cp ./setupfiles/* ${DIR_CTFD}/
sudo chmod 777 CTFd
sudo cp ./setupfiles/* ${DIR_CTFD}/

#Create Certificates Directory
sudo mkdir -p ${DIR_CTFD}/.data/certbot/conf/live/$domainctfd/
Expand All @@ -81,9 +82,9 @@ sudo sed -i 's|WORKDIR|'"$DIR_NAME"'|g' ${DIR_CTFD}/cron_certdocker
cp ${DIR_CTFD}/cron_certdocker /etc/cron.d/certbot

#Default Permissions
sudo chown -R 755 cd ${DIR_CTFD}
sudo chown -R www-data:www-data cd ${DIR_CTFD}
sudo chmod +x cd ${DIR_CTFD}/cert-renew.sh
sudo chown -R 755 ${DIR_CTFD}
sudo chown -R www-data:www-data ${DIR_CTFD}
sudo chmod +x ${DIR_CTFD}/cert-renew.sh

#Compose Docker
cd ${DIR_CTFD}
Expand Down

0 comments on commit e873b55

Please sign in to comment.