1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 08:30:07 +01:00
Commit Graph

264 Commits

Author SHA1 Message Date
Antonio Carlos Ribeiro
a13832c95b Fix precedence bug 2021-08-29 13:50:25 +02:00
Antonio Ribeiro
df1a95c386 Add support for parked domains to some commands 2021-08-27 17:09:01 +02:00
Chris Brown
5d8a94fa54 Fix comment typo 2021-08-15 17:10:17 -04:00
Chris Brown
c549c1786a Stop non-root homebrew services during restarts
This is intended to assist with avoiding having competing non-root instances of valet dependency services running due to userland use of brew CLI commands.

Now, when running `valet stop` or `valet restart` it will (silently) attempt to stop the non-root instance (ignoring any errors thrown), before stopping (and/or starting) the sudo/root instance which is normally used.

(Though obvious, I'll point out that this only applies to services Valet manages.)

Fixes #1057
2021-06-13 01:33:22 -04:00
Mikaël Popowicz
01f4b582e6 ♻️ Refactoring proxy command. Proxy is not secured by default. 2021-04-30 14:31:55 +02:00
Mikaël Popowicz
7fdcdd3544 🚚 Use insecure instead of unsecure. 2021-04-26 18:00:33 +02:00
Mikaël Popowicz
3098f5ff0a Merge branch 'master' into feature/unsecure-proxy
# Conflicts:
#	cli/Valet/Site.php
#	cli/stubs/proxy.valet.conf
2021-04-23 22:01:16 +02:00
Mikaël Popowicz
3ecf64d339 💡 Updating addLoopbackAlias phpDoc. 2021-02-24 09:25:40 +01:00
Mikaël Popowicz
9045f3a53e 🔥 Removing useless code. 2021-02-24 09:25:03 +01:00
Mikaël Popowicz
727baa6c09 🐛 Ensure loopback alias and launch daemon file exist after re-installation. 2021-02-24 00:45:46 +01:00
Mikaël Popowicz
5f46ac4e23 Adding uninstallLoopback. 2021-02-24 00:27:13 +01:00
Mikaël Popowicz
2f6dc53e2d 💬 Updating aliasLoopback phpDoc. 2021-02-24 00:04:05 +01:00
Mikaël Popowicz
a0eeceb13c ♻️ Refactoring resecureForNewConfiguration conditions. 2021-02-24 00:02:29 +01:00
Mikaël Popowicz
a44743e117 Adding diagnose commands. 2021-02-23 23:48:19 +01:00
Mikaël Popowicz
a876175c6a ♻️ Refactoring resecureForNew* methods to resecureForNewConfiguration. 2021-02-23 22:32:50 +01:00
Mikaël Popowicz
0c0ab726c0 🐛 Fixing Nginx configuration.
 Adding alias generation and launch daemon generation.
2021-02-22 18:43:39 +01:00
Mikaël Popowicz
2d5ee9d7cc Add loopback command. 2021-02-21 23:21:12 +01:00
Chris Brown
dd17bb9e9a Force removal of orphaned valet.sock file
When switching PHP versions the valet.sock file may not be removed if the linked PHP process doesn't get shut down properly. This can happen when Homebrew switches default `php` version aliases and if one has started multiple homebrew PHP instances under different permission levels or different users.

This patch merely forces the .sock file's removal when switching versions. 

In very rare cases a filesystem lock may prevent the file's proper removal, in which case a reboot might be required.

To prevent these issues, keep Homebrew up-to-date by running `brew upgrade` on a regular basis (weekly is good).
2021-01-21 11:33:47 -05:00
Chris Brown
383c1d009f Fix valet bin dir linking for ARM / M1 macs
Fixes #1023

Ref #992
2021-01-18 12:19:56 -05:00
Mikaël Popowicz
34b1cece72 Merging master. 2020-11-30 09:45:11 +01:00
Matt Stauffer
04d42b3895 Merge pull request #1008 from drbyte/valet-use-improvements
Improvements to "valet use" command
2020-11-29 22:49:25 -05:00
Matt Stauffer
3564170a50 Merge pull request #1006 from drbyte/php8-as-default
Specify 8.0 as latest PHP version
2020-11-29 22:44:47 -05:00
Chris Brown
98e7a02a3c Add shivammathur/php tap for supporting unofficial PHP releases 2020-11-28 23:49:03 -05:00
Chris Brown
78bfd8b9c2 Include resolv conf in diagnose command
Including the linked resolv.conf helps with troubleshooting situations where dns appears to not be working.
(Mostly the goal is to determine whether a conflicting entry is listed too early, or if the localhost is not listed first when others are present.)
2020-11-28 23:41:10 -05:00
Chris Brown
a03e2e09ce Improvements to "valet use" command
- properly detects if the requested version is already installed, and skips re-installing/re-starting/re-configuring
- allows --force to re-configure anyway
- smarter treatment of 'php' when it's aliased to another specific installed version
2020-11-28 23:38:30 -05:00
Chris Brown
be63541dd8 Normalize PHP version parsing 2020-11-28 23:17:21 -05:00
Chris Brown
9da8e96d87 Specify 8.0 as latest PHP version
Specify 8.0 as latest PHP version
This is used mainly for new installs
2020-11-28 23:12:29 -05:00
Mikaël Popowicz
2ba9f6c977 Updating put phpdoc. 2020-11-28 23:34:26 +01:00
Mikaël Popowicz
ea777a9e94 Adding ability to create unsecure proxy. 2020-11-28 23:22:07 +01:00
Matt Stauffer
518a009ff7 Merge pull request #996 from drbyte/fpm-errorlog-to-user-dir
Point PHP-FPM error_log to user directory
2020-11-27 11:34:01 -05:00
soilSpoon
cbb59c2251 Update brew list command to remove deprecation warning 2020-11-27 22:21:27 +09:00
Chris Brown
ce0999f8cd Point PHP-FPM error_log to user directory
Old: `/usr/local/var/log/php-fpm.log`
New: `~/.config/valet/Log/php-fpm.log`

(We already put `~/.config/valet/Log/nginx-error.log` there)

This avoids ARM Mac differences in directory paths.
2020-11-23 09:21:55 -05:00
soilSpoon
2c06a5d4f0 Modify the paths of packages to be based on brew prefix
- brew
- dnsmasq
- nginx
- php-fpm
- log
- etc
2020-11-15 14:38:18 +09:00
soilSpoon
6a4cb74392 Modify php binary path to be based on brew prefix 2020-11-14 21:42:13 +09:00
Chris Brown
2c03a07a71 Fix proxy config rewrite done during a tld change
(it wasn't rewriting all variants of the old tld, thus leaving them (and nginx) broken).
2020-11-05 19:05:53 -05:00
Chris Brown
d9a05cc27e Fix file_get_contents() error in tld command
When we added the `proxy` feature in https://github.com/laravel/valet/pull/913 we inadvertently broke the `tld` command.
It was concatenating old+new tld when searching for existing configs, thus it couldn't find the correct file, which triggered the reported error.

Fixes #984

This PR fixes the lookup by allowing the correct intended lookup tld to be passed in. It also checks that the file exists before trying to read it.
2020-11-05 19:04:55 -05:00
Miguel Piedrafita
778a877fdf Support php@8.0 and php@8.1 2020-10-28 15:16:18 +00:00
Chris Brown
8d9dcd0360 Protect against un-parking Valet's core Sites folder
Fixes #956
2020-06-02 17:09:13 -04:00
Matt Stauffer
570a7d9059 Merge pull request #942 from aryehraber/feat/diagnose-update
Filter Launch* commands output in "diagnose" command
2020-05-01 12:14:27 -04:00
Matt Stauffer
73b16c08b0 Merge pull request #913 from drbyte/valet-proxy
Add proxy site-handling commands
2020-04-30 11:44:44 -04:00
Aryeh Raber
3be38193b5 Filter Launch* commands using "| grep homebrew" 2020-04-29 11:12:04 +02:00
Beau Simensen
1cd3d23804 Update cli/Valet/Site.php
Co-Authored-By: Matt Stauffer <mattstauffer@users.noreply.github.com>
2020-04-28 16:35:19 -05:00
Beau Simensen
9f607ba998 Test the new Proxies features
Updated the `proxies` method to return the URL + .tld
as the rendered output wasn't exactly what one would
expect. While not critical, it was not consistent.

Refactored some of the Site class to aid in testing using
a fake instead of relying on a ton of mocking.

The Site fake has support for both using `tests/output`
as well as named fixtures (`tests/fixtures/Proxies`).

Testing for certificate I/O is pretty whack, but this is
the best I could come up with that would still ensure
the certificate stuff was getting called without
actually requiring `sudo` to run phpunit.

Replaced instances referring directly to `VALET_HOME_PATH`
with calls to the new `valetHomePath()`. This method
is taken over in the fake Site implementation so
that everything runs the same using the fake
Site without having to change other
assumptions.

Updated several "path" methods (and many of their usages)
to take the "thing" you are looking for so you can
either get the path to the type of "thing" you
are looking for or the direct path to the
specific "thing" you are looking for.

Examples:

```
// ~/.config/valet/Nginx
$site->nginxPath();

// ~/.config/valet/Nginx/some-site.com.test
$site->nginxPath('some-site.com.test');
```

Made some other tests related to the existence of `Sites`
directory that resulted in updating the mocks for
many of the other tests.

All in all, it should make other aspects of the Site class
handle things more gracefully if `Sites` doesn't exist.
2020-04-28 11:47:25 -05:00
Chris Brown
f056663159 Add proxy site-handling commands
valet proxy domain host
valet unproxy domain
valet proxies (to list all recognized proxy site configs)
2020-04-27 23:01:59 -04:00
Aryeh Raber
1535605b0d Update commands list 2020-04-27 00:21:17 +02:00
Aryeh Raber
cafba7f4c5 Add additional commands 2020-04-26 22:53:38 +02:00
Aryeh Raber
9965f7614c Ignore output for commands using "> /dev/null 2>&1" 2020-04-26 22:53:30 +02:00
Aryeh Raber
dedaddeff0 Ensure commands starting with "sudo" are run normally 2020-04-26 13:41:12 +02:00
Aryeh Raber
86fa649362 Format output using <details> + <summary> and add plain text flag to opt out 2020-04-25 16:29:53 +02:00
Aryeh Raber
5baccdbb54 Add sudo back to ensure commands work correctly 2020-04-25 16:26:54 +02:00