From 49f881bb2b62a447f52ca33ebcc4733f9e295ef0 Mon Sep 17 00:00:00 2001 From: Patrick Messier Date: Tue, 5 Mar 2024 17:06:19 -0500 Subject: [PATCH 1/9] Add php@8.3 support --- cli/Valet/PackageManagers/Apt.php | 1 + cli/Valet/PackageManagers/Homebrew.php | 1 + 2 files changed, 2 insertions(+) diff --git a/cli/Valet/PackageManagers/Apt.php b/cli/Valet/PackageManagers/Apt.php index e1af768d1..5622e83e2 100644 --- a/cli/Valet/PackageManagers/Apt.php +++ b/cli/Valet/PackageManagers/Apt.php @@ -11,6 +11,7 @@ class Apt implements PackageManager const SUPPORTED_PHP_VERSIONS = [ 'php', + 'php83', 'php81', 'php80', 'php74', diff --git a/cli/Valet/PackageManagers/Homebrew.php b/cli/Valet/PackageManagers/Homebrew.php index d14ad2428..9080142b3 100644 --- a/cli/Valet/PackageManagers/Homebrew.php +++ b/cli/Valet/PackageManagers/Homebrew.php @@ -12,6 +12,7 @@ class Homebrew implements PackageManager const SUPPORTED_PHP_VERSIONS = [ 'php', + 'php@8.3', 'php@8.1', 'php@8.0', 'php@7.4', From 5f729a6f86c4fec063e98c642fe42dd70767529f Mon Sep 17 00:00:00 2001 From: Amdadul Haq Date: Fri, 13 Sep 2024 11:48:03 +0600 Subject: [PATCH 2/9] Vulnerability Security Fix --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1b2eaa8b5..9583da96b 100644 --- a/composer.json +++ b/composer.json @@ -49,7 +49,7 @@ "illuminate/container": "~5.3|^6.0|^7.0|^8.0|^9.0|^10.0", "mnapoli/silly": "~1.1", "symfony/process": "~2.7|~3.0|~4.0|~5.0|^6.0", - "nategood/httpful": "~0.2", + "nategood/httpful": "~1.0", "tightenco/collect": "~5.3|^6.0|^7.0|^8.0|^9.0", "ext-posix": "*", "ext-json": "*", From 636d69c02e3089686b21c43f952a5d1f632c9758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Marcher?= Date: Tue, 4 Feb 2025 10:35:07 +0100 Subject: [PATCH 3/9] Update valet.php --- cli/valet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/valet.php b/cli/valet.php index fb7cd6701..538339d34 100755 --- a/cli/valet.php +++ b/cli/valet.php @@ -18,7 +18,7 @@ */ Container::setInstance(new Container()); -$version = 'v2.3.10'; +$version = 'v2.3.11'; $app = new Application('Valet', $version); From 4bb4c7f647068460a414b76be30174e882306fe1 Mon Sep 17 00:00:00 2001 From: Xipetech Dev Date: Thu, 6 Feb 2025 12:51:58 +0530 Subject: [PATCH 4/9] fix proxy server issues, fix proxies list, fix links with ssl taging issue --- cli/Valet/Site.php | 34 +++++++++++++++---------------- cli/stubs/proxy.valet.conf | 6 ++---- cli/stubs/secure.proxy.valet.conf | 6 ++---- 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/cli/Valet/Site.php b/cli/Valet/Site.php index 6a8cdf624..44bffcb22 100644 --- a/cli/Valet/Site.php +++ b/cli/Valet/Site.php @@ -88,7 +88,6 @@ public function proxies() { $dir = $this->nginxPath(); $domain = $this->config->read()['domain']; - $links = $this->links(); $certs = $this->getCertificates(VALET_HOME_PATH . '/Certificates'); if (!$this->files->exists($dir)) { @@ -96,30 +95,28 @@ public function proxies() } $proxies = collect($this->files->scandir($dir)) - ->filter(function ($site, $key) use ($domain) { + ->filter(function ($site) use ($domain) { // keep sites that match our TLD return ends_with($site, '.' . $domain); - })->map(function ($site, $key) use ($domain) { + })->map(function ($site) use ($domain) { // remove the TLD suffix for consistency return str_replace('.' . $domain, '', $site); - })->reject(function ($site, $key) use ($links) { - return !$links->has($site); - })->mapWithKeys(function ($site) { + }) + // Removed rejection based on $links from here + ->mapWithKeys(function ($site) { $host = $this->getProxyHostForSite($site) ?: '(other)'; - return [$site => $host]; - })->reject(function ($host, $site) { - // If proxy host is null, it may be just a normal SSL stub, or something else; either way we exclude it from the list + })->reject(function ($host) { + // Exclude sites without a valid proxy_pass directive return $host === '(other)'; - })->map(function ($host, $site) use ($certs, $domain) { + })->map(function ($host, $site) use ($certs, $domain) { $secured = $certs->has($site); $url = ($secured ? 'https' : 'http') . '://' . $site . '.' . $domain; - return [ - 'site' => $site, + 'site' => $site, 'secured' => $secured ? ' X' : '', - 'url' => $url, - 'path' => $host, + 'url' => $url, + 'path' => $host, ]; }); @@ -309,11 +306,14 @@ public function getSiteConfigFileContents($site, $suffix = null) public function getCertificates($path = null) { $path = $path ?: $this->certificatesPath(); - + $domain = $this->config->read()['domain']; + return collect($this->files->scanDir($path))->filter(function ($value, $key) { return ends_with($value, '.crt'); - })->map(function ($cert) { - return substr($cert, 0, -9); + })->map(function ($cert) use ($domain) { + // Remove extension then remove trailing tld, e.g. ".example" + $name = pathinfo($cert, PATHINFO_FILENAME); + return preg_replace('/\.' . preg_quote($domain, '/') . '$/', '', $name); })->flip(); } diff --git a/cli/stubs/proxy.valet.conf b/cli/stubs/proxy.valet.conf index 4620d1544..909f53587 100644 --- a/cli/stubs/proxy.valet.conf +++ b/cli/stubs/proxy.valet.conf @@ -1,8 +1,7 @@ # valet stub: proxy.valet.conf server { - listen 127.0.0.1:80; - #listen VALET_LOOPBACK:80; # valet loopback + listen 80; server_name VALET_SITE www.VALET_SITE *.VALET_SITE; root /; charset utf-8; @@ -37,8 +36,7 @@ server { } server { - listen 127.0.0.1:60; - #listen VALET_LOOPBACK:60; # valet loopback + listen 60; server_name VALET_SITE www.VALET_SITE *.VALET_SITE; root /; charset utf-8; diff --git a/cli/stubs/secure.proxy.valet.conf b/cli/stubs/secure.proxy.valet.conf index ba663295d..746bc7583 100644 --- a/cli/stubs/secure.proxy.valet.conf +++ b/cli/stubs/secure.proxy.valet.conf @@ -1,15 +1,13 @@ # valet stub: secure.proxy.valet.conf server { - listen 127.0.0.1:80; - #listen VALET_LOOPBACK:80; # valet loopback + listen VALET_HTTP_PORT; server_name VALET_SITE www.VALET_SITE *.VALET_SITE; return 301 https://$host$request_uri; } server { - listen 127.0.0.1:443 ssl http2; - #listen VALET_LOOPBACK:443 ssl http2; # valet loopback + listen VALET_HTTPS_PORT ssl http2; server_name VALET_SITE www.VALET_SITE *.VALET_SITE; root /; charset utf-8; From e5f41f3e815e4fedd9fdb712f48402c17f50b7e3 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Thu, 6 Feb 2025 21:30:46 +0700 Subject: [PATCH 5/9] Add support Laravel 11 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 9583da96b..57b602a42 100644 --- a/composer.json +++ b/composer.json @@ -46,9 +46,9 @@ }, "require": { "php": ">=7.0", - "illuminate/container": "~5.3|^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/container": "~5.3|^6.0|^7.0|^8.0|^9.0|^10.0|^11.00", "mnapoli/silly": "~1.1", - "symfony/process": "~2.7|~3.0|~4.0|~5.0|^6.0", + "symfony/process": "~2.7|~3.0|~4.0|~5.0|^6.0|^7.0", "nategood/httpful": "~1.0", "tightenco/collect": "~5.3|^6.0|^7.0|^8.0|^9.0", "ext-posix": "*", From 42cf251d587ba8de2f74a4400e4f7692ae305daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ng=C3=B4=20Qu=E1=BB=91c=20=C4=90=E1=BA=A1t?= Date: Wed, 12 Feb 2025 10:49:28 +0700 Subject: [PATCH 6/9] Update illuminate/container dependency to include ^12.00 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 57b602a42..e99fb2b48 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ }, "require": { "php": ">=7.0", - "illuminate/container": "~5.3|^6.0|^7.0|^8.0|^9.0|^10.0|^11.00", + "illuminate/container": "~5.3|^6.0|^7.0|^8.0|^9.0|^10.0|^11.00|^12.00", "mnapoli/silly": "~1.1", "symfony/process": "~2.7|~3.0|~4.0|~5.0|^6.0|^7.0", "nategood/httpful": "~1.0", From 9ea8b257be37bcf3fa21b86108d6c0be116bc8e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Marcher?= Date: Wed, 2 Apr 2025 09:11:05 +0200 Subject: [PATCH 7/9] Update version --- cli/valet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/valet.php b/cli/valet.php index 538339d34..dc549e5b0 100755 --- a/cli/valet.php +++ b/cli/valet.php @@ -18,7 +18,7 @@ */ Container::setInstance(new Container()); -$version = 'v2.3.11'; +$version = 'v2.4.1'; $app = new Application('Valet', $version); From e97535fc89bba91223bb961999584d55889f28df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Marcher?= Date: Wed, 2 Apr 2025 09:13:58 +0200 Subject: [PATCH 8/9] Update valet.php --- cli/valet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/valet.php b/cli/valet.php index dc549e5b0..42559b5d8 100755 --- a/cli/valet.php +++ b/cli/valet.php @@ -18,7 +18,7 @@ */ Container::setInstance(new Container()); -$version = 'v2.4.1'; +$version = 'v2.4.2'; $app = new Application('Valet', $version); From 88c50a5246417acf2f94c596406aff93d90209e5 Mon Sep 17 00:00:00 2001 From: Aler1x <95098796+Aler1x@users.noreply.github.com> Date: Sun, 13 Apr 2025 00:15:15 +0000 Subject: [PATCH 9/9] feat: start, restart. stop and status commands for dnsmasq --- cli/Valet/DnsMasq.php | 40 ++++++++++++++++++++++++++++++++++++++++ cli/valet.php | 4 ++++ 2 files changed, 44 insertions(+) diff --git a/cli/Valet/DnsMasq.php b/cli/Valet/DnsMasq.php index 274477670..7c881de70 100644 --- a/cli/Valet/DnsMasq.php +++ b/cli/Valet/DnsMasq.php @@ -174,6 +174,46 @@ public function updateDomain($oldDomain, $newDomain) $this->sm->restart('dnsmasq'); } + /** + * Start the DnsMasq service. + * + * @return void + */ + public function start() + { + $this->sm->start('dnsmasq'); + } + + /** + * Restart the DnsMasq service. + * + * @return void + */ + public function restart() + { + $this->sm->restart('dnsmasq'); + } + + /** + * Stop the DnsMasq service. + * + * @return void + */ + public function stop() + { + $this->sm->stop('dnsmasq'); + } + + /** + * DnsMasq service status. + * + * @return void + */ + public function status() + { + $this->sm->printStatus('dnsmasq'); + } + /** * Delete the DnsMasq config file. * diff --git a/cli/valet.php b/cli/valet.php index 42559b5d8..78e90e32d 100755 --- a/cli/valet.php +++ b/cli/valet.php @@ -145,6 +145,7 @@ $app->command('status', function () { PhpFpm::status(); Nginx::status(); + DnsMasq::status(); })->descriptions('View Valet service status'); /** @@ -288,6 +289,7 @@ $app->command('start', function () { PhpFpm::restart(); Nginx::restart(); + DnsMasq::restart(); info('Valet services have been started.'); })->descriptions('Start the Valet services'); @@ -298,6 +300,7 @@ $app->command('restart', function () { PhpFpm::restart(); Nginx::restart(); + DnsMasq::restart(); info('Valet services have been restarted.'); })->descriptions('Restart the Valet services'); @@ -308,6 +311,7 @@ $app->command('stop', function () { PhpFpm::stop(); Nginx::stop(); + DnsMasq::stop(); info('Valet services have been stopped.'); })->descriptions('Stop the Valet services');