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

69 Commits

Author SHA1 Message Date
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
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
David Connolly
5cf4aea612 Cater for filepaths with spaces
Fixes issue where certificates fail to be generated due to a space in the filepath
2019-12-03 22:47:12 +00:00
Matt Stauffer
0681437219 Merge pull request #854 from drbyte/valet-unsecure-all
Add --all parameter to valet unsecure command
2019-12-01 14:55:43 -05:00
Matt Stauffer
8eea03f6a2 Merge pull request #835 from jrbarnard/bugfix/parked-merge-overwrite
Do not show sites in parked if they would not be served
2019-12-01 12:57:12 -05:00
Chris Brown
d6f06045fc Add --all parameter to valet unsecure command
This PR allows passing `--all` to `valet unsecure` to have it remove all certificates from all Valet configs AND from the MacOS Keychain.
This effectively cleans up certificate fragments or broken configs, and can help with troubleshooting.
2019-11-30 16:38:48 -05:00
Chris Brown
e8d49c42bf Symfony/Process 4.4.0 compatibility
Process `4.4.0` changed command-line parsing by being more aggressive with substitutions, causing our intended literal `"$NF"` to throw an exception.

https://github.com/symfony/process/compare/v4.3.8...v4.4.0#diff-9a01fc0e340da4c3f1e4a16029a63977R1644-R1653
2019-11-21 12:04:13 -05:00
James Barnard
afedf5be57 Do not show sites in parked if they would not be served (parked after a site with the same name, or an existing linked site) 2019-10-21 23:18:38 +01:00
James Barnard
cb8d971097 Ignore parked paths that are not directory when getting parked sites 2019-10-21 22:56:10 +01:00
James Barnard
b16559a450 Merge branch 'master' into feature/links-with-parked 2019-10-04 07:30:35 +01:00
James Barnard
921776ff11 Deprecate getLinks 2019-10-02 15:53:15 +01:00
James Barnard
b3ef3b1367 Fix stripe -> strip typo 2019-10-02 15:10:46 +01:00
James Barnard
e5dceb2bc5 Check for tld on end of certificate file name to support multi segment tld's 2019-10-02 13:56:51 +01:00
James Barnard
9d4126856d Add 'parked' command to show all sites which have been parked using valet park 'path' 2019-10-02 13:31:06 +01:00
Andrew Miller
e336ebc12f Fix issue with CA serial params
Should always provide CAserial, but should only provide CAcreateserial if file does not exist. Should probably fix permissions issue mentioned in the comments when attempting to create certificate.
2019-04-08 17:30:40 +09:00
Tim Cieplowski
f50b7dbe11 handle SSL .crt creation "Permission denied" failure 2019-03-20 11:35:31 -04:00
Tim Cieplowski
62edb056b4 fix ssl certificate creation 2019-01-30 11:09:23 -05:00
Sahib J. Leo
001058414b #691 Surround with quotes all paths which might contain blank spaces. 2018-12-27 11:24:41 -05:00
Chris Brown
2f17e688ce Add DomainException declaration to #353 2018-09-18 23:27:46 -04:00
Matt Stauffer
0323607850 Merge pull request #353 from antonioribeiro/improveUnlink
Unlink renamed links
2018-09-18 22:24:09 -04:00
Matt Stauffer
7eb1aec410 Merge pull request #449 from eberkund/master
Move ~/.valet to ~/.config/valet
2018-08-30 08:33:28 -04:00
Chris Brown
a7d8f32073 Fix merge error
The domain-name determination using strrpos wasn't very efficient. Stripping the `.crt` from the end of the filename is easier to parse.
Now all it returns is the first part of the string up until the final `.`, treating the remainder as whatever tld was used for the domain, regardless of what tld valet is configured for.
2018-08-22 13:40:32 -04:00
Chris Brown
e5f9a6163a Merge branch 'master' into tld-alias-for-domain-command 2018-06-22 14:03:56 -04:00
kroko / Reinis Adovičs
79b539840d in unsecure() always try to clean keychain 2018-02-08 20:38:19 +02:00
kroko / Reinis Adovičs
3af02dfba8 unsecure also by trying to match cert email 2018-02-08 20:26:53 +02:00
kroko / Reinis Adovičs
08d681f27b get rid of affix 2018-02-08 00:10:42 +02:00
kroko / Reinis Adovičs
b32080b678 trying to delete nonexistent settings will fail 2018-02-08 00:04:22 +02:00
kroko / Reinis Adovičs
3f11288920 store CA in separate directory 2018-02-07 23:16:51 +02:00
kroko / Reinis Adovičs
a2d446b871 change spaces for CA srl param 2018-02-07 22:10:51 +02:00
kroko / Reinis Adovičs
9b543f4aa0 explicit CA serial for macOS 10.13.3 2018-02-07 22:03:36 +02:00
kroko
192456d369 change security delete-certificate command order 2018-01-31 09:36:10 +02:00
kroko / Reinis Adovičs
4500e6e0d2 Keep random affix only for CN 2018-01-31 09:24:17 +02:00
kroko / Reinis Adovičs
694bd5d571 empty C, ST, L fields in root certificate 2018-01-31 05:18:15 +02:00
kroko / Reinis Adovičs
91b0b69dd7 when unsecuring try deleting also old wildcard 2018-01-31 04:45:06 +02:00
kroko
312d9e33cb adding CA to the created certificates 2018-01-30 14:13:49 +02:00
Matt Stauffer
a7777690ee Add a test that https is parsed correctly for non .dev domains in valet links 2018-01-05 13:16:39 -05:00
jasper-ter-veen
117a937638 Update Site.php 2017-12-20 16:54:35 +01:00
jasper-ter-veen
06fc109d43 Fix issue #445
Can't `valet links` other domain show https except `.dev`
2017-12-20 16:27:44 +01:00
Erik Berkun-Drevnig
f33bff81e9 Make sure Sites dir is linked 2017-11-27 01:39:27 -05:00
Chris Brown
3f1c5fae60 Fix bug with certificate search for TLDs of other than 3 chars
The `substr` of `-8` was based on `.dev.crt`, but since the TLD has always been configurable, this should have always been dynamic.

Running `valet links` will not show `https` or the `TLS` columns correctly if the substring matching is of the wrong length.
2017-10-17 20:33:39 -04:00
Chris Brown
58e4645fe2 Change valet domain command to valet tld
Fixes #144
".test" or ".dev" is really a TLD, not a "domain" in the conventional sense.
Changing the command to `valet tld` more accurately reflects the purpose of the command (to set or get the configured TLD served by Valet)

The use of `valet domain` is currently preserved as an alias for `valet tld`, but will be removed at a later date.
2017-10-17 15:47:39 -04:00
Chris Brown
bd5c998019 Change valet domain command to valet tld
Fixes #144
".dev" is really a TLD, not a "domain" in the conventional sense.
Changing the command to `valet tld` more accurately reflects the purpose of the command (to set or get the configured TLD served by Valet)
2017-10-17 13:18:11 -04:00
Andrew Miller
7b2deaf8a4 Generate SHA-256 certificates
Generate SHA-256 certificates as SHA-1 certificates, the current default, are deprecated and support for them will quickly be dropped by major browsers as documented here: https://blog.qualys.com/ssllabs/2014/09/09/sha1-deprecation-what-you-need-to-know
2017-08-18 02:26:59 +09:00
Antonio Carlos Ribeiro
b899a10d7a Unlink renamed links 2017-05-05 18:05:53 -03:00
Adam Wathan
4743c118d6 Obliterate filthy typehints 2017-04-04 09:12:28 -04:00
Josh Larson
79d916d499 Filter out .conf files when creating secure URL list 2017-03-25 08:59:53 -04:00
Adam Wathan
a80a24a459 Formatting 2017-02-27 10:03:20 -05:00