valet: Valet share does not use the "normal" ngrok config location by default?
I’m trying to setup config of ngrok in ~/.ngrok2/ngrok.yml
seeing as this is the “normal” way of doing it per ngrok documentation. Yet it seems Valet does not use this config when running valet share
Does Valet share even use a config without having to pass it via the command option and if so where is it located? I don’t really want to specify the config option each time I use valet share.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 28 (14 by maintainers)
Commits related to this issue
- Merge pull request #943 from bramus/patch-valet-share-vscode-fix Pass USER as envvar when relaunching valet using sudo. Fixes #904 — committed to laravel/valet by mattstauffer 4 years ago
Perhaps a bit off topic but if u have issues using valet because you need to add the authtooken generated at ngrok’s website it can be added like this:
~/.composer/vendor/laravel/valet/bin/ngrok authtoken <YOUR_AUTHTOKEN>
As of today, the response by @brainmaniac is still the fix for me. Thank you!
Most puzzling.
Troubleshooting thoughts:
When you run
which ngrok
does it bring anything up? The default is no. Unless you’ve added it to your path for some reason, in which case maybe it’s finding some other config or ignoring it.If you delete the config file (and directory, assuming it’s now empty), then you can let ngrok create it directly:
/Users/thomas/.composer/vendor/laravel/valet/bin/ngrok authtoken TOKENCODEHERE
and then see if runningvalet share
reads it properlyMine is located at
~/.ngrok2/ngrok.yml
and is loaded correctly whenever I runvalet share
. … and contains the following few simple settings.I know it works because the authtoken recognizes and displays my account name whenever I run
valet share
.The solution provided by @brainmaniac still solves the problem for me even now. Much appreciated, buddy.
Hmmm … ngrok is treating
/var/root/
as your “home” directory (ie:~
). Valet calls sudo to run ngrok as “you” by passing your username to sudo -u, which it retrieves by runninglogname
. I wonder if you’ve configured your mac or your shell to treat you as root wheneverlogname
is called?I guess however you’ve configured your mac may require you to customize the command in:
/Users/thomas/.composer/vendor/laravel/valet/valet
https://github.com/laravel/valet/blob/d6558b90a5529f03752627798047f3a9e0543ab8/valet#L81