From 3e98656ba03efacb45db7e9d679455df33cdc50c Mon Sep 17 00:00:00 2001 From: meaz Date: Sat, 28 Dec 2019 09:12:23 +0100 Subject: [PATCH 1/3] Update to php7.4 and composer 1.9.1, fix some typos --- vagrant/bootstrap.sh | 21 ++++++++++++------- .../nginx/sites-available/disroot.lan.conf | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index 5c562c18..5998f77b 100755 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -7,21 +7,26 @@ WWW_USER="www-data" # Provisioning actions -# Add sury repository to sources.list for PHP7.1 +# Add sury repository to sources.list for PHP7.4 sudo apt-get -y update sudo apt-get -y upgrade sudo apt-get -y install ca-certificates apt-transport-https echo "deb https://packages.sury.org/php/ stretch main" | sudo tee -a /etc/apt/sources.list.d/php.list -# Sury Key for PHP7.1 + +# Sury Key for PHP7.4 wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add - sudo apt-get -y update -echo "Installing nginx.." -sudo apt-get install -y nginx-full composer -echo "Installing php7.." -sudo apt-get install -y php7.3-zip php7.3-cli php7.3-curl php7.3-gd php7.3-mbstring php7.3-xml php7.3-fpm +echo "Installing nginx..." +sudo apt-get install -y nginx-full -# Create the Apache config files and restart webserver +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 + +# Create the Nginx config files and restart webserver sudo rsync -cr /vagrant/provision/etc/nginx/sites-available /etc/nginx/ sudo ln -s /etc/nginx/sites-available/"${WEB_NAME}".conf /etc/nginx/sites-enabled/"${WEB_NAME}".conf sudo rm /etc/nginx/sites-enabled/default @@ -29,7 +34,7 @@ sudo service nginx restart # Install GRAV in webroot sudo chown -R ${WWW_USER}:${WWW_USER} /var/www -sudo wget https://getcomposer.org/download/1.8.0/composer.phar -O /usr/local/bin/composer && sudo chmod 755 /usr/local/bin/composer +sudo wget https://getcomposer.org/download/1.9.1/composer.phar -O /usr/local/bin/composer && sudo chmod 755 /usr/local/bin/composer echo "Git" git clone -b master https://github.com/getgrav/grav.git "${WEB_ROOT}""${WEB_NAME}" sudo chown -R ${WWW_USER}:${WWW_USER} "${WEB_ROOT}" diff --git a/vagrant/provision/etc/nginx/sites-available/disroot.lan.conf b/vagrant/provision/etc/nginx/sites-available/disroot.lan.conf index 46bf4b85..ff7eaffc 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.3-fpm.sock; + fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_index index.php; include fastcgi_params; From 662f84d572cea8824fbfea8e7bd7153eea4c20fa Mon Sep 17 00:00:00 2001 From: meaz Date: Sat, 28 Dec 2019 12:07:50 +0100 Subject: [PATCH 2/3] Change the vagrant readme to explain that it can be used, even imperfect --- vagrant/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vagrant/README.md b/vagrant/README.md index 9d8227a4..42a103d8 100644 --- a/vagrant/README.md +++ b/vagrant/README.md @@ -1,4 +1,4 @@ -## This Vagrant setup is still Work in Progress and not ready to use as is. +## This Vagrant setup is still Work in Progress, though it can be used as is. # Disroot Website Development Environment using Vagrant From 303d240ffb8f8a898f0e7fc65a5a35d8ddce78f7 Mon Sep 17 00:00:00 2001 From: meaz Date: Sat, 28 Dec 2019 12:43:50 +0100 Subject: [PATCH 3/3] add default options for Grav in Vagrant --- vagrant/bootstrap.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index 5998f77b..e3638353 100755 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -64,6 +64,9 @@ sudo -u "${WWW_USER}" sed -i '4d' "${WEB_ROOT}""${WEB_NAME}"/user/config/system. sudo -u "${WWW_USER}" ex -s -c "4i| alias: '/home'" -c x "${WEB_ROOT}""${WEB_NAME}"/user/config/system.yaml sudo -u "${WWW_USER}" -i 's/false/true/g' "${WEB_ROOT}""${WEB_NAME}"/user/plugins/language-selector/language-selector.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") +sed -i "s/extra:\ false/\extra:\ false\n\ auto_line_breaks:\ true\n\ auto_url_links:\ true\n\ escape_markup:\ false\n\ special_chars:\n\ \'\>\':\ \'gt\'\n\ \'\<\':\ \'lt\'/" "${WEB_ROOT}""${WEB_NAME}"/user/config/system.yaml + # Add website domain to local /etc/hosts file sudo sed -i "s/127.0.0.1\tlocalhost/127.0.0.1\tlocalhost $WEB_NAME/" /etc/hosts