Closed beneverard closed 1 month ago
@beneverard thank you for the in-depth explanation and the video!
So when you secure a site, we get the location of the server.php file by calling osascript and run an Apple Script. And this seems to return the integer for you, which is very weird.
Could you try this:
touch script.txt
nano script.txt
Paste this content:
tell application "Herd"
get valet path
end tell
Run the script via:
osascript scrip.txt
You should see output like this:
path:/Applications/Herd.app/Contents/Resources/valet/server.php
@mpociot Ah this is all starting to make sense now, so I've run the commands above and here's my output:
2024-09-18 11:00:27.397 osascript[56801:3366338] ApplePersistence=NO
path:/Applications/Herd.app/Contents/Resources/valet/server.php
The first line I get is this notice/error (whatever it is I don't really know), and I assume in Herd you're splitting the string by the colon character and using the 2nd ([1]) element found as the path.
I did a quick test at "11:18:04" to confirm and the "random" number was "18", the minutes from the timestamp in that extra notice output.
I know others have experienced the same problem, perhaps using the "path:" string instead could make this a little more reliable.
Let me know if I can assist further and thanks for your reply and work on Herd.
huh, interesting! I can't figure out how to reproduce this locally unfortunately.
Could you try and run the osascript again but this time redirect error output to /dev/null? I assume the message you get is actually coming from stderr:
osascript script.txt 2>/dev/null
@mpociot When I output to /dev/null I get just the path only, so I think your assumption is correct.
path:/Applications/Herd.app/Contents/Resources/valet/server.php
Nice! Thank you for verifying this! This'll be fixed in the next update 🎉
Thank you, I'm glad I can help.
This is now fixed in Herd 1.11.1
@mpociot I'm sorry to be the bearer of bad news, but I'm still experiencing this problem.
I'm on Herd version 1.11.1 (Build: 34), and when securing sites the above issue still occurs.
I'd be happy to help perform further tasks to help get info on the problem, or to test a beta version if that'd help.
Not that I think it makes a big difference, but when I re-run the script.txt test you mentioned above the one with /dev/null
continues to return the correct value with additional messages, here's a screenshot to show.
Ignore the above, upgraded to "1.11.2 (Build: 35)" and this appears to be working as expected now :-)
Platform
macOS
Operating system version
macOS Sonama 14.6.1
System architecture
ARM64 (M1, M2, etc)
Herd Version
1.11.0 (Build: 33)
PHP Version
No response
Bug description
When visiting an unsecured site everything works as expected, however, after securing a site, visiting it redirects to a
/xx
where xx is a two-digit number.In issue #503 @mpociot mentions that Herd doesn't redirect and it's likely something in the user's application. I was curious about this, so I checked the Nginx configuration and found that the configs seem to be malformed, see here for ssl.test:
When comparing this Nginx config against one from a colleague all instances of
"26"
are incorrect (see<<<<
comments), and when changing this to"/Applications/Herd.app/Contents/Resources/valet/server.php"
and restarting Herd resolves the problem and secure sites work again.It seems like when the config was generated the
server.php
script was not correctly injected.Steps to reproduce
/xx
I've recorded a video demonstrating the issue and how to fix each instance.
Relevant log output
No response