From f80aea0c117d4adf99ee4207e1c3fcc76fb30a64 Mon Sep 17 00:00:00 2001 From: meaz Date: Wed, 22 Dec 2021 06:29:56 +0000 Subject: [PATCH] Update vagrant to php8 and grav to 1.7.24 (#268) In order to better match with what is on prod. Co-authored-by: meaz Reviewed-on: https://git.disroot.org/Disroot/Website/pulls/268 Reviewed-by: antilopa Co-authored-by: meaz Co-committed-by: meaz --- vagrant/bootstrap.sh | 16 ++++++++-------- .../etc/nginx/sites-available/disroot.lan.conf | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index b6698c4d..ecd88eca 100755 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -5,7 +5,7 @@ WEB_NAME="disroot.lan" WEB_ROOT="/var/www/" WWW_USER="www-data" YAML="/var/www/disroot.lan/user/config/system.yaml" -GRAV_VERSION="1.7.21" +GRAV_VERSION="1.7.24" # Provisioning actions apt install dialog @@ -14,7 +14,7 @@ apt install dialog sudo debconf-set-selections <<< "postfix postfix/main_mailer_type select No configuration" sudo debconf-set-selections <<< "postfix postfix/mailname string ${WEB_NAME}" -# Add sury repository to sources.list for PHP7.4 +# Add sury repository to sources.list for php8.0 echo "set grub-pc/install_devices /dev/sda" | debconf-communicate # Fix grub error sudo apt-get -y update sudo apt-get -y dist-upgrade @@ -23,7 +23,7 @@ if ! grep -q "^deb .*sury" /etc/apt/sources.list /etc/apt/sources.list.d/*; then sudo sh -c 'echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/php.list' fi -# Sury Key for PHP7.4 +# Sury Key for php8.0 wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add - sudo apt-get -y update @@ -33,8 +33,8 @@ sudo apt-get install -y nginx-full echo "Installing composer..." sudo apt-get install -y composer -echo "Installing php7..." -sudo apt-get install -y php7.4-zip php7.4-cli php7.4-curl php7.4-gd php7.4-mbstring php7.4-xml php7.4-fpm +echo "Installing php8.0..." +sudo apt-get install -y php8.0 php8.0-zip php8.0-cli php8.0-curl php8.0-gd php8.0-mbstring php8.0-xml php8.0-fpm # Create the Nginx config files and restart webserver echo "Installing Nginx config files..." @@ -89,13 +89,13 @@ fi echo "Enter git" cd "${WEB_ROOT}""${WEB_NAME}" -sudo -u "${WWW_USER}" php7.4 bin/gpm install themer +yes | sudo -u "${WWW_USER}" php8.0 bin/gpm install themer # https://github.com/sommerregen/grav-plugin-themer -sudo -u "${WWW_USER}" php7.4 bin/gpm install tagcloud +yes | sudo -u "${WWW_USER}" php8.0 bin/gpm install tagcloud # https://github.com/Perlkonig/grav-plugin-tagcloud -sudo -u "${WWW_USER}" php7.4 bin/gpm install form +yes | sudo -u "${WWW_USER}" php8.0 bin/gpm install form sudo -u "${WWW_USER}" sed -i 's/quark/disroot/g' "${YAML}" # Add Grav config (the second extra false should be set to true, but it creates an error in Grav ("Trying to access array offset on value of type null") diff --git a/vagrant/provision/etc/nginx/sites-available/disroot.lan.conf b/vagrant/provision/etc/nginx/sites-available/disroot.lan.conf index ff7eaffc..ca02be47 100644 --- a/vagrant/provision/etc/nginx/sites-available/disroot.lan.conf +++ b/vagrant/provision/etc/nginx/sites-available/disroot.lan.conf @@ -29,7 +29,7 @@ server { location ~ /(LICENSE.txt|composer.lock|composer.json|nginx.conf|web.config|htaccess.txt|\.htaccess) { return 403; } location ~ \.php$ { - fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; + fastcgi_pass unix:/var/run/php/php8.0-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_index index.php; include fastcgi_params;