Skip to content

Commit

Permalink
Merge branch 'develop' into jammy-vvv
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjn authored Sep 20, 2024
2 parents 5914823 + 6e02f3b commit 0aa4880
Show file tree
Hide file tree
Showing 43 changed files with 360 additions and 304 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
*.gif binary
*.jpg binary
*.jpeg binary
*.gpg binary
2 changes: 1 addition & 1 deletion .github/workflows/vvv-provisioning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Create Vagrant Like Environment
run: |
# uninstall pre installed packages (to test if extensions work)
sudo apt-get -q --autoremove --purge remove php*
sudo apt-get -q --autoremove --purge remove php* mysql*
sudo apt-get -q autoclean
# remove pre-installed composer
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Icon\r\r

# Because this really is a working directory, ignore vagrant's files
/.vagrant
vagrant.log

# This is a file intended for hooking in a custom Vagrant configuration on up
/Customfile
Expand Down
41 changes: 39 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,37 @@ permalink: /docs/en-US/changelog/

# Changelog

## 3.13 ( 2024 TBA )
## 3.14 ( 2024 ETA )

### Enhancements

* Upgraded MariaDB from 10.5 to 10.11 ( #2728 )
* Only start services that aren't running in post-up scripts ( #2732 )

### Bug Fixes

* VVV will check if Parallels is installed before defaulting to docker on Arm64/Apple Silicon due to issues with Docker detection ( #2722 )
* Switched from Rackspace to Starburst services for MariaDB mirrors ( #2728 )
* Fixes for service starts under some situations in Docker ( #2732 )
* Fixed an issue with trailing slashes and site provisioners introduced in an earlier version (#2731)

### Maintenance

* Removed commented out subversion config lines that were flagged as a false positive security issue ( #2725 )
* Adjusted the domains used in the network check to remove unused domains and add some that are used ( #2734 )

## 3.13.2 ( 2024 July 19th )

### Enhancements

* VVV now shows a missing dashboard page with help when `www/default/index.php` is accidentally deleted instead of a HTTP forbidden error ( #2714 )

### Bug Fixes

* VVV will check if Docker is installed before defaulting to it on Arm64/Apple Silicon ( #2715 )
* Fixed MySQL issues in GitHub Actions ( #2716 )

## 3.13.1 ( 2024 June 16th )

### Enhancements

Expand All @@ -20,12 +50,19 @@ permalink: /docs/en-US/changelog/
* Better PHP Debug mod switching outputs and checks ( #2702 )
* PHP Info and Xdebug info pages now state their versions ( #2702 )

### Maintenance

* Switch the Parallels Arm64 box from `mpasternak/focal64-arm` to `bento/ubuntu-20.04-arm64` to match x86 boxes ( #2695 )

### Bug Fixes

* The host file inside the VM was only adding sites with `127.0.0.1` addresses, now it adds the IPVv6 `::1` too ( #2689 )
* Fixes for hosts file cleanup ( #2708 )
* Removed old MacOS PR workflows, no runners available ( #2698 )
* Replace an outdated Nginx signing key ( #2710 )
* Don't sync clocks when using the docker provider ( #2711 )

## 3.12 ( 2023 August 3rd )
## 3.12.1 ( 2023 August 3rd )

### Enhancements

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/206b06167aaf48aab24422cd417e8afa)](https://www.codacy.com/gh/Varying-Vagrant-Vagrants/VVV?utm_source=github.com&utm_medium=referral&utm_content=Varying-Vagrant-Vagrants/VVV&utm_campaign=Badge_Grade) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/varying-vagrant-vagrants/vvv.svg)](http://isitmaintained.com/project/varying-vagrant-vagrants/vvv "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/varying-vagrant-vagrants/vvv.svg)](http://isitmaintained.com/project/varying-vagrant-vagrants/vvv "Percentage of issues still open")

VVV is a local developer environment, mainly aimed at [WordPress](https://wordpress.org) developers. It uses [Vagrant](https://www.vagrantup.com) and VirtualBox/Parallels/HyperV to create a linux server environment for building sites, and contributing to WordPress itself.
VVV is a local developer environment, mainly aimed at [WordPress](https://wordpress.org) developers. It uses [Vagrant](https://www.vagrantup.com) and Docker/VirtualBox/Parallels/HyperV to create a linux server environment for building sites, and contributing to WordPress itself.

_VVV stands for Varying Vagrant Vagrants._

Expand Down
24 changes: 20 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ def sudo_warnings
# exit
end


def vvv_is_docker_present()
if `docker version`
return true
end
return false
end

def vvv_is_parallels_present()
return Vagrant.has_plugin?("vagrant-parallels")
end

vagrant_dir = __dir__
show_logo = false
branch_c = "\033[38;5;6m" # 111m"
Expand Down Expand Up @@ -214,12 +226,16 @@ vvv_config['general'] = {} unless vvv_config['general'].is_a? Hash

defaults = {}
defaults['memory'] = 2048
defaults['cores'] = 1
defaults['cores'] = 2
defaults['provider'] = 'virtualbox'

# if Arm default to docker
# if Arm default to docker then parallels
if Etc.uname[:version].include? 'ARM64'
defaults['provider'] = 'docker'
if vvv_is_parallels_present()
defaults['provider'] = 'parallels'
else
defaults['provider'] = 'docker'
end
end

# This should rarely be overridden, so it's not included in the config/default-config.yml file.
Expand Down Expand Up @@ -329,7 +345,7 @@ if show_logo
when 'hyperv'
provider_version = 'n/a'
when 'docker'
provider_version = VagrantPlugins::DockerProvider::Driver.new.execute("docker", "-v").gsub("Docker version ", "")
provider_version = `docker -v`.gsub("Docker version ", "")
else
provider_version = '??'
end
Expand Down
12 changes: 6 additions & 6 deletions config/homebin/db_backup
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Create individual SQL files for each database. These files
# are imported automatically during an initial provision if
Expand All @@ -10,7 +10,7 @@ if [ -z "${VVV_LOG+x}" ]; then
export VVV_LOG=""
fi

trap 'rm -rf $TMPFIFODIR' EXIT; TMPFIFODIR=$(mktemp -d); mkfifo $TMPFIFODIR/dbnames
trap 'rm -rf $TMPFIFODIR' EXIT; TMPFIFODIR=$(mktemp -d); mkfifo "${TMPFIFODIR}/dbnames"

source /srv/provision/provision-helpers.sh

Expand All @@ -21,7 +21,7 @@ gzip=$(get_config_value "general.db_backup.gzip")
exclude_list=$(get_config_values "general.db_backup.exclude")

vvv_info " * Fetching Database names"
mysql -e 'show databases' | grep -v -F "Database" > $TMPFIFODIR/dbnames &
mysql -e 'show databases' | grep -v -F "Database" > "${TMPFIFODIR}/dbnames" &
while read db_name; do
# skip these databases
[ "${db_name}" == "mysql" ] && vvv_info " - skipped <b>${db_name}</b>" && continue;
Expand All @@ -32,7 +32,7 @@ while read db_name; do
[ "${db_name}" == "wordpress_unit_tests" ] && vvv_info " - skipped <b>${db_name}</b>" && continue;

skip="false"
for exclude in ${exclude_list[@]}; do
for exclude in "${exclude_list[@]}"; do
if [ "${exclude}" == "${db_name}" ]; then
skip="true"
fi
Expand All @@ -51,7 +51,7 @@ while read db_name; do
fi
fi
databases+=( "${db_name}" )
done < $TMPFIFODIR/dbnames
done < "${TMPFIFODIR}/dbnames"

ext=".sql"
if [[ "${gzip}" == "True" ]]; then
Expand All @@ -67,7 +67,7 @@ do
else
mysqldump "${db}" > "/srv/database/backups/${db}.sql";
fi
let "count=count+1"
count=$((count+1))
done

vvv_success " * Finished backing up databases to the <b>database/sql/backups</b><success> folder</success>"
2 changes: 1 addition & 1 deletion config/homebin/db_restore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Restore individual SQL files for each database.
. /srv/database/import-sql.sh
4 changes: 2 additions & 2 deletions config/homebin/is_utility_installed
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
#!/usr/bin/env bash
utilities=$(shyaml get-values "utilities.${1}" 2> /dev/null < "${VVV_CONFIG}")
for utility in ${utilities}; do
if [[ "${utility}" == "${2}" ]]; then
exit 0
exit 0
fi
done
exit 1
2 changes: 1 addition & 1 deletion config/homebin/makepot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Convenience script to run makepot.php

php /srv/www/wordpress-develop/tools/i18n/makepot.php $1 $2 $3 $4
2 changes: 1 addition & 1 deletion config/homebin/tideways_off
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

switch_php_debugmod none

2 changes: 1 addition & 1 deletion config/homebin/tideways_on
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/usr/bin/env bash

switch_php_debugmod tideways
2 changes: 1 addition & 1 deletion config/homebin/vagrant
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ echo -e "${YELLOW} █░░█░░░░░░▄▀ ${CRESET}"
echo -e "${YELLOW}──────────────────────${CRESET}"
echo ""
echo -e "${PURPLE} ! You're still SSH'd into the VVV virtual machine!${CRESET}"
echo -e "${PURPLE} Run exit and try again${CRESET}"
echo -e "${PURPLE} Run exit and try again${CRESET}"
6 changes: 3 additions & 3 deletions config/homebin/vagrant_destroy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This script is run whenever `vagrant destroy` is used to destroy
# the virtual machine. To customize this behavior, include a file
Expand All @@ -18,9 +18,9 @@ else
fi

# Check if backups are turned on or off
run_backups=`cat ${VVV_CONFIG} | shyaml -q get-value general.db_backup.enable`
run_backups=$(cat ${VVV_CONFIG} | shyaml -q get-value general.db_backup.enable)
if [[ -z "$run_backups" ]]; then
run_backups=`cat ${VVV_CONFIG} | shyaml -q get-value general.db_backup`
run_backups=$(cat ${VVV_CONFIG} | shyaml -q get-value general.db_backup)
fi

if [[ $run_backups != "False" ]]; then
Expand Down
6 changes: 3 additions & 3 deletions config/homebin/vagrant_halt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This script is run whenever `vagrant halt` is used to power off
# the virtual machine. To customize this behavior, include a file
Expand All @@ -18,9 +18,9 @@ else
fi

# Check if backups are turned on or off
run_backups=`cat ${VVV_CONFIG} | shyaml -q get-value general.db_backup.enable`
run_backups=$(cat ${VVV_CONFIG} | shyaml -q get-value general.db_backup.enable)
if [[ -z "$run_backups" ]]; then
run_backups=`cat ${VVV_CONFIG} | shyaml -q get-value general.db_backup`
run_backups=$(cat ${VVV_CONFIG} | shyaml -q get-value general.db_backup)
fi

if [[ $run_backups != "False" ]]; then
Expand Down
34 changes: 22 additions & 12 deletions config/homebin/vagrant_provision
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This script is run after a provision. To customize this behavior,
# include a file in your local VVV/config/homebin
Expand All @@ -22,20 +22,30 @@ if [[ -f /srv/config/homebin/vagrant_provision_custom ]]; then
fi

vvv_info " * Restarting Nginx service"
sudo service nginx restart
if sudo service nginx status > /dev/null; then
sudo service nginx restart
else
sudo service nginx start
fi

vvv_info " * Restarting MariaDB service"
sudo service mariadb restart

if [ -x "$(command -v ntpdate)" ]; then
vvv_info " * Syncing clocks"
if sudo ntpdate -u ntp.ubuntu.com; then
vvv_info " * clocks synced"
else
vvv_warn " - clock synchronisation failed"
fi
if sudo service mariadb status > /dev/null; then
sudo service mariadb restart
else
vvv_info " - skipping ntpdate clock sync, not installed yet"
sudo service mariadb start
fi

if [ ! -f /.dockerenv ]; then
if [ -x "$(command -v ntpdate)" ]; then
vvv_info " * Syncing clocks"
if sudo ntpdate -u ntp.ubuntu.com; then
vvv_info " * clocks synced"
else
vvv_warn " - clock synchronisation failed"
fi
else
vvv_info " - skipping ntpdate clock sync, not installed yet"
fi
fi

RED="\033[38;5;9m"
Expand Down
8 changes: 4 additions & 4 deletions config/homebin/vagrant_suspend
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This script is run whenever `vagrant suspend` is used to suspend
# the virtual machine. To customize this behavior, include a file
Expand All @@ -18,13 +18,13 @@ else
fi

# Check if backups are turned on or off
run_backups=`cat ${VVV_CONFIG} | shyaml -q get-value general.db_backup.enable`
run_backups=$(cat ${VVV_CONFIG} | shyaml -q get-value general.db_backup.enable)
if [[ -z "$run_backups" ]]; then
run_backups=`cat ${VVV_CONFIG} | shyaml -q get-value general.db_backup`
run_backups=$(cat ${VVV_CONFIG} | shyaml -q get-value general.db_backup)
fi

if [[ $run_backups != "False" ]]; then
/srv/config/homebin/db_backup
/srv/config/homebin/db_backup
fi

RED="\033[38;5;9m"
Expand Down
Loading

0 comments on commit 0aa4880

Please sign in to comment.