Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
svpernova09 committed Oct 6, 2023
2 parents 119e68c + 78d44a2 commit d4c5463
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 5 deletions.
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.4.2');
$app = new Symfony\Component\Console\Application('Laravel Homestead', '14.5.0');

$app->add(new Laravel\Homestead\MakeCommand);
$app->add(new Laravel\Homestead\WslApplyFeatures);
Expand Down
35 changes: 34 additions & 1 deletion resources/aliases
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ alias nrwp="npm run watch-poll"
alias nrh="npm run hot"
alias nrp="npm run production"

alias yrd="yarn dev"
alias yrw="yarn watch"
alias yrwp="yarn watch-poll"
alias yrh="yarn hot"
alias yrp="yarn production"

function artisan() {
php artisan "$@"
}
Expand Down Expand Up @@ -121,6 +127,19 @@ function serve-apache() {
fi
}

function serve-apache-proxy() {
if [[ "$1" && "$2" ]]
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}"
else
echo "Error: missing required parameters."
echo "Usage: "
echo " serve-apache-proxy domain port"
fi
}

function serve-laravel() {
if [[ "$1" && "$2" ]]
then
Expand All @@ -137,6 +156,7 @@ function serve-laravel() {
function serve-proxy() {
if [[ "$1" && "$2" ]]
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}"
else
Expand Down Expand Up @@ -227,7 +247,7 @@ function serve-pimcore() {
function share() {
if [[ "$1" ]]
then
ngrok http ${@:2} $1:80
ngrok http ${@:2} $1:80 --host-header=rewrite
else
echo "Error: missing required parameters."
echo "Usage: "
Expand All @@ -237,6 +257,19 @@ function share() {
fi
}

function sshare() {
if [[ "$1" ]]
then
ngrok http ${@:2} $1:443 --host-header=rewrite
else
echo "Error: missing required parameters."
echo "Usage: "
echo " sshare domain"
echo "Invocation with extra params passed directly to ngrok"
echo " sshare domain --subdomain=test1234"
fi
}

function flip() {
sudo bash /vagrant/scripts/flip-webserver.sh
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/features/golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-feature
ARCH=$(arch)

# Install Golang
golangVersion="1.20.7"
golangVersion="1.21.2"
if [[ "$ARCH" == "aarch64" ]]; then
wget https://dl.google.com/go/go${golangVersion}.linux-arm64.tar.gz -O golang.tar.gz
else
Expand Down
3 changes: 1 addition & 2 deletions scripts/features/mongodb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ ARCH=$(arch)
touch /home/$WSL_USER_NAME/.homestead-features/mongodb
chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features


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
else
Expand All @@ -41,7 +40,7 @@ sudo systemctl enable mongod
sudo systemctl start mongod

sudo rm -rf /tmp/mongo-php-driver /usr/src/mongo-php-driver
git clone -c advice.detachedHead=false -q -b '1.15.0' --single-branch https://github.com/mongodb/mongo-php-driver.git /tmp/mongo-php-driver
git clone -c advice.detachedHead=false -q -b '1.16.2' --single-branch https://github.com/mongodb/mongo-php-driver.git /tmp/mongo-php-driver
sudo mv /tmp/mongo-php-driver /usr/src/mongo-php-driver
cd /usr/src/mongo-php-driver
git submodule -q update --init
Expand Down
104 changes: 104 additions & 0 deletions scripts/site-types/apache-proxy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/usr/bin/env bash

declare -A params=$6 # Create an associative array
declare -A headers=${9} # Create an associative array
paramsTXT=""
if [ -n "$6" ]; then
for element in "${!params[@]}"
do
paramsTXT="${paramsTXT}
SetEnv ${element} \"${params[$element]}\""
done
fi
headersTXT=""
if [ -n "${9}" ]; then
for element in "${!headers[@]}"
do
headersTXT="${headersTXT}
Header always set ${element} \"${headers[$element]}\""
done
fi

if [ -n "$2" ]
then
if ! [[ "$2" =~ ^[0-9]+$ ]]
then
proxyPass="
ProxyPass / ${2}/
ProxyPassReverse / ${2}/
"
else proxyPass="
ProxyPass / http://127.0.0.1:$2/
ProxyPassReverse / http://127.0.0.1:$2/
"
fi
else proxyPass="
ProxyPass / http://127.0.0.1/
ProxyPassReverse / http://127.0.0.1/
"
fi

export DEBIAN_FRONTEND=noninteractive

sudo service nginx stop
sudo systemctl disable nginx
sudo systemctl enable apache2

sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_ajp
sudo a2enmod rewrite
sudo a2enmod deflate
sudo a2enmod headers
sudo a2enmod proxy_balancer
sudo a2enmod proxy_connect
sudo a2enmod proxy_html

block="<VirtualHost *:$3>
ServerAdmin webmaster@localhost
ServerName $1
ServerAlias www.$1
$paramsTXT
$headersTXT
$proxyPass
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
"

echo "$block" > "/etc/apache2/sites-available/$1.conf"
ln -fs "/etc/apache2/sites-available/$1.conf" "/etc/apache2/sites-enabled/$1.conf"

blockssl="<IfModule mod_ssl.c>
<VirtualHost *:$4>
ServerAdmin webmaster@localhost
ServerName $1
ServerAlias www.$1
$paramsTXT
SSLEngine on
SSLCertificateFile /etc/ssl/certs/$1.crt
SSLCertificateKeyFile /etc/ssl/certs/$1.key
$proxyPass
</VirtualHost>
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
"

echo "$blockssl" > "/etc/apache2/sites-available/$1-ssl.conf"
ln -fs "/etc/apache2/sites-available/$1-ssl.conf" "/etc/apache2/sites-enabled/$1-ssl.conf"

ps auxw | grep apache2 | grep -v grep > /dev/null

service apache2 restart

if [ $? == 0 ]
then
service apache2 reload
fi

0 comments on commit d4c5463

Please sign in to comment.