Skip to content

Commit

Permalink
Update to v15 (#9)
Browse files Browse the repository at this point in the history
* wip

* wip

* wip

* wip
  • Loading branch information
litan1106 authored Jan 19, 2024
1 parent fca6f70 commit b2d5b7d
Show file tree
Hide file tree
Showing 38 changed files with 390 additions and 221 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down
4 changes: 2 additions & 2 deletions Homestead.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ databases:
- homestead

features:
- mysql: true
- mariadb: false
- postgresql: false
- ohmyzsh: false
- webdriver: false
- influxdb: false

services:
- enabled:
Expand All @@ -40,7 +40,7 @@ services:
# to: 4040
# - send: 54320 # PostgreSQL
# to: 5432
# - send: 8025 # Mailhog
# - send: 8025 # Mailpit
# to: 8025
# - send: 9600
# to: 9600
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bin/homestead
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
91 changes: 43 additions & 48 deletions bin/wsl-init
Original file line number Diff line number Diff line change
Expand Up @@ -23,48 +23,61 @@ 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

# Prepare keyrings directory
sudo mkdir -p /etc/apt/keyrings

# NodeJS
apt-get update
apt-get install -y ca-certificates curl gnupg
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
apt-get update
apt-get install nodejs -y
# PostgreSQL
tee /etc/apt/sources.list.d/pgdg.list <<END
deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main
END
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
# PostgreSQL
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /etc/apt/keyrings/postgresql.gpg
sudo sh -c 'echo "deb [signed-by=/etc/apt/keyrings/postgresql.gpg] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /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

# PHP
apt-get install -y --allow-change-held-packages \
php$PHP_VERSION php$PHP_VERSION-bcmath php$PHP_VERSION-bz2 php$PHP_VERSION-cgi php$PHP_VERSION-cli php$PHP_VERSION-common php$PHP_VERSION-curl php$PHP_VERSION-dba php$PHP_VERSION-dev \
php$PHP_VERSION-enchant php$PHP_VERSION-fpm php$PHP_VERSION-gd php$PHP_VERSION-gmp php$PHP_VERSION-imap php$PHP_VERSION-interbase php$PHP_VERSION-intl php$PHP_VERSION-ldap \
php$PHP_VERSION-mbstring php$PHP_VERSION-mysql php$PHP_VERSION-odbc php$PHP_VERSION-opcache php$PHP_VERSION-pgsql php$PHP_VERSION-phpdbg php$PHP_VERSION-pspell php$PHP_VERSION-readline \
php$PHP_VERSION-snmp php$PHP_VERSION-soap php$PHP_VERSION-sqlite3 php$PHP_VERSION-sybase php$PHP_VERSION-tidy php$PHP_VERSION-xml php$PHP_VERSION-xsl \
php$PHP_VERSION-zip php$PHP_VERSION-imagick php$PHP_VERSION-memcached php$PHP_VERSION-redis php$PHP_VERSION-xdebug php$PHP_VERSION-dev php$PHP_VERSION-swoole
php$PHP_VERSION-zip php$PHP_VERSION-imagick php$PHP_VERSION-memcached php$PHP_VERSION-redis php$PHP_VERSION-xmlrpc php$PHP_VERSION-xdebug php$PHP_VERSION-swoole

# Configure php.ini for CLI
sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/$PHP_VERSION/cli/php.ini
sed -i "s/display_errors = .*/display_errors = On/" /etc/php/$PHP_VERSION/cli/php.ini
sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/$PHP_VERSION/cli/php.ini
sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/$PHP_VERSION/cli/php.ini

# Configure Xdebug
echo "xdebug.mode = off" >> /etc/php/$PHP_VERSION/mods-available/xdebug.ini
echo "xdebug.discover_client_host = true" >> /etc/php/$PHP_VERSION/mods-available/xdebug.ini
echo "xdebug.client_port = 9003" >> /etc/php/$PHP_VERSION/mods-available/xdebug.ini
echo "xdebug.max_nesting_level = 512" >> /etc/php/$PHP_VERSION/mods-available/xdebug.ini
echo "opcache.revalidate_freq = 0" >> /etc/php/$PHP_VERSION/mods-available/opcache.ini

# Setup opcache
echo "opcache.enable = 1" >> /etc/php/$PHP_VERSION/mods-available/opcache.ini
echo "opcache.enable_cli = 1" >> /etc/php/$PHP_VERSION/mods-available/opcache.ini
echo "opcache.revalidate_freq = 0" >> /etc/php/$PHP_VERSION/mods-available/opcache.ini

# Fixed php fpm bind listening socket - no such file issue.
mkdir -p /run/php
touch /run/php/php$PHP_VERSION-fpm.sock

# Set php$PHP_VERSION as default
# Set PHP version as default
update-alternatives --set php /usr/bin/php$PHP_VERSION
update-alternatives --set php-config /usr/bin/php-config$PHP_VERSION
update-alternatives --set phpize /usr/bin/phpize$PHP_VERSION
Expand All @@ -74,20 +87,14 @@ 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
# 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"
/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/$PHP_VERSION/cli/php.ini
sed -i "s/display_errors = .*/display_errors = On/" /etc/php/$PHP_VERSION/cli/php.ini
sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/$PHP_VERSION/cli/php.ini
sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/$PHP_VERSION/cli/php.ini

# Install Nginx
apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages nginx

Expand All @@ -100,7 +107,7 @@ 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
# Configure php.ini for FPM
sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/$PHP_VERSION/fpm/php.ini
sed -i "s/display_errors = .*/display_errors = On/" /etc/php/$PHP_VERSION/fpm/php.ini
sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/$PHP_VERSION/fpm/php.ini
Expand All @@ -111,24 +118,9 @@ sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/$PHP_VERSION/fpm/php.i

printf "[openssl]\n" | tee -a /etc/php/$PHP_VERSION/fpm/php.ini
printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/$PHP_VERSION/fpm/php.ini

printf "[curl]\n" | tee -a /etc/php/$PHP_VERSION/fpm/php.ini
printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/$PHP_VERSION/fpm/php.ini

# Setup xdebug
echo "xdebug.mode = off" >> /etc/php/$PHP_VERSION/mods-available/xdebug.ini
echo "xdebug.discover_client_host = true" >> /etc/php/$PHP_VERSION/mods-available/xdebug.ini
echo "xdebug.client_port = 9003" >> /etc/php/$PHP_VERSION/mods-available/xdebug.ini
echo "xdebug.max_nesting_level = 512" >> /etc/php/$PHP_VERSION/mods-available/xdebug.ini

# Setup opcache
echo "opcache.enable = 1" >> /etc/php/$PHP_VERSION/mods-available/opcache.ini
echo "opcache.enable_cli = 1" >> /etc/php/$PHP_VERSION/mods-available/opcache.ini
echo "opcache.revalidate_freq = 0" >> /etc/php/$PHP_VERSION/mods-available/opcache.ini

# Disable XDebug On The CLI
sudo phpdismod -s cli xdebug

# 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
Expand All @@ -140,6 +132,9 @@ sed -i "s/listen\.owner.*/listen.owner = $WSL_USER_NAME/" /etc/php/$PHP_VERSION/
sed -i "s/listen\.group.*/listen.group = $WSL_USER_NAME/" /etc/php/$PHP_VERSION/fpm/pool.d/www.conf
sed -i "s/;listen\.mode.*/listen.mode = 0666/" /etc/php/$PHP_VERSION/fpm/pool.d/www.conf

# Disable XDebug On The CLI
sudo phpdismod -s cli xdebug

service nginx restart
service php$PHP_VERSION-fpm restart

Expand Down
14 changes: 7 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p align="center"><img src="/art/logo.svg"></p>
<p align="center"><img src="/art/logo.svg" alt="Laravel Homestead Logo"></p>

<p align="center">
<a href="https://github.com/laravel/homestead/actions">
Expand All @@ -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).

Expand All @@ -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

Expand Down
3 changes: 1 addition & 2 deletions resources/Homestead.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ databases:
- homestead

features:
- mysql: true
- mariadb: false
- postgresql: false
- ohmyzsh: false
Expand All @@ -40,7 +39,7 @@ services:
# to: 4040
# - send: 54320 # PostgreSQL
# to: 5432
# - send: 8025 # Mailhog
# - send: 8025 # Mailpit
# to: 8025
# - send: 9600
# to: 9600
Expand Down
20 changes: 10 additions & 10 deletions resources/aliases
Original file line number Diff line number Diff line change
Expand Up @@ -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: "
Expand All @@ -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: "
Expand All @@ -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: "
Expand All @@ -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: "
Expand All @@ -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: "
Expand All @@ -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: "
Expand All @@ -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: "
Expand All @@ -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: "
Expand All @@ -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: "
Expand All @@ -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: "
Expand Down
Loading

0 comments on commit b2d5b7d

Please sign in to comment.