diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bb803de43..1b6798914 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,16 +14,16 @@ 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 }} 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') }} diff --git a/Homestead.yaml.example b/Homestead.yaml.example index 82d4b31bf..98e9d9dde 100644 --- a/Homestead.yaml.example +++ b/Homestead.yaml.example @@ -21,11 +21,11 @@ databases: - homestead features: - - mysql: true - mariadb: false - postgresql: false - ohmyzsh: false - webdriver: false + - influxdb: false services: - enabled: @@ -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/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/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/readme.md b/readme.md index b4e32c87c..375e82ec6 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 | 15.x | `main` | Development/Unstable | +| 22.04 | 14.x | 15.x | `release` | Stable | ## Developing Homestead diff --git a/resources/Homestead.yaml b/resources/Homestead.yaml index 82d4b31bf..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 @@ -40,7 +39,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/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/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/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/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 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/golang.sh b/scripts/features/golang.sh index 80d50bf3f..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.2" 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/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 d8d58d44a..d323d6e3a 100755 --- a/scripts/features/influxdb.sh +++ b/scripts/features/influxdb.sh @@ -16,9 +16,27 @@ 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.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 influxdb -apt-get install -y influxdb-client +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 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/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/mariadb.sh b/scripts/features/mariadb.sh index 7e401068e..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 @@ -33,13 +32,23 @@ 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" 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 @@ -57,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 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/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/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 new file mode 100644 index 000000000..0461029c6 --- /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/features/r-base.sh b/scripts/features/r-base.sh index 99329aba3..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)" @@ -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 diff --git a/scripts/homestead.rb b/scripts/homestead.rb index d58d7ec5a..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'] ||= '>= 13.0.0, < 14.0.0' + config.vm.box_version = settings['version'] ||= '>= 14.0.2, < 15.0.0' end config.vm.hostname = settings['hostname'] ||= 'homestead' @@ -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 @@ -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" @@ -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 @@ -599,8 +604,13 @@ 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') + 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' @@ -693,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 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