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

76 Commits

Author SHA1 Message Date
Saibotk
85a8c89902 fix(entry-script): use correct php binary for proxy commands
These are the only instances, where the valet cli script is executed with the default
php binary instead of the evaluated binary.

We now use the `$PHP` executable to ensure that the valet cli is always called with the correct binary even when proxying composer / php.
2024-12-18 23:01:36 +01:00
Matt Stauffer
5a55c4ad89 Merge pull request #1495 from rcknr/cloudflared
Fix extra parameters for share tool, fixes #1494
2024-11-25 12:16:19 -05:00
Sergii Kauk
cd3fbb0423 Fix extra parameters for share tool, #1494 2024-09-16 12:50:56 +02:00
Matt Stauffer
3e2789c24e Fix failing extraction of secured domain check
Co-Authored-By: Mateus Junges <mateus@junges.dev>
2024-08-24 22:19:59 -05:00
Matt Stauffer
628997d835 Extract Cloudflared tunnels method 2024-08-24 19:33:17 -05:00
Sergii Kauk
dce6b3ca6e Merge branch 'master' into cloudflared 2024-07-30 10:53:52 +02:00
Chris Brown
336135515e Add quotes around $PHP (#1473)
Updates #1431 
Fixes #1472
2024-05-07 15:21:40 +02:00
Sergii Kauk
4c5fd953fc A bit of refactoring 2024-01-08 09:57:46 +01:00
Sergii Kauk
ca288d4066 Add a new share tool, cloudflared 2024-01-07 18:18:10 +01:00
datashaman
b5103d15bb Add quotes around $PHP (#1431)
If the PHP executable path has a space in it, it breaks valet. For example, when using the new Laravel Herd which stores its config and binaries under `~/Library/Application Support/Herd/...`
2023-07-21 05:30:32 +02:00
Matt Stauffer
064cfd9895 Check to make sure ngrok is configured correctly before sharing 2023-02-22 16:53:58 -05:00
Matt Stauffer
1d0483a0c8 Catch up to #1370 2023-02-18 21:49:11 -05:00
Matt Stauffer
921f68a3ae Support PHP 7.0+ (#1346)
* Get PHP executable for a PHP 8+ version even if linked PHP is below 8

This allows users to run PHP 7.4 (haven't tested in below 7.4) while the codebase is PHP 8+.

* Apply fixes from StyleCI

* Return correct path for linked PHP

* Apply fixes from StyleCI

* Add PHP@7.2 support

* Add support for PHP 7.0-7.2

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-01-18 16:39:21 -05:00
Matt Stauffer
303462ffd1 Add Expose support, drop ngrok binary and move it to be managed by Brew, drop copying ngrok share URL to clipbaord
* Extract basic driver with public/ from basic driver, and simplify both

* Apply fixes from StyleCI

* Set HTTP_HOST in BaseDriverTest

* Move server helpers to their own file; add type hints

* Update drivers location and loading

- Extract much of server.php into a `Server` class
- Move all but the Laravel and Basic drivers into a subfolder
- Load all but the Laravel and Basic drivers via glob
- Add `beforeLoading` hook to simplify the `frontControllerPath` method for some drivers

* Apply fixes from StyleCI

* Add additional notes to upgrade.md

* Apply fixes from StyleCI

* Require PHP 8.0

* Add type hints and return type hints to Brew

* Apply fixes from StyleCI

* Add type hints and return type hints to CommandLine

* Add type hints and return type hints to Configuration

* Add type hints and return type hints to Diagnose

* Apply fixes from StyleCI

* Add type hints and return type hints to DnsMasq

* Add type hints and return hints to Filesystem

* Add type hints and return types to Nginx

* Add type hints and return types to ngrok

* Add type hints and return types to PhpFpm

* Apply fixes from StyleCI

* Add type hints and return types to Site and Valet

* Apply fixes from StyleCI

* Require passing a version number to isolate command

* Apply fixes from StyleCI

* Bump compat to php 8; add type hints and return types to helpers

* Apply fixes from StyleCI

* Use constructor promotion

* Apply fixes from StyleCI

* Write tests for Server.php

* Apply fixes from StyleCI

* Move upgrade calls into Upgrader class, and add upgrade to check for old custom drivers

* Apply fixes from StyleCI

* Replace some \n with PHP_EOL; move custom drivers into Custom namespace

* Apply fixes from StyleCI

* Add doc blocks

* Clean up NullWriter; drop legacy config check

* Allow null response from frontControllerPath

* Apply fixes from StyleCI

* Drop exits, fix 404 path

* Better handle new installations

* Apply fixes from StyleCI

* Drop extensions

* Clean up DX for fetch-share-url

* Apply fixes from StyleCI

* Fix site::unlink method signature and docblock

* Tweak the wording for the which command

* Support isolated sites running PHP 7.4

* Add a bunch more CLI command tests (#1332)

* Wip some cli tests

* Apply fixes from StyleCI

* Test parked command

* Test forget command

* Update Filesystem::rmDirAndContents to respect symlinks

* Wip cli commands

* Apply fixes from StyleCI

* Test link command, unlink command, and secure command

* Apply fixes from StyleCI

* Add tests for unsecure, unsecure --all, secured commands

Add placeholders for the remaining CLI commands
Add nginx::restart to unsecure --all command

Co-authored-by: StyleCI Bot <bot@styleci.io>

* Drop old config migrations

* Add status command (#1329)

* Build the foundation of a status command

* Apply fixes from StyleCI

* Wip testing status command

* Apply fixes from StyleCI

* Fix status test

* Apply fixes from StyleCI

* Fix race condition in creating test config file

* Apply fixes from StyleCI

* Reset container for each test

* Differentiate response code based on success or failure of status command

* Apply fixes from StyleCI

* Add the ability to test if a Brew service is running

* Apply fixes from StyleCI

* Check for more services running in status command

* Apply fixes from StyleCI

* Test Status

* Apply fixes from StyleCI

* Drop Yoast from base application test case

Co-authored-by: StyleCI Bot <bot@styleci.io>

* Test most of the remaining CLI commands

* Test set tld command

* Test set loopback command

* Test proxy, unproxy, and proxies commands

* Apply fixes from StyleCI

* Test which command

* Test diagnose command

* Test directory-listing and which-php commands

* Text isolate and unisolate and isolated commands

* Apply fixes from StyleCI

* Test trust command

* Apply fixes from StyleCI

* Test on-latest-version command

* Move uninstall text to a class, and tweak text and presentation

* Apply fixes from StyleCI

* Test use command

* Test stop command

* Test start command

* Test restart command

Co-authored-by: StyleCI Bot <bot@styleci.io>

* Drop unnecessary doc blocks (#1339)

* Drop unnecessary doc blocks

* Apply fixes from StyleCI

Co-authored-by: StyleCI Bot <bot@styleci.io>

* Tweak status output and install output

* Add debug instructions to valet status, expand "valet installed" status check

* Drop extensions directory

* Apply fixes from StyleCI

* Remove more docblocks

* Upgrade ngrok to 3.1.0

* Test force uninstall command

* Test log command

* Drop copying Ngrok share to clipboard; add first steps of Expose code

* Add logic paths for Expose vs. ngrok and the share-tool config

* Apply fixes from StyleCI

* Take the first steps of manually installing ngrok and expose when needed

* Apply fixes from StyleCI

* Next steps Brew-installed ngrok

* Apply fixes from StyleCI

* Add class to represent Composer; continue ngrok + expose updates

* Apply fixes from StyleCI

* Add ensureInstalled() method to Expose and installOrFail() to Composer

* Apply fixes from StyleCI

* Require global PHP 8+ to install

* Exit if invalid domain is passed to valet share

* Update Composer dependencies to use Illuminate/Container

* Drop the idea of passing a custom domain to valet share

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-01-13 21:34:37 -05:00
Dries Vints
0208251cee Revert ngrok arm binary (#1258) 2022-05-26 14:18:06 +02:00
Matt Stauffer
e69d448245 Update Ngrok (valet share) to lowercase domains before matching 2022-05-18 11:47:30 -04:00
NasirNobin
ca2924daca Self code review 2022-03-23 01:35:30 +06:00
NasirNobin
4f098a8028 refactor with which-php command 2022-03-22 15:26:53 +06:00
NasirNobin
794fbc0c57 wip 2022-03-22 01:10:06 +06:00
NasirNobin
ee6a17ea57 wip 2022-03-21 19:50:43 +06:00
Dries Vints
35c62b608e Update valet 2022-02-01 16:20:12 +01:00
Udara Jay
921c08967a Remove extra "
The extra " in line 86 breaks the installer.
2022-01-18 13:08:44 -05:00
Dries Vints
3768e199b9 Add ARM support for ngrok 2022-01-18 11:44:17 +01:00
Bramus
0d5014a9e8 Pass USER as envvar when relaunching valet using sudo 2020-04-29 16:37:03 +02:00
comes
979826887c Update valet 2019-12-21 21:00:52 +01:00
Chris Brown
99f0bd19c5 Apply suggestions from code review
Co-Authored-By: Matt Stauffer <mattstauffer@users.noreply.github.com>
2019-12-10 23:17:49 -05:00
Chris Brown
998e4c32df Allow valet share to support multiple domains from same app
This PR allows passing a specific domain name to `valet share` in order to have the app be served for that domain.
Now how it works is this:
- (NEW) if a domain name is passed, it checks whether it matches a link (which would be required for multiple domains served by same app project), and uses that
- if a domain name is NOT passed, it looks up any links for current directory, and uses the first found link
- else falls back to current project foldername

It also still allows passing through custom ngrok parameters if desired (ref: #112), as either the 2nd parameter (no domain name passed) or (NEW) 3rd parameter

Fixes #537
2019-12-06 20:35:35 -05:00
Chris Brown
df7e46ebea Preserve User (and env) when calling sudo commands
Fixes #321
Creds to @Patistar
2019-04-17 20:40:45 -04:00
Denis Golubkov
bb8202f7a6 Update valet
Suppress error message if file not exists
2019-03-22 18:06:33 +03:00
Sahib J. Leo
001058414b #691 Surround with quotes all paths which might contain blank spaces. 2018-12-27 11:24:41 -05:00
Sahib J. Leo
b05c773e1d Addressing issue #678 2018-12-05 09:00:59 -05:00
Chris Brown
b803a37855 Change valet share to use port 60
Since the current TCP port 88 clashes with Kerberos, changing it to port 60 which IANA shows as unassigned, and other databases show as not being used in general practice.

Several alternates were researched, but show (although limited use, nevertheless possible) clashes with other systems, including ports 47, 81-90, 8080-8090, and 100. Various sources were referenced, and the overall conclusion is that 60 seems to be the safest and least likely to conflict.

Tested against a few limited firewall configs without issue.
Tested with both fresh new valet installs and an older install upgraded from 2.0.x.
2018-11-12 16:00:05 -05:00
Sergio Bruder
f7eb13435f quieting grep output on valet share test 2018-09-14 17:46:07 -03:00
Sergio Bruder
0e74928d33 fix share 2018-09-14 04:23:47 -03:00
Sergio Bruder
ac7b371d49 fix for share of secured sites 2018-09-14 03:39:33 -03:00
Chris Brown
16c58aa9da Remove extra message text from tld command output, for valet share cmd
The `valet share` command relies on the `tld` command outputting only the TLD and not a status message.
This removes the status message that was added with the recent tld update.
2018-09-13 20:22:11 -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
Erik Berkun-Drevnig
0fd37b0fed Change paths from ~/.valet to ~/.config/valet 2017-09-28 14:44:14 -04:00
Lynn
5e667b9afb Remove outdated comment
Always needs sudo since commit: fd595b5c71
2017-07-06 16:29:02 +08:00
René de Kat
8fc59dd748 Added option to pass custom parameters to ngrok
This makes it possible to add custom parameters to ngrok. For example:
--region=eu
-subdomain=YOUR_SUBDOMAIN

Some features, like -subdomain, are only available with the paid version of Ngrok.
2016-08-14 09:53:13 +01:00
Adam Wathan
92ec56e63a Fix bash error, update version 2016-08-08 15:26:02 -04:00
Adam Wathan
13cf1a85e1 Remove Composer-less functionality from master branch 2016-08-08 15:07:48 -04:00
Adam Wathan
0936f090b3 Remove current-domain in favor of domain with no args (#61) 2016-05-12 21:16:21 -05:00
Taylor Otwell
fd595b5c71 run commands as sudo 2016-05-11 19:40:44 -05:00
Taylor Otwell
e47034618d Fix resolution. 2016-05-11 13:31:17 -05:00
Taylor Otwell
d8d4df6288 remove variable 2016-05-11 11:28:04 -05:00
Taylor Otwell
60c9de3746 comment 2016-05-11 11:27:11 -05:00
Taylor Otwell
9b176f310f use variable 2016-05-11 10:42:04 -05:00
Taylor Otwell
c32b31d55e simplify dir checks 2016-05-11 10:41:34 -05:00
Taylor Otwell
6a1e3c9af9 added sudoers entries. 2016-05-10 21:45:49 -05:00