From 8346129de970cd851983bf7c2c8c9a185d4d6abe Mon Sep 17 00:00:00 2001 From: Nicholas C <55490546+LlamaDuckGoose@users.noreply.github.com> Date: Tue, 17 Oct 2023 02:55:19 +1100 Subject: [PATCH 01/23] fix: cpus key for libvirt (#1898) --- scripts/homestead.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/homestead.rb b/scripts/homestead.rb index d58d7ec5a..da3a73d2d 100644 --- a/scripts/homestead.rb +++ b/scripts/homestead.rb @@ -112,7 +112,7 @@ def self.configure(config, settings) config.vm.provider "libvirt" do |libvirt| libvirt.default_prefix = '' libvirt.memory = settings["memory"] ||= "2048" - libvirt.cpu_model = settings["cpus"] ||= "1" + libvirt.cpus = settings["cpus"] ||= "1" libvirt.nested = "true" libvirt.disk_bus = "virtio" libvirt.machine_type = "q35" From 236edc33de98abfefaaa92b164dee090b7c8c748 Mon Sep 17 00:00:00 2001 From: Nicholas C <55490546+LlamaDuckGoose@users.noreply.github.com> Date: Tue, 17 Oct 2023 02:56:19 +1100 Subject: [PATCH 02/23] feat: allow passing dev (#1897) --- scripts/homestead.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/homestead.rb b/scripts/homestead.rb index da3a73d2d..5b1b89810 100644 --- a/scripts/homestead.rb +++ b/scripts/homestead.rb @@ -33,7 +33,7 @@ def self.configure(config, settings) # Configure Additional Networks if settings.has_key?('networks') settings['networks'].each do |network| - config.vm.network network['type'], ip: network['ip'], mac: network['mac'], bridge: network['bridge'] ||= nil, netmask: network['netmask'] ||= '255.255.255.0' + config.vm.network network['type'], ip: network['ip'], mac: network['mac'], bridge: network['bridge'] ||= nil, dev: network['dev'] ||= nil, netmask: network['netmask'] ||= '255.255.255.0' end end From c59b8e41015b9f798fd2ba2c5767cc82f3849bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Despont?= Date: Wed, 25 Oct 2023 03:14:53 +0200 Subject: [PATCH 03/23] Permits specifying MariaDB version (#1889) By using the following description, the specified version of MariaDB will be installed. features: - mysql: false - mariadb: version: 10.6 --- scripts/features/mariadb.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/features/mariadb.sh b/scripts/features/mariadb.sh index 7e401068e..fa3b679eb 100755 --- a/scripts/features/mariadb.sh +++ b/scripts/features/mariadb.sh @@ -33,8 +33,19 @@ rm -rf /var/lib/mysql/* rm -rf /var/log/mysql rm -rf /etc/mysql +# Determine version from config + +set -- "$1" +IFS="."; + # Add Maria PPA -curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash +if [ -z "${version}" ]; then + curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash +else + curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash + sudo bash mariadb_repo_setup --mariadb-server-version="$version" + echo "MariaDB specific target version : $version" +fi debconf-set-selections <<< "mariadb-server mysql-server/data-dir select ''" debconf-set-selections <<< "mariadb-server mysql-server/root_password password secret" From d0b7849cc76e50768907b8a0fd2b9441524bc541 Mon Sep 17 00:00:00 2001 From: Nicholas C <55490546+LlamaDuckGoose@users.noreply.github.com> Date: Fri, 27 Oct 2023 07:11:49 +1100 Subject: [PATCH 04/23] Fix apache proxy header forwarder (#1903) * fix: header forwarding when using apache proxy * feat: match nginx proxy settings * feat: removed redundant setting --- scripts/site-types/apache-proxy.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/site-types/apache-proxy.sh b/scripts/site-types/apache-proxy.sh index 81fb0d97a..c4016c53e 100644 --- a/scripts/site-types/apache-proxy.sh +++ b/scripts/site-types/apache-proxy.sh @@ -59,6 +59,11 @@ block=" ServerName $1 ServerAlias www.$1 + ProxyPreserveHost On + RequestHeader set X-Real-IP %{REMOTE_ADDR}s + RequestHeader set Upgrade websocket + RequestHeader set Connection Upgrade + $paramsTXT $headersTXT @@ -77,7 +82,13 @@ blockssl=" ServerName $1 ServerAlias www.$1 + ProxyPreserveHost On + RequestHeader set X-Real-IP %{REMOTE_ADDR}s + RequestHeader set Upgrade websocket + RequestHeader set Connection Upgrade + $paramsTXT + $headersTXT SSLEngine on From 6c9656ae9b30c1026e0d30f963f53fef6161cd24 Mon Sep 17 00:00:00 2001 From: Nicholas C <55490546+LlamaDuckGoose@users.noreply.github.com> Date: Thu, 2 Nov 2023 03:43:10 +1100 Subject: [PATCH 05/23] Fix deprecation warning from MariaDB 11 (#1904) * feat: update to use mariadb instead of mysql * fix: mariadb upgrade --- scripts/create-mysql.sh | 24 ++++++++---------------- scripts/features/mariadb.sh | 30 ++++++++++++++---------------- 2 files changed, 22 insertions(+), 32 deletions(-) diff --git a/scripts/create-mysql.sh b/scripts/create-mysql.sh index 481d2f532..4bf5d402b 100755 --- a/scripts/create-mysql.sh +++ b/scripts/create-mysql.sh @@ -16,24 +16,16 @@ EOF chown vagrant /home/vagrant/.my.cnf +DB=$1 -DB=$1; - -mysql=$(ps ax | grep mysql | wc -l) mariadb=$(ps ax | grep mariadb | wc -l) +mysql=$(ps ax | grep mysql | wc -l) -if [ "$mysql" -gt 1 ] -then - mysql -e "CREATE DATABASE IF NOT EXISTS \`$DB\` DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci"; -else - # Skip Creating MySQL database - echo "We didn't find MySQL (\$mysql), skipping \$DB creation" -fi - -if [ "$mariadb" -gt 1 ] -then - mysql -e "CREATE DATABASE IF NOT EXISTS \`$DB\` DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci"; +if [ "$mariadb" -gt 1 ]; then + mariadb -e "CREATE DATABASE IF NOT EXISTS \`$DB\` DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci" +elif [ "$mysql" -gt 1 ]; then + mysql -e "CREATE DATABASE IF NOT EXISTS \`$DB\` DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci" else - # Skip Creating MariaDB database - echo "We didn't find MariaDB (\$mariadb), skipping \$DB creation" + # Skip Creating database + echo "We didn't find MariaDB (\$mariadb) or MySQL (\$mysql), skipping \`$DB\` creation" fi diff --git a/scripts/features/mariadb.sh b/scripts/features/mariadb.sh index fa3b679eb..989374ea7 100755 --- a/scripts/features/mariadb.sh +++ b/scripts/features/mariadb.sh @@ -10,8 +10,7 @@ fi export DEBIAN_FRONTEND=noninteractive -if [ -f /home/$WSL_USER_NAME/.homestead-features/mariadb ] -then +if [ -f /home/$WSL_USER_NAME/.homestead-features/mariadb ]; then echo "MariaDB already installed." exit 0 fi @@ -34,13 +33,12 @@ rm -rf /var/log/mysql rm -rf /etc/mysql # Determine version from config - set -- "$1" -IFS="."; +IFS="." # Add Maria PPA if [ -z "${version}" ]; then - curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash + curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash else curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash sudo bash mariadb_repo_setup --mariadb-server-version="$version" @@ -50,7 +48,7 @@ fi debconf-set-selections <<< "mariadb-server mysql-server/data-dir select ''" debconf-set-selections <<< "mariadb-server mysql-server/root_password password secret" debconf-set-selections <<< "mariadb-server mysql-server/root_password_again password secret" -mkdir /etc/mysql +mkdir /etc/mysql touch /etc/mysql/debian.cnf # Install MariaDB @@ -68,17 +66,17 @@ EOF export MYSQL_PWD=secret -mysql --user="root" --password="secret" -h localhost -e "GRANT ALL ON *.* TO root@'localhost' IDENTIFIED BY 'secret' WITH GRANT OPTION;" -mysql --user="root" --password="secret" -h localhost -e "GRANT ALL ON *.* TO root@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION;" -service mysql restart +mariadb --user="root" --password="secret" -h localhost -e "GRANT ALL ON *.* TO root@'localhost' IDENTIFIED BY 'secret' WITH GRANT OPTION;" +mariadb --user="root" --password="secret" -h localhost -e "GRANT ALL ON *.* TO root@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION;" +service mariadb restart -mysql --user="root" --password="secret" -h localhost -e "CREATE USER IF NOT EXISTS 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret';" -mysql --user="root" --password="secret" -h localhost -e "GRANT ALL ON *.* TO 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION;" -mysql --user="root" --password="secret" -h localhost -e "GRANT ALL ON *.* TO 'homestead'@'%' IDENTIFIED BY 'secret' WITH GRANT OPTION;" -mysql --user="root" --password="secret" -h localhost -e "FLUSH PRIVILEGES;" -service mysql restart +mariadb --user="root" --password="secret" -h localhost -e "CREATE USER IF NOT EXISTS 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret';" +mariadb --user="root" --password="secret" -h localhost -e "GRANT ALL ON *.* TO 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION;" +mariadb --user="root" --password="secret" -h localhost -e "GRANT ALL ON *.* TO 'homestead'@'%' IDENTIFIED BY 'secret' WITH GRANT OPTION;" +mariadb --user="root" --password="secret" -h localhost -e "FLUSH PRIVILEGES;" +service mariadb restart -mysql_upgrade --user="root" --verbose --force -service mysql restart +mariadb-upgrade --user="root" --verbose --force +service mariadb restart unset MYSQL_PWD From aecfdb1805425d603d7475371d42a6c3a6840551 Mon Sep 17 00:00:00 2001 From: Nicholas C <55490546+LlamaDuckGoose@users.noreply.github.com> Date: Thu, 2 Nov 2023 03:43:40 +1100 Subject: [PATCH 06/23] Add Rustc feature (#1905) * feat: rustc feature * feat: make already installed message consistent * fix: curl params * fix: feature name --- scripts/features/rustc.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 scripts/features/rustc.sh diff --git a/scripts/features/rustc.sh b/scripts/features/rustc.sh new file mode 100644 index 000000000..211c70f69 --- /dev/null +++ b/scripts/features/rustc.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +if [ -f ~/.homestead-features/wsl_user_name ]; then + WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)" + WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)" +else + WSL_USER_NAME=vagrant + WSL_USER_GROUP=vagrant +fi + +export DEBIAN_FRONTEND=noninteractive + +if [ -f /home/$WSL_USER_NAME/.homestead-features/rustc ]; then + echo "Rust already installed." + exit 0 +fi + +touch /home/$WSL_USER_NAME/.homestead-features/rustc +chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features + +# Run the Rust installation script as the user +sudo -u $WSL_USER_NAME curl -LsS https://sh.rustup.rs | sudo -u $WSL_USER_NAME sh -s -- -y From 0133bc47af76b1e3ea00c2544bb0ba485d3374a2 Mon Sep 17 00:00:00 2001 From: Nicholas C <55490546+LlamaDuckGoose@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:56:43 +1100 Subject: [PATCH 07/23] Fix RVM installer (#1906) * fix: keyservers * fix: source path --- scripts/features/rvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/features/rvm.sh b/scripts/features/rvm.sh index 4dec1b14b..7148757a6 100644 --- a/scripts/features/rvm.sh +++ b/scripts/features/rvm.sh @@ -20,8 +20,8 @@ touch /home/$WSL_USER_NAME/.homestead-features/rvm chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features # Install RVM -gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB +gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \curl -sSL https://get.rvm.io | bash -s stable --ruby --gems=bundler # To start using RVM we need to run -source /home/vagrant/.rvm/scripts/rvm +source /usr/local/rvm/scripts/rvm From e1b89c459e326a8f9e598e2d4357ae0183276f47 Mon Sep 17 00:00:00 2001 From: Ricardo Seriani Date: Wed, 8 Nov 2023 23:51:26 -0300 Subject: [PATCH 08/23] Update golang version to 1.21.4 (#1909) Signed-off-by: Ricardo Seriani --- scripts/features/golang.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/features/golang.sh b/scripts/features/golang.sh index 80d50bf3f..d09c13cf5 100755 --- a/scripts/features/golang.sh +++ b/scripts/features/golang.sh @@ -22,7 +22,7 @@ chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-feature ARCH=$(arch) # Install Golang -golangVersion="1.21.2" +golangVersion="1.21.4" if [[ "$ARCH" == "aarch64" ]]; then wget https://dl.google.com/go/go${golangVersion}.linux-arm64.tar.gz -O golang.tar.gz else From d9f831158be2799f7034c8c790a2cf039f359d1a Mon Sep 17 00:00:00 2001 From: Nicholas C <55490546+ALameLlama@users.noreply.github.com> Date: Sun, 19 Nov 2023 11:50:41 +1100 Subject: [PATCH 09/23] Fix RVM permissions issue and automatically fetch latest stable Golang version (#1911) * feat: get RVM to install as vagrant user to prevent prem issues * Update rvm.sh * feat latest stable go version --------- Co-authored-by: Nicholas C <55490546+LlamaDuckGoose@users.noreply.github.com> --- scripts/features/golang.sh | 8 ++++---- scripts/features/rvm.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/features/golang.sh b/scripts/features/golang.sh index d09c13cf5..bda962d2e 100755 --- a/scripts/features/golang.sh +++ b/scripts/features/golang.sh @@ -22,14 +22,14 @@ chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-feature ARCH=$(arch) # Install Golang -golangVersion="1.21.4" if [[ "$ARCH" == "aarch64" ]]; then - wget https://dl.google.com/go/go${golangVersion}.linux-arm64.tar.gz -O golang.tar.gz + GOLANG_LATEST_STABLE_VERSION=$(curl https://go.dev/dl/?mode=json | grep -o 'go.*.linux-arm64.tar.gz' | head -n 1 | tr -d '\r\n') + wget https://dl.google.com/go/${GOLANG_LATEST_STABLE_VERSION} -O golang.tar.gz else - wget https://dl.google.com/go/go${golangVersion}.linux-amd64.tar.gz -O golang.tar.gz + GOLANG_LATEST_STABLE_VERSION=$(curl https://go.dev/dl/?mode=json | grep -o 'go.*.linux-amd64.tar.gz' | head -n 1 | tr -d '\r\n') + wget https://dl.google.com/go/${GOLANG_LATEST_STABLE_VERSION} -O golang.tar.gz fi - tar -C /usr/local -xzf golang.tar.gz go printf "\nPATH=\"/usr/local/go/bin:\$PATH\"\n" | tee -a /home/vagrant/.profile rm -rf golang.tar.gz diff --git a/scripts/features/rvm.sh b/scripts/features/rvm.sh index 7148757a6..7d0342d5b 100644 --- a/scripts/features/rvm.sh +++ b/scripts/features/rvm.sh @@ -19,9 +19,9 @@ fi touch /home/$WSL_USER_NAME/.homestead-features/rvm chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features -# Install RVM -gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB -\curl -sSL https://get.rvm.io | bash -s stable --ruby --gems=bundler +# Install RVM as vagrant user +sudo -u $WSL_USER_NAME gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB +sudo -u $WSL_USER_NAME curl -LsS https://get.rvm.io | sudo -u $WSL_USER_NAME bash -s stable --ruby --gems=bundler --auto-dotfiles # To start using RVM we need to run -source /usr/local/rvm/scripts/rvm +source /home/vagrant/.rvm/scripts/rvm From 24c40b2580bc224c82e07985397851ae1223a477 Mon Sep 17 00:00:00 2001 From: PerikiyoXD Date: Sun, 19 Nov 2023 01:51:16 +0100 Subject: [PATCH 10/23] feat: Upgrade InfluxDB to v2.7.4 (#1915) --- Homestead.yaml.example | 1 + scripts/features/influxdb.sh | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Homestead.yaml.example b/Homestead.yaml.example index 82d4b31bf..ef3638def 100644 --- a/Homestead.yaml.example +++ b/Homestead.yaml.example @@ -26,6 +26,7 @@ features: - postgresql: false - ohmyzsh: false - webdriver: false + - influxdb: false services: - enabled: diff --git a/scripts/features/influxdb.sh b/scripts/features/influxdb.sh index d8d58d44a..d305ece00 100755 --- a/scripts/features/influxdb.sh +++ b/scripts/features/influxdb.sh @@ -16,9 +16,16 @@ then exit 0 fi -touch /home/$WSL_USER_NAME/.homestead-features/influxdb -chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features +# InfluxDB v2.7.4 - from https://www.influxdata.com/downloads/ + +# influxdata-archive_compat.key GPG fingerprint: +# 9D53 9D90 D332 8DC7 D6C8 D3B9 D8FF 8E1F 7DF8 B07E +wget -q https://repos.influxdata.com/influxdata-archive_compat.key +echo '393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c influxdata-archive_compat.key' | sha256sum -c && cat influxdata-archive_compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null +echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list apt-get update -apt-get install -y influxdb -apt-get install -y influxdb-client +apt-get install -y influxdb2 + +touch /home/$WSL_USER_NAME/.homestead-features/influxdb +chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features From 0e034c2239b5b2cb0694e40a5f80545e73e6ad6b Mon Sep 17 00:00:00 2001 From: Nicholas C <55490546+ALameLlama@users.noreply.github.com> Date: Thu, 23 Nov 2023 13:39:09 +1100 Subject: [PATCH 11/23] feat: dragonflydb installer (#1916) --- scripts/features/dragonflydb.sh | 59 +++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 scripts/features/dragonflydb.sh diff --git a/scripts/features/dragonflydb.sh b/scripts/features/dragonflydb.sh new file mode 100644 index 000000000..4427f4ac6 --- /dev/null +++ b/scripts/features/dragonflydb.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +if [ -f ~/.homestead-features/wsl_user_name ]; then + WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)" + WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)" +else + WSL_USER_NAME=vagrant + WSL_USER_GROUP=vagrant +fi + +export DEBIAN_FRONTEND=noninteractive + +if [ -f /home/$WSL_USER_NAME/.homestead-features/dragonflydb ]; then + echo "Dragonflydb already installed." + exit 0 +fi + +ARCH=$(arch) +DRAGONFLY_URL="https://dragonflydb.gateway.scarf.sh/latest/dragonfly-$ARCH.tar.gz" + +# Install Dragonfly +if ! curl -sSL "$DRAGONFLY_URL" -o dragonflydb.tar.gz; then + echo "Error downloading Dragonfly archive." + exit 1 +fi + +if ! tar -xzf dragonflydb.tar.gz "dragonfly-$ARCH"; then + echo "Error extracting Dragonfly archive." + exit 1 +fi + +mv "dragonfly-$ARCH" /usr/local/bin/dragonfly + +# Create systemd service file +cat > /etc/systemd/system/dragonfly.service << EOF +[Unit] +Description=DragonFly +After=network.target + +[Service] +User=vagrant +ExecStart=/usr/bin/env /usr/local/bin/dragonfly + +[Install] +WantedBy=multi-user.target +EOF + +# Disable and stop redis +systemctl disable --now redis-server + +# Enable and start dragonfly +systemctl enable --now dragonfly + +# Clean up +rm -rf dragonflydb.tar.gz + +# Mark installation as complete +touch /home/$WSL_USER_NAME/.homestead-features/dragonflydb +chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features \ No newline at end of file From 59d7ad828bf4cbf016b77dd13ca6c9f08f7ac8d0 Mon Sep 17 00:00:00 2001 From: Nicholas C <55490546+ALameLlama@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:08:46 +1100 Subject: [PATCH 12/23] fix: setup and db create for influx (#1920) --- scripts/create-influxdb.sh | 2 +- scripts/features/influxdb.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/create-influxdb.sh b/scripts/create-influxdb.sh index 65646116f..bfefe14a8 100755 --- a/scripts/create-influxdb.sh +++ b/scripts/create-influxdb.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -influx -execute "create database $1" +influx bucket create --token="homestead_secret" --name="$1" --org="homestead" diff --git a/scripts/features/influxdb.sh b/scripts/features/influxdb.sh index d305ece00..055b4f7ff 100755 --- a/scripts/features/influxdb.sh +++ b/scripts/features/influxdb.sh @@ -27,5 +27,16 @@ echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https apt-get update apt-get install -y influxdb2 +systemctl enable --now influxdb + +influx setup \ + --force \ + --username "homestead" \ + --password "secretkey" \ + --org "homestead" \ + --bucket "homestead" \ + --name "homestead" \ + --token "homestead_secret" + touch /home/$WSL_USER_NAME/.homestead-features/influxdb chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features From 41555c35328069e52738f0a1b9a16298130946a4 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Thu, 11 Jan 2024 21:16:46 -0600 Subject: [PATCH 13/23] Homestead v15 - Ubuntu 22.04 - PHP 8.3 (#1921) Ubuntu 22.04 PHP 8.3 Default Add Golang to base box Remove Drush Launcher Remove Drupal Launcher Replace MailHog with Mailpit --- Homestead.yaml.example | 2 +- Vagrantfile | 2 +- bin/homestead | 2 +- resources/Homestead.yaml | 2 +- resources/aliases | 20 ++++++------ resources/localized/aliases | 18 +++++------ scripts/features/mailpit.sh | 2 +- scripts/features/php8.3.sh | 63 +++++++++++++++++++++++++++++++++++++ scripts/homestead.rb | 11 +++++-- 9 files changed, 95 insertions(+), 27 deletions(-) create mode 100644 scripts/features/php8.3.sh diff --git a/Homestead.yaml.example b/Homestead.yaml.example index ef3638def..c1a757adc 100644 --- a/Homestead.yaml.example +++ b/Homestead.yaml.example @@ -41,7 +41,7 @@ services: # to: 4040 # - send: 54320 # PostgreSQL # to: 5432 -# - send: 8025 # Mailhog +# - send: 8025 # Mailpit # to: 8025 # - send: 9600 # to: 9600 diff --git a/Vagrantfile b/Vagrantfile index 2d94f5282..2832f8aa9 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -15,7 +15,7 @@ aliasesPath = confDir + "/aliases" require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb') -Vagrant.require_version '>= 2.2.4' +Vagrant.require_version '>= 2.4' Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| if File.exist? aliasesPath then diff --git a/bin/homestead b/bin/homestead index 8448c6c53..1640056a4 100755 --- a/bin/homestead +++ b/bin/homestead @@ -8,7 +8,7 @@ if(is_file( __DIR__.'/../vendor/autoload.php')) { require __DIR__.'/../../../autoload.php'; } -$app = new Symfony\Component\Console\Application('Laravel Homestead', '14.5.0'); +$app = new Symfony\Component\Console\Application('Laravel Homestead', '15.0.0'); $app->add(new Laravel\Homestead\MakeCommand); $app->add(new Laravel\Homestead\WslApplyFeatures); diff --git a/resources/Homestead.yaml b/resources/Homestead.yaml index 82d4b31bf..0e86acc18 100644 --- a/resources/Homestead.yaml +++ b/resources/Homestead.yaml @@ -40,7 +40,7 @@ services: # to: 4040 # - send: 54320 # PostgreSQL # to: 5432 -# - send: 8025 # Mailhog +# - send: 8025 # Mailpit # to: 8025 # - send: 9600 # to: 9600 diff --git a/resources/aliases b/resources/aliases index 702b1af0d..931cfe6bb 100644 --- a/resources/aliases +++ b/resources/aliases @@ -119,7 +119,7 @@ function serve-apache() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/apache.sh - sudo bash /vagrant/scripts/site-types/apache.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/apache.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -132,7 +132,7 @@ function serve-apache-proxy() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/apache-proxy.sh - sudo bash /vagrant/scripts/site-types/apache-proxy.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/apache-proxy.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -145,7 +145,7 @@ function serve-laravel() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/laravel.sh - sudo bash /vagrant/scripts/site-types/laravel.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/laravel.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -158,7 +158,7 @@ function serve-proxy() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/proxy.sh - sudo bash /vagrant/scripts/site-types/proxy.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/proxy.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -171,7 +171,7 @@ function serve-silverstripe() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/silverstripe.sh - sudo bash /vagrant/scripts/site-types/silverstripe.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/silverstripe.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -184,7 +184,7 @@ function serve-spa() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/spa.sh - sudo bash /vagrant/scripts/site-types/spa.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/spa.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -197,7 +197,7 @@ function serve-statamic() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/statamic.sh - sudo bash /vagrant/scripts/site-types/statamic.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/statamic.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -210,7 +210,7 @@ function serve-symfony2() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/symfony2.sh - sudo bash /vagrant/scripts/site-types/symfony2.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/symfony2.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -223,7 +223,7 @@ function serve-symfony4() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/symfony4.sh - sudo bash /vagrant/scripts/site-types/symfony4.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/symfony4.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -236,7 +236,7 @@ function serve-pimcore() { then sudo bash /vagrant/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/scripts/site-types/pimcore.sh - sudo bash /vagrant/scripts/site-types/pimcore.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/scripts/site-types/pimcore.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " diff --git a/resources/localized/aliases b/resources/localized/aliases index a6dc9d181..cae6cbd24 100644 --- a/resources/localized/aliases +++ b/resources/localized/aliases @@ -106,7 +106,7 @@ function serve-apache() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/apache.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/apache.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/apache.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -119,7 +119,7 @@ function serve-laravel() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/laravel.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/laravel.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/laravel.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -131,7 +131,7 @@ function serve-proxy() { if [[ "$1" && "$2" ]] then sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/proxy.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/proxy.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/proxy.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -144,7 +144,7 @@ function serve-silverstripe() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/silverstripe.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/silverstripe.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/silverstripe.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -157,7 +157,7 @@ function serve-spa() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/spa.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/spa.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/spa.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -170,7 +170,7 @@ function serve-statamic() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/statamic.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/statamic.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/statamic.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -183,7 +183,7 @@ function serve-symfony2() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/symfony2.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/symfony2.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/symfony2.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -196,7 +196,7 @@ function serve-symfony4() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/symfony4.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/symfony4.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/symfony4.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " @@ -209,7 +209,7 @@ function serve-pimcore() { then sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/site-types/pimcore.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/pimcore.sh "$1" "$2" 80 443 "${3:-8.1}" + sudo bash /vagrant/vendor/laravel/homestead/scripts/site-types/pimcore.sh "$1" "$2" 80 443 "${3:-8.3}" else echo "Error: missing required parameters." echo "Usage: " diff --git a/scripts/features/mailpit.sh b/scripts/features/mailpit.sh index fd6973243..e7709f6a3 100644 --- a/scripts/features/mailpit.sh +++ b/scripts/features/mailpit.sh @@ -36,6 +36,6 @@ ExecStart=/usr/bin/env /usr/local/bin/mailpit WantedBy=multi-user.target EOF -systemctl disable --now mailhog +systemctl disable --now mailpit systemctl enable --now mailpit diff --git a/scripts/features/php8.3.sh b/scripts/features/php8.3.sh new file mode 100644 index 000000000..f9267ecb5 --- /dev/null +++ b/scripts/features/php8.3.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +if [ -f ~/.homestead-features/wsl_user_name ]; then + WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)" + WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)" +else + WSL_USER_NAME=vagrant + WSL_USER_GROUP=vagrant +fi + +export DEBIAN_FRONTEND=noninteractive + +if [ -f /home/$WSL_USER_NAME/.homestead-features/php83 ] +then + echo "PHP 8.2 already installed." + exit 0 +fi + +touch /home/$WSL_USER_NAME/.homestead-features/php83 +chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features + +# PHP 8.3 +apt-get install -y --allow-change-held-packages \ +php8.3 php8.3-bcmath php8.3-bz2 php8.3-cgi php8.3-cli php8.3-common php8.3-curl php8.3-dba php8.3-dev \ +php8.3-enchant php8.3-fpm php8.3-gd php8.3-gmp php8.3-imap php8.3-interbase php8.3-intl php8.3-ldap \ +php8.3-mbstring php8.3-mysql php8.3-odbc php8.3-opcache php8.3-pgsql php8.3-phpdbg php8.3-pspell php8.3-readline \ +php8.3-snmp php8.3-soap php8.3-sqlite3 php8.3-sybase php8.3-tidy php8.3-xml php8.3-xsl \ +php8.3-zip +# php8.3-imagick php8.3-memcached php8.3-redis php8.3-xmlrpc php8.3-xdebug + +# Configure php.ini for CLI +sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.3/cli/php.ini +sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.3/cli/php.ini +sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.3/cli/php.ini +sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.3/cli/php.ini + +# Configure Xdebug +# echo "xdebug.mode = debug" >> /etc/php/8.3/mods-available/xdebug.ini +# echo "xdebug.discover_client_host = true" >> /etc/php/8.3/mods-available/xdebug.ini +# echo "xdebug.client_port = 9003" >> /etc/php/8.3/mods-available/xdebug.ini +# echo "xdebug.max_nesting_level = 512" >> /etc/php/8.3/mods-available/xdebug.ini +# echo "opcache.revalidate_freq = 0" >> /etc/php/8.3/mods-available/opcache.ini + +# Configure php.ini for FPM +sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.3/fpm/php.ini +sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.3/fpm/php.ini +sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.3/fpm/php.ini +sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.3/fpm/php.ini +sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.3/fpm/php.ini +sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.3/fpm/php.ini +sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.3/fpm/php.ini + +printf "[openssl]\n" | tee -a /etc/php/8.3/fpm/php.ini +printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.3/fpm/php.ini +printf "[curl]\n" | tee -a /etc/php/8.3/fpm/php.ini +printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.3/fpm/php.ini + +# Configure FPM +sed -i "s/user = www-data/user = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf +sed -i "s/group = www-data/group = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf +sed -i "s/listen\.owner.*/listen.owner = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf +sed -i "s/listen\.group.*/listen.group = vagrant/" /etc/php/8.3/fpm/pool.d/www.conf +sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.3/fpm/pool.d/www.conf diff --git a/scripts/homestead.rb b/scripts/homestead.rb index 5b1b89810..54cd50882 100644 --- a/scripts/homestead.rb +++ b/scripts/homestead.rb @@ -19,7 +19,7 @@ def self.configure(config, settings) config.vm.define settings['name'] ||= 'homestead' config.vm.box = settings['box'] ||= 'laravel/homestead' unless settings.has_key?('SpeakFriendAndEnter') - config.vm.box_version = settings['version'] ||= '>= 13.0.0, < 14.0.0' + config.vm.box_version = settings['version'] ||= '>= 14.0.0, < 15.0.0' end config.vm.hostname = settings['hostname'] ||= 'homestead' @@ -410,7 +410,7 @@ def self.configure(config, settings) site['to'], # $2 site['port'] ||= http_port, # $3 site['ssl'] ||= https_port, # $4 - site['php'] ||= '8.2', # $5 + site['php'] ||= '8.3', # $5 params ||= '', # $6 site['xhgui'] ||= '', # $7 site['exec'] ||= 'false', # $8 @@ -560,6 +560,11 @@ def self.configure(config, settings) s.args = [var['key'], var['value']] end + config.vm.provision 'shell' do |s| + s.inline = "echo \"\nenv[$1] = '$2'\" >> /etc/php/8.3/fpm/pool.d/www.conf" + s.args = [var['key'], var['value']] + end + config.vm.provision 'shell' do |s| s.inline = "echo \"\n# Set Homestead Environment Variable\nexport $1=$2\" >> /home/vagrant/.profile" s.args = [var['key'], var['value']] @@ -567,7 +572,7 @@ def self.configure(config, settings) end config.vm.provision 'shell' do |s| - s.inline = 'service php5.6-fpm restart;service php7.0-fpm restart;service php7.1-fpm restart; service php7.2-fpm restart; service php7.3-fpm restart; service php7.4-fpm restart; service php8.0-fpm restart; service php8.1-fpm restart; service php8.2-fpm restart;' + s.inline = 'service php5.6-fpm restart;service php7.0-fpm restart;service php7.1-fpm restart; service php7.2-fpm restart; service php7.3-fpm restart; service php7.4-fpm restart; service php8.0-fpm restart; service php8.1-fpm restart; service php8.2-fpm restart; service php8.3-fpm restart;' end end From 1c91f9ee25c1cf81995bba9445db940c43807b1a Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Fri, 19 Jan 2024 13:27:16 -0600 Subject: [PATCH 14/23] Update apt-key usages in features (#1932) --- scripts/features/blackfire.sh | 4 +-- scripts/features/cassandra.sh | 5 ++-- scripts/features/couchdb.sh | 6 ++-- scripts/features/crystal.sh | 5 ++-- scripts/features/elasticsearch.sh | 5 ++-- scripts/features/grafana.sh | 4 +-- scripts/features/influxdb.sh | 4 +-- scripts/features/logstash.sh | 5 ++-- scripts/features/mongodb.sh | 7 ++--- scripts/features/neo4j.sh | 5 ++-- scripts/features/openresty.sh | 5 ++-- scripts/features/r-base.sh | 6 ++-- scripts/features/rabbitmq.sh | 50 ++++++++++++------------------- scripts/features/timescaledb.sh | 11 ++++--- scripts/features/webdriver.sh | 13 ++++---- 15 files changed, 62 insertions(+), 73 deletions(-) diff --git a/scripts/features/blackfire.sh b/scripts/features/blackfire.sh index 789605276..f60f9139f 100755 --- a/scripts/features/blackfire.sh +++ b/scripts/features/blackfire.sh @@ -20,8 +20,8 @@ fi touch /home/$WSL_USER_NAME/.homestead-features/blackfire chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features -wget -q -O - https://packages.blackfire.io/gpg.key | apt-key add - -echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list +curl -fsSL https://packages.blackfire.io/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/blackfire.gpg +echo "deb [signed-by=/etc/apt/keyrings/blackfire.gpg] http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list # Install Blackfire sudo DEBIAN_FRONTEND=noninteractive apt-get update diff --git a/scripts/features/cassandra.sh b/scripts/features/cassandra.sh index f1fa1ec1d..9e5f83de2 100755 --- a/scripts/features/cassandra.sh +++ b/scripts/features/cassandra.sh @@ -20,8 +20,9 @@ touch /home/$WSL_USER_NAME/.homestead-features/cassandra chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features # Install Cassandra and driver dependencies -echo "deb http://www.apache.org/dist/cassandra/debian 311x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list -wget -q -O - https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add - +echo "deb https://debian.cassandra.apache.org 41x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list +curl https://downloads.apache.org/cassandra/KEYS | sudo apt-key add - + sudo DEBIAN_FRONTEND=noninteractive apt update sudo DEBIAN_FRONTEND=noninteractive apt install cassandra openjdk-8-jdk git libgmp-dev php7.1-dev php7.2-dev php7.3-dev php7.4-dev -y diff --git a/scripts/features/couchdb.sh b/scripts/features/couchdb.sh index 56a027a57..f6e92da1b 100755 --- a/scripts/features/couchdb.sh +++ b/scripts/features/couchdb.sh @@ -19,11 +19,9 @@ fi touch /home/$WSL_USER_NAME/.homestead-features/couchdb chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features -echo "deb https://apache.bintray.com/couchdb-deb focal main" \ - | sudo tee -a /etc/apt/sources.list.d/couchdb.list +curl -fsSL https://couchdb.apache.org/repo/keys.asc | sudo gpg --dearmor -o /etc/apt/keyrings/couchdb.gpg +echo "deb [signed-by=/etc/apt/keyrings/couchdb.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ jammy main" | sudo tee /etc/apt/sources.list.d/couchdb.list -sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys \ - 8756C4F765C9AC3CB6B85D62379CE192D401AB61 sudo apt-get update echo "couchdb couchdb/mode select standalone couchdb couchdb/mode seen true diff --git a/scripts/features/crystal.sh b/scripts/features/crystal.sh index 4ae55298d..ed5521c7a 100755 --- a/scripts/features/crystal.sh +++ b/scripts/features/crystal.sh @@ -20,8 +20,9 @@ touch /home/$WSL_USER_NAME/.homestead-features/crystal chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features # Install Crystal Programming Language Support -curl -sL "https://keybase.io/crystal/pgp_keys.asc" | sudo apt-key add - -echo "deb https://dist.crystal-lang.org/apt crystal main" | sudo tee /etc/apt/sources.list.d/crystal.list +curl -fsSL https://keybase.io/crystal/pgp_keys.asc | sudo gpg --dearmor -o /etc/apt/keyrings/crystal.gpg +echo "deb [signed-by=/etc/apt/keyrings/crystal.gpg] https://dist.crystal-lang.org/apt crystal main" | sudo tee /etc/apt/sources.list.d/crystal.list + apt-get update apt-get install -y crystal diff --git a/scripts/features/elasticsearch.sh b/scripts/features/elasticsearch.sh index 12838978e..973c9ad78 100755 --- a/scripts/features/elasticsearch.sh +++ b/scripts/features/elasticsearch.sh @@ -38,11 +38,10 @@ echo "Elasticsearch majorVersion: $majorVersion" # Install Java & Elasticsearch - -wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - +curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /etc/apt/keyrings/elasticsearch.gpg if [ ! -f /etc/apt/sources.list.d/elastic-$majorVersion.x.list ]; then - echo "deb https://artifacts.elastic.co/packages/$majorVersion.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-$majorVersion.x.list + echo "deb [signed-by=/etc/apt/keyrings/elasticsearch.gpg] https://artifacts.elastic.co/packages/$majorVersion.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-$majorVersion.x.list fi sudo apt-get update diff --git a/scripts/features/grafana.sh b/scripts/features/grafana.sh index 11ed9800c..5114bcbe1 100755 --- a/scripts/features/grafana.sh +++ b/scripts/features/grafana.sh @@ -19,8 +19,8 @@ fi touch /home/$WSL_USER_NAME/.homestead-features/grafana chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features -echo "deb https://packages.grafana.com/oss/deb stable main" > /etc/apt/sources.list.d/grafana.list -curl -s https://packages.grafana.com/gpg.key | apt-key add - +curl -fsSL https://packages.grafana.com/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/grafana.gpg +echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://packages.grafana.com/oss/deb stable main" | sudo tee /etc/apt/sources.list.d/grafana.list apt-get update -y apt-get install -y grafana diff --git a/scripts/features/influxdb.sh b/scripts/features/influxdb.sh index 055b4f7ff..d323d6e3a 100755 --- a/scripts/features/influxdb.sh +++ b/scripts/features/influxdb.sh @@ -17,13 +17,13 @@ then fi -# InfluxDB v2.7.4 - from https://www.influxdata.com/downloads/ - +# InfluxDB v2.7.5 - from https://www.influxdata.com/downloads/ # influxdata-archive_compat.key GPG fingerprint: # 9D53 9D90 D332 8DC7 D6C8 D3B9 D8FF 8E1F 7DF8 B07E wget -q https://repos.influxdata.com/influxdata-archive_compat.key echo '393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c influxdata-archive_compat.key' | sha256sum -c && cat influxdata-archive_compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list + apt-get update apt-get install -y influxdb2 diff --git a/scripts/features/logstash.sh b/scripts/features/logstash.sh index 4c6df6b84..3f94e6169 100644 --- a/scripts/features/logstash.sh +++ b/scripts/features/logstash.sh @@ -38,11 +38,10 @@ echo "Logstash majorVersion: $majorVersion" # Install Java & Logstash - -wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - +curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /etc/apt/keyrings/elasticsearch.gpg if [ ! -f /etc/apt/sources.list.d/elastic-$majorVersion.x.list ]; then - echo "deb https://artifacts.elastic.co/packages/$majorVersion.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-$majorVersion.x.list + echo "deb [signed-by=/etc/apt/keyrings/elasticsearch.gpg] https://artifacts.elastic.co/packages/$majorVersion.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-$majorVersion.x.list fi sudo apt-get update diff --git a/scripts/features/mongodb.sh b/scripts/features/mongodb.sh index ebcfcfab6..397c9fae2 100755 --- a/scripts/features/mongodb.sh +++ b/scripts/features/mongodb.sh @@ -21,14 +21,13 @@ ARCH=$(arch) touch /home/$WSL_USER_NAME/.homestead-features/mongodb chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features +curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | sudo gpg --dearmor -o /etc/apt/keyrings/mongodb.gpg if [[ "$ARCH" == "aarch64" ]]; then - echo "deb [ arch=arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list + echo "deb [signed-by=/etc/apt/keyrings/mongodb.gpg arch=arm64] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list else - echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list + echo "deb [signed-by=/etc/apt/keyrings/mongodb.gpg arch=amd64] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list fi -wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add - - sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confnew" install mongodb-org autoconf g++ make openssl libssl-dev libcurl4-openssl-dev pkg-config libsasl2-dev php-dev diff --git a/scripts/features/neo4j.sh b/scripts/features/neo4j.sh index 7584853a3..156879b46 100755 --- a/scripts/features/neo4j.sh +++ b/scripts/features/neo4j.sh @@ -19,8 +19,9 @@ fi touch /home/$WSL_USER_NAME/.homestead-features/neo4j chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features -wget -O - https://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add - -echo 'deb https://debian.neo4j.org/repo stable/' | sudo tee -a /etc/apt/sources.list.d/neo4j.list +wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add - +echo 'deb https://debian.neo4j.com stable latest' | sudo tee /etc/apt/sources.list.d/neo4j.list + apt-get update # Install Neo4j Community Edition diff --git a/scripts/features/openresty.sh b/scripts/features/openresty.sh index 4b13e4b8c..b41e748f6 100755 --- a/scripts/features/openresty.sh +++ b/scripts/features/openresty.sh @@ -20,10 +20,9 @@ touch /home/$WSL_USER_NAME/.homestead-features/openresty chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features # Install Openresty +curl -fsSL https://openresty.org/package/pubkey.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/openresty.gpg +echo "deb [signed-by=/etc/apt/keyrings/openresty.gpg] http://openresty.org/package/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/openresty.list -wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add - -sudo apt-get install -y software-properties-common -sudo add-apt-repository -y "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" sudo apt-get update sudo service nginx stop sudo apt-get install -y openresty diff --git a/scripts/features/r-base.sh b/scripts/features/r-base.sh index 99329aba3..b263aaa03 100644 --- a/scripts/features/r-base.sh +++ b/scripts/features/r-base.sh @@ -19,6 +19,8 @@ fi touch /home/$WSL_USER_NAME/.homestead-features/r-base chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features -apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 -add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/' +wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo gpg --dearmor -o /etc/apt/keyrings/r-project.gpg +echo "deb [signed-by=/etc/apt/keyrings/r-project.gpg] https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/" | sudo tee /etc/apt/sources.list.d/r-project.list + +apt-get update apt install -y r-base diff --git a/scripts/features/rabbitmq.sh b/scripts/features/rabbitmq.sh index f5708bf2e..5d6100da7 100755 --- a/scripts/features/rabbitmq.sh +++ b/scripts/features/rabbitmq.sh @@ -19,53 +19,41 @@ fi touch /home/$WSL_USER_NAME/.homestead-features/rabbitmq chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features - sudo apt-get install curl gnupg debian-keyring debian-archive-keyring apt-transport-https -y -## Team RabbitMQ's main signing key -sudo apt-key adv --keyserver "hkps://keys.openpgp.org" --recv-keys "0x0A9AF2115F4687BD29803A206B73A36E6026DFCA" -## Launchpad PPA that provides modern Erlang releases -sudo apt-key adv --keyserver "keyserver.ubuntu.com" --recv-keys "F77F1EDA57EBB1CC" -## PackageCloud RabbitMQ repository -sudo apt-key adv --keyserver "keyserver.ubuntu.com" --recv-keys "F6609E60DC62814E" +# Import signing keys +curl -1sLf "https://keys.openpgp.org/vks/v1/by-fingerprint/0A9AF2115F4687BD29803A206B73A36E6026DFCA" | sudo gpg --dearmor -o /etc/apt/keyrings/com.rabbitmq.team.gpg +curl -1sLf "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xf77f1eda57ebb1cc" | sudo gpg --dearmor -o /etc/apt/keyrings/net.launchpad.ppa.rabbitmq.erlang.gpg +curl -1sLf "https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey" | sudo gpg --dearmor -o /etc/apt/keyrings/io.packagecloud.rabbitmq.gpg ## Add apt repositories maintained by Team RabbitMQ -sudo tee /etc/apt/sources.list.d/rabbitmq.list < /etc/apt/sources.list.d/timescaledb.list" -wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - -sudo apt-get update +curl -fsSL https://packagecloud.io/timescale/timescaledb/gpgkey | sudo gpg --dearmor -o /etc/apt/keyrings/timescaledb.gpg +echo 'deb [signed-by=/etc/apt/keyrings/timescaledb.gpg] https://packagecloud.io/timescale/timescaledb/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/timescaledb.list -sudo apt-get -y install timescaledb-2-postgresql-13 +sudo apt-get update +sudo apt-get -y install timescaledb-2-postgresql-15 sudo timescaledb-tune --quiet --yes -printf "\ntimescaledb.telemetry_level=off\n" | sudo tee -a /etc/postgresql/13/main/postgresql.conf +printf "\ntimescaledb.telemetry_level=off\n" | sudo tee -a /etc/postgresql/15/main/postgresql.conf sudo service postgresql restart diff --git a/scripts/features/webdriver.sh b/scripts/features/webdriver.sh index b38684841..d2f2c0460 100755 --- a/scripts/features/webdriver.sh +++ b/scripts/features/webdriver.sh @@ -19,11 +19,14 @@ fi touch /home/$WSL_USER_NAME/.homestead-features/webdriverutils chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features -# Install The Chrome Web Driver & Dusk Utilities -wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - -echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee -a /etc/apt/sources.list.d/google-chrome.list +ARCH=$(arch) -apt-get update +# Install The Chrome Web Driver & Dusk Utilities +if [[ "$ARCH" != "aarch64" ]]; then + wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/chrome.deb + dpkg -i /tmp/chrome.deb + rm -f /tmp/chrome.deb +fi apt-get -y install libxpm4 libxrender1 libgtk2.0-0 libnss3 libgconf-2-4 chromium-browser xvfb gtk2-engines-pixbuf \ -xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable imagemagick x11-apps google-chrome-stable +xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable imagemagick x11-apps From bc80360a2c87e107ef1d75f26c6a63f44dcd5207 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 19 Jan 2024 13:30:26 -0600 Subject: [PATCH 15/23] set "mysql" as an enabled database (#1925) MySQL is kind of a weird case, because it's our default database, and it cannot (shouldn't?) run side by side with MariaDB. We kind of cheated this previously by having "mysql" as a key in the "features" configuration, but it's technically not a "feature" as it doesn't have a file in `/scripts/features/`. this resulted in an "Invalid feature: mysql" warning in the provision script. This change will allow us to remove `mysql: true` from our docs and example files, while still having MySQL work correctly. --- scripts/homestead.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/homestead.rb b/scripts/homestead.rb index 54cd50882..372a46d76 100644 --- a/scripts/homestead.rb +++ b/scripts/homestead.rb @@ -604,6 +604,11 @@ def self.configure(config, settings) end end + # Enable MySQL if MariaDB is not enabled + if (!enabled_databases.include? 'mysql') && (!enabled_databases.include? 'mariadb') + enabled_databases.push 'mysql' + end + settings['databases'].each do |db| if (enabled_databases.include? 'mysql') || (enabled_databases.include? 'mysql8') || (enabled_databases.include? 'mariadb') config.vm.provision 'shell' do |s| @@ -698,6 +703,11 @@ def self.configure(config, settings) end end + # Enable MySQL if MariaDB is not enabled + if (!enabled_databases.include? 'mysql') && (!enabled_databases.include? 'mariadb') + enabled_databases.push 'mysql' + end + # Loop over each DB settings['databases'].each do |database| # Backup MySQL/MariaDB From 4fe53dfe3fa0e9b295567da2ec2193b0691e1f6b Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 19 Jan 2024 13:30:53 -0600 Subject: [PATCH 16/23] drop "mysql8" reference (#1926) this is a remnant of long ago in our v5 to v8 transition. we now *only* install MySQL8, so we don't really need this anymore. if people still have it in their `homestead.yaml` it'll still be fine with my other PR. this also syncs it up with the duplicated code we have farther down. --- scripts/homestead.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/homestead.rb b/scripts/homestead.rb index 372a46d76..914f595de 100644 --- a/scripts/homestead.rb +++ b/scripts/homestead.rb @@ -610,7 +610,7 @@ def self.configure(config, settings) end settings['databases'].each do |db| - if (enabled_databases.include? 'mysql') || (enabled_databases.include? 'mysql8') || (enabled_databases.include? 'mariadb') + if (enabled_databases.include? 'mysql') || (enabled_databases.include? 'mariadb') config.vm.provision 'shell' do |s| s.name = 'Creating MySQL / MariaDB Database: ' + db s.path = script_dir + '/create-mysql.sh' From cb79c2950a9d325ab7160c3ecc3f26cf01d25775 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 19 Jan 2024 13:31:16 -0600 Subject: [PATCH 17/23] test on PHP 8.3 (#1927) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bb803de43..cf3b154bd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: true matrix: - php: [8.0, 8.1, 8.2] + php: [8.0, 8.1, 8.2, 8.3] name: PHP_${{ matrix.php }} From cf1889cfc2b7bdcdbaad44ca27875f4b7e7ca21a Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 19 Jan 2024 13:32:36 -0600 Subject: [PATCH 18/23] update GitHub workflows to use latest versions (#1928) --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cf3b154bd..1b6798914 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,10 +20,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.composer/cache/files key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} From afbd69b03558beea8105371bba1474779c5d8eee Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 19 Jan 2024 13:32:54 -0600 Subject: [PATCH 19/23] drop "mysql" feature (#1929) "mysql" is not a valid feature, as it is our default database, and does not get installed with a `/scripts/feature/` file. if this gets merged, the docs will be updated as well. --- Homestead.yaml.example | 1 - resources/Homestead.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/Homestead.yaml.example b/Homestead.yaml.example index c1a757adc..98e9d9dde 100644 --- a/Homestead.yaml.example +++ b/Homestead.yaml.example @@ -21,7 +21,6 @@ databases: - homestead features: - - mysql: true - mariadb: false - postgresql: false - ohmyzsh: false diff --git a/resources/Homestead.yaml b/resources/Homestead.yaml index 0e86acc18..407ee8ec3 100644 --- a/resources/Homestead.yaml +++ b/resources/Homestead.yaml @@ -21,7 +21,6 @@ databases: - homestead features: - - mysql: true - mariadb: false - postgresql: false - ohmyzsh: false From 19a7697e9d13b285424a00b8d53c353be74e1dc2 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 19 Jan 2024 13:35:26 -0600 Subject: [PATCH 20/23] minor formatting (#1931) - use consistent shebang - remove extra space before shebang - consistently use 4 spaces for indentation --- scripts/features/meilisearch.sh | 2 +- scripts/features/php8.1.sh | 12 ++++++------ scripts/features/php8.2.sh | 12 ++++++------ scripts/features/php8.3.sh | 12 ++++++------ scripts/features/r-base.sh | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/scripts/features/meilisearch.sh b/scripts/features/meilisearch.sh index 8c0132d4c..4966b988c 100644 --- a/scripts/features/meilisearch.sh +++ b/scripts/features/meilisearch.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ -f ~/.homestead-features/wsl_user_name ]; then WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)" diff --git a/scripts/features/php8.1.sh b/scripts/features/php8.1.sh index db84dda96..4bc038c31 100644 --- a/scripts/features/php8.1.sh +++ b/scripts/features/php8.1.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash if [ -f ~/.homestead-features/wsl_user_name ]; then - WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)" - WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)" + WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)" + WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)" else - WSL_USER_NAME=vagrant - WSL_USER_GROUP=vagrant + WSL_USER_NAME=vagrant + WSL_USER_GROUP=vagrant fi export DEBIAN_FRONTEND=noninteractive @@ -20,8 +20,8 @@ fi if [ -f /home/$WSL_USER_NAME/.homestead-features/php81 ] then - echo "PHP 8.1 already installed." - exit 0 + echo "PHP 8.1 already installed." + exit 0 fi touch /home/$WSL_USER_NAME/.homestead-features/php81 diff --git a/scripts/features/php8.2.sh b/scripts/features/php8.2.sh index 651422c55..cff621735 100644 --- a/scripts/features/php8.2.sh +++ b/scripts/features/php8.2.sh @@ -1,19 +1,19 @@ #!/usr/bin/env bash if [ -f ~/.homestead-features/wsl_user_name ]; then - WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)" - WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)" + WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)" + WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)" else - WSL_USER_NAME=vagrant - WSL_USER_GROUP=vagrant + WSL_USER_NAME=vagrant + WSL_USER_GROUP=vagrant fi export DEBIAN_FRONTEND=noninteractive if [ -f /home/$WSL_USER_NAME/.homestead-features/php82 ] then - echo "PHP 8.2 already installed." - exit 0 + echo "PHP 8.2 already installed." + exit 0 fi touch /home/$WSL_USER_NAME/.homestead-features/php82 diff --git a/scripts/features/php8.3.sh b/scripts/features/php8.3.sh index f9267ecb5..0461029c6 100644 --- a/scripts/features/php8.3.sh +++ b/scripts/features/php8.3.sh @@ -1,19 +1,19 @@ #!/usr/bin/env bash if [ -f ~/.homestead-features/wsl_user_name ]; then - WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)" - WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)" + WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)" + WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)" else - WSL_USER_NAME=vagrant - WSL_USER_GROUP=vagrant + WSL_USER_NAME=vagrant + WSL_USER_GROUP=vagrant fi export DEBIAN_FRONTEND=noninteractive if [ -f /home/$WSL_USER_NAME/.homestead-features/php83 ] then - echo "PHP 8.2 already installed." - exit 0 + echo "PHP 8.2 already installed." + exit 0 fi touch /home/$WSL_USER_NAME/.homestead-features/php83 diff --git a/scripts/features/r-base.sh b/scripts/features/r-base.sh index b263aaa03..8e6febf2b 100644 --- a/scripts/features/r-base.sh +++ b/scripts/features/r-base.sh @@ -1,4 +1,4 @@ - #!/usr/bin/env bash +#!/usr/bin/env bash if [ -f ~/.homestead-features/wsl_user_name ]; then WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)" From b02182c00ad1e6987727d5179200182c04f43d51 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Fri, 19 Jan 2024 14:13:04 -0600 Subject: [PATCH 21/23] Update wsl-init to 22.04 php8.3 Require base v14.0.2 --- bin/wsl-init | 128 ++++++++++++++++++++++--------------------- scripts/homestead.rb | 2 +- 2 files changed, 68 insertions(+), 62 deletions(-) diff --git a/bin/wsl-init b/bin/wsl-init index 03ecccf78..329101c71 100644 --- a/bin/wsl-init +++ b/bin/wsl-init @@ -21,65 +21,72 @@ apt-get upgrade -y echo "LC_ALL=en_US.UTF-8" >> /etc/default/locale locale-gen en_US.UTF-8 -apt-get install -y software-properties-common curl +apt-get install -y software-properties-common curl gnupg debian-keyring debian-archive-keyring apt-transport-https \ +ca-certificates # Install Some PPAs apt-add-repository ppa:ondrej/php -y -apt-add-repository ppa:chris-lea/redis-server -y + +# Prepare keyrings directory +sudo mkdir -p /etc/apt/keyrings + # NodeJS -curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - -# PostgreSQL -tee /etc/apt/sources.list.d/pgdg.list < /etc/apt/sources.list.d/pgdg.list' ## Update Package Lists -apt-get update +apt-get update -y # Install Some Basic Packages -apt-get install -y build-essential dos2unix gcc git git-lfs libmcrypt4 libpcre3-dev libpng-dev unzip make \ -python3-pip re2c supervisor unattended-upgrades whois vim libnotify-bin pv mcrypt bash-completion zsh imagemagick - -## Set My Timezone -#ln -sf /usr/share/zoneinfo/UTC /etc/localtime +apt-get install -y build-essential dos2unix gcc git git-lfs libmcrypt4 libpcre3-dev libpng-dev chrony unzip make pv \ +python3-pip re2c supervisor unattended-upgrades whois vim cifs-utils bash-completion zsh graphviz avahi-daemon tshark # Install Generic PHP packages apt-get install -y --allow-change-held-packages \ php-imagick php-memcached php-redis php-xdebug php-dev php-swoole -# PHP 8.2 +# PHP 8.3 apt-get install -y --allow-change-held-packages \ -php8.2 php8.2-bcmath php8.2-bz2 php8.2-cgi php8.2-cli php8.2-common php8.2-curl php8.2-dba php8.2-dev \ -php8.2-enchant php8.2-fpm php8.2-gd php8.2-gmp php8.2-imap php8.2-interbase php8.2-intl php8.2-ldap \ -php8.2-mbstring php8.2-mysql php8.2-odbc php8.2-opcache php8.2-pgsql php8.2-phpdbg php8.2-pspell php8.2-readline \ -php8.2-snmp php8.2-soap php8.2-sqlite3 php8.2-sybase php8.2-tidy php8.2-xml php8.2-xsl \ -php8.2-zip +php8.3 php8.3-bcmath php8.3-bz2 php8.3-cgi php8.3-cli php8.3-common php8.3-curl php8.3-dba php8.3-dev \ +php8.3-enchant php8.3-fpm php8.3-gd php8.3-gmp php8.3-imap php8.3-interbase php8.3-intl php8.3-ldap \ +php8.3-mbstring php8.3-mysql php8.3-odbc php8.3-opcache php8.3-pgsql php8.3-phpdbg php8.3-pspell php8.3-readline \ +php8.3-snmp php8.3-soap php8.3-sqlite3 php8.3-sybase php8.3-tidy php8.3-xml php8.3-xsl \ +php8.3-zip php8.3-imagick php8.3-memcached php8.3-redis php8.3-xmlrpc php8.3-xdebug + +# Configure php.ini for CLI +sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.3/cli/php.ini +sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.3/cli/php.ini +sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.3/cli/php.ini +sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.3/cli/php.ini + +# Configure Xdebug +echo "xdebug.mode = debug" >> /etc/php/8.3/mods-available/xdebug.ini +echo "xdebug.discover_client_host = true" >> /etc/php/8.3/mods-available/xdebug.ini +echo "xdebug.client_port = 9003" >> /etc/php/8.3/mods-available/xdebug.ini +echo "xdebug.max_nesting_level = 512" >> /etc/php/8.3/mods-available/xdebug.ini +echo "opcache.revalidate_freq = 0" >> /etc/php/8.3/mods-available/opcache.ini # Fixed php fpm bind listening socket - no such file issue. mkdir -p /run/php -touch /run/php/php8.2-fpm.sock - -# Install Composer -curl -sS https://getcomposer.org/installer | php -mv composer.phar /usr/local/bin/composer -chown -R $WSL_USER_NAME:$WSL_USER_NAME /home/$WSL_USER_NAME/.config - -## Install Global Packages -sudo su $WSL_USER_NAME <<'EOF' -/usr/local/bin/composer global require "laravel/envoy=^2.0" -/usr/local/bin/composer global require "laravel/installer=^4.2" -/usr/local/bin/composer global config --no-plugins allow-plugins.slince/composer-registry-manager true -/usr/local/bin/composer global require "slince/composer-registry-manager=^2.0" +touch /run/php/php8.3-fpm.sock + + # Install Composer + curl -sS https://getcomposer.org/installer | php + mv composer.phar /usr/local/bin/composer + chown -R vagrant:vagrant /home/vagrant/.config + + # Install Global Packages + sudo su vagrant <<'EOF' + /usr/local/bin/composer global require "laravel/envoy=^2.0" + /usr/local/bin/composer global require "laravel/installer=^5.0" + /usr/local/bin/composer global config --no-plugins allow-plugins.slince/composer-registry-manager true + /usr/local/bin/composer global require "slince/composer-registry-manager=^2.0" EOF -# Configure php.ini for CLI -sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.2/cli/php.ini -sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.2/cli/php.ini -sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.2/cli/php.ini -sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.2/cli/php.ini - # Install Nginx apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages nginx @@ -92,37 +99,36 @@ chown -R $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME touch /home/$WSL_USER_NAME/.config/nginx/nginx.conf ln -sf /home/$WSL_USER_NAME/.config/nginx/nginx.conf /etc/nginx/conf.d/nginx.conf -# Setup Some PHP-FPM Options -sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.2/fpm/php.ini -sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.2/fpm/php.ini -sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.2/fpm/php.ini -sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.2/fpm/php.ini -sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.2/fpm/php.ini -sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.2/fpm/php.ini -sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.2/fpm/php.ini - -printf "[openssl]\n" | tee -a /etc/php/8.2/fpm/php.ini -printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.2/fpm/php.ini +# Configure php.ini for FPM +sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/8.3/fpm/php.ini +sed -i "s/display_errors = .*/display_errors = On/" /etc/php/8.3/fpm/php.ini +sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/8.3/fpm/php.ini +sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.3/fpm/php.ini +sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.3/fpm/php.ini +sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.3/fpm/php.ini +sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/8.3/fpm/php.ini -printf "[curl]\n" | tee -a /etc/php/8.2/fpm/php.ini -printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.2/fpm/php.ini - -# Disable XDebug On The CLI -sudo phpdismod -s cli xdebug +printf "[openssl]\n" | tee -a /etc/php/8.3/fpm/php.ini +printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.3/fpm/php.ini +printf "[curl]\n" | tee -a /etc/php/8.3/fpm/php.ini +printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/8.3/fpm/php.ini # Set The Nginx & PHP-FPM User sed -i "s/user www-data;/user $WSL_USER_NAME;/" /etc/nginx/nginx.conf sed -i "s/# server_names_hash_bucket_size.*/server_names_hash_bucket_size 64;/" /etc/nginx/nginx.conf -sed -i "s/user = www-data/user = $WSL_USER_NAME/" /etc/php/8.2/fpm/pool.d/www.conf -sed -i "s/group = www-data/group = $WSL_USER_NAME/" /etc/php/8.2/fpm/pool.d/www.conf +sed -i "s/user = www-data/user = $WSL_USER_NAME/" /etc/php/8.3/fpm/pool.d/www.conf +sed -i "s/group = www-data/group = $WSL_USER_NAME/" /etc/php/8.3/fpm/pool.d/www.conf + +sed -i "s/listen\.owner.*/listen.owner = $WSL_USER_NAME/" /etc/php/8.3/fpm/pool.d/www.conf +sed -i "s/listen\.group.*/listen.group = $WSL_USER_NAME/" /etc/php/8.3/fpm/pool.d/www.conf +sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.3/fpm/pool.d/www.conf -sed -i "s/listen\.owner.*/listen.owner = $WSL_USER_NAME/" /etc/php/8.2/fpm/pool.d/www.conf -sed -i "s/listen\.group.*/listen.group = $WSL_USER_NAME/" /etc/php/8.2/fpm/pool.d/www.conf -sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/8.2/fpm/pool.d/www.conf +# Disable XDebug On The CLI +sudo phpdismod -s cli xdebug service nginx restart -service php8.0-fpm restart +service php8.3-fpm restart # Add $WSL_USER_NAME User To WWW-Data usermod -a -G www-data $WSL_USER_NAME diff --git a/scripts/homestead.rb b/scripts/homestead.rb index 914f595de..780d1063d 100644 --- a/scripts/homestead.rb +++ b/scripts/homestead.rb @@ -19,7 +19,7 @@ def self.configure(config, settings) config.vm.define settings['name'] ||= 'homestead' config.vm.box = settings['box'] ||= 'laravel/homestead' unless settings.has_key?('SpeakFriendAndEnter') - config.vm.box_version = settings['version'] ||= '>= 14.0.0, < 15.0.0' + config.vm.box_version = settings['version'] ||= '>= 14.0.2, < 15.0.0' end config.vm.hostname = settings['hostname'] ||= 'homestead' From 0ef2f7b8bc2628ceb4393c8e0aab0e457e1d4f30 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 19 Jan 2024 14:21:46 -0600 Subject: [PATCH 22/23] Update readme.md (#1924) - add an `alt` attribute to our logo for accessibility - grammar fix for "and" to "or" - remove the PHP version, which makes it more generic so we don't have to update it all the time - add closing pipes on the markdown table for better compatibility - update the information in the version table to match our recent changes --- readme.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index b4e32c87c..b3fc711b0 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -

+

Laravel Homestead Logo

@@ -17,9 +17,9 @@ ## Introduction -Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes! +Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, or any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes! -Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web server, PHP 8.2, MySQL, Postgres, Redis, Memcached, Node, and all of the other goodies you need to develop amazing Laravel applications. +Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web server, PHP, MySQL, Postgres, Redis, Memcached, Node, and all of the other goodies you need to develop amazing Laravel applications. Official documentation [is located here](https://laravel.com/docs/homestead). @@ -30,10 +30,10 @@ Homestead is made up of 2 different projects. The first is this repo which is th > When you run `vagrant up` for the first time Vagrant will download the large base box from Vagrant cloud. The base box is the output from Settler. The base box will be stored at `~/.vagrant.d/` and copied to the folder you ran vagrant up command from in a hidden folder named `.vagrant`. This is what allows vagrant to create a VM and destroy it quickly and without having to download the large base box again. ##### Current versions -| Ubuntu LTS | Settler Version | Homestead Version | Branch | Status -| -----------|-----------------|-------------------| ----------- | ----------- -| 20.04 | 13.x | 14.x | `main` | Development/Unstable -| 20.04 | 13.x | 14.x | `release` | Stable +| Ubuntu LTS | Settler Version | Homestead Version | Branch | Status | +|------------|-----------------|-------------------|-----------|----------------------| +| 22.04 | 14.x | 14.x | `main` | Development/Unstable | +| 20.04 | 13.x | 14.x | `release` | Stable | ## Developing Homestead From 5efa8bdde9ab8a4920d3fc75a28599d6799326e8 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Fri, 19 Jan 2024 14:22:33 -0600 Subject: [PATCH 23/23] update readme --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index b3fc711b0..375e82ec6 100644 --- a/readme.md +++ b/readme.md @@ -32,8 +32,8 @@ Homestead is made up of 2 different projects. The first is this repo which is th ##### Current versions | Ubuntu LTS | Settler Version | Homestead Version | Branch | Status | |------------|-----------------|-------------------|-----------|----------------------| -| 22.04 | 14.x | 14.x | `main` | Development/Unstable | -| 20.04 | 13.x | 14.x | `release` | Stable | +| 22.04 | 14.x | 15.x | `main` | Development/Unstable | +| 22.04 | 14.x | 15.x | `release` | Stable | ## Developing Homestead