Bugfix/vhost issues roundup#16
Open
kdallas wants to merge 2 commits into
Open
Conversation
Security: - Replace $_SERVER['HTTP_HOST'] with Docker internal hostname to prevent SSRF - Add cURL connect/read timeouts (3s/5s) to prevent hung PHP-FPM workers Robustness: - Add fopen() error handling in getVhostBackend() with logged warning - Clean up IPv6 address parsing using array_pop/implode/array_slice - Replace hardcoded PHP container IP with dynamic gethostname()/SERVER_ADDR - Fix XHR timeout race: use native xhr.ontimeout instead of manual setTimeout - Make vhost AJAX endpoint return consistent JSON with status/message fields Cleanup: - Fix unscoped JS variable (i) in for-loop - Change read-only status check from POST to GET - Fix operator precedence in XHR status check (readyState vs status) - Remove dead/commented-out code in checkDns() - Add backup files and local shell scripts to .gitignore Co-Authored-By: Claude <noreply@anthropic.com>
canConnect() was always connecting on port 80, but the PHP container's socat forwarding listens on HOST_PORT_HTTPD (e.g. 8001), not 80. This made every vhost show WARN because the internal cURL check targeted 127.0.0.1:80 where nothing was listening. Use getPort() to append the configured port to the cURL URL. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BUGFIX_VHOSTS
Goal
General QoL clean ups
DESCRIPTION
Mainly I wanted to harden up the Curl requests so they can't hang PHP-FPM. I also would always see WARN status on my correctly configured vHosts so now we will see green OK responses.
Here's a breakdown of findings that this PR resolves: