installation de caddy dans le script install

This commit is contained in:
Valentin 2024-02-23 15:01:45 +01:00
parent 5ad1c3b517
commit cd2b3aafba
2 changed files with 33 additions and 3 deletions

View File

@ -12,7 +12,7 @@ On a fresh install as root user
2. Install git
`apt install git -y`
`apt install -y git`
3. Download and make the instal script executable

View File

@ -23,7 +23,8 @@ fi
echo "Generate and store the password somewhere safe"
read -s -p "Enter password: " password
echo
useradd -m "$username"
useradd -m "$username"
chsh -s /bin/bash $username
echo "$username:$password" | chpasswd
usermod -aG sudo $username
@ -39,4 +40,33 @@ echo "Setup SSH"
touch /etc/ssh/sshd_config.d/custom.conf
echo "PermitRootLogin no" >> /etc/ssh/sshd_config.d/custom.conf
echo "PermitEmptyPasswords no" >> /etc/ssh/sshd_config.d/custom.conf
systemctl reload ssh
systemctl reload ssh
#
# FIREWALL AND FAIL2BAN
#
echo "Setup Firewall and Fail2Ban"
apt install -y ufw fail2ban
systemctl enable fail2ban
ufw allow ssh
ufw allow http
ufw allow https
#
# TODO : ZABBIX AND URBACKUP
#
echo "TODO : Zabbix and Urbackup"
#
# CADDY
#
echo "Install Caddy Webserver"
apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list
apt update
apt install -y caddy
caddy run