#!/bin/bash
apt update
apt upgrade
apt -y install sudo lsb-release apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
sudo apt update
apt -y install unzip nginx php8.0 php8.0-{fpm,cli,gd,zip,xml,sqlite3,curl,mbstring}
cd /var/www
wget https://gowwannetwork.fr/depot/CMS/nextcloud.zip && unzip nextcloud.zip && chown -R www-data:www-data nextcloud/ && rm nextcloud.zip
cd /etc/nginx/sites-enabled
rm default
wget https://gowwannetwork.fr/depot/CMS/CONF/nextcloud.conf
nginx -s reload