DOCROOT_SUBDIR only in DEV mode; XDEBUG_START defaults to trigger
Review follow-up (PR #61 review 121): - create-vhost.sh ignores DOCROOT_SUBDIR (log line) unless environment=DEV, and entrypoint.sh only creates the folder in DEV. Defence in depth so a production container cannot move its web root through the env, even if a site owner got the variable into the container (WHP also denies it now). - dev-mode.sh: XDEBUG_START defaults to trigger instead of yes, so CLI runs (wp-cli) do not print "Could not connect to debugging client" without an IDE. XDEBUG_START=yes still connects on every request. - README/CLAUDE.md updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
This commit is contained in:
1 parent
64ebfa6c3b
commit
bbbae62d0b
5 files changed
+20
-9
No files matched your search
+10
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
alias_block=''
|
||||
|
||||
# ---- DOCROOT_SUBDIR (optional, local development: Laravel / CodeIgniter 4 /
|
||||
# ---- DOCROOT_SUBDIR (optional, local development, environment=DEV only: Laravel / CodeIgniter 4 /
|
||||
# Symfony style apps whose web root is public_html/public). Unset or empty (the
|
||||
# default, and what every production site uses) renders EXACTLY the same bytes
|
||||
# as before this variable existed. Validated with the same rules as WHP's
|
||||
@@ -32,6 +32,15 @@ docroot_valid() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# Defence in depth: only DEV mode (local-dev.sh) honours DOCROOT_SUBDIR. A
|
||||
# production container never moves its web root from this variable, even if a
|
||||
# site owner managed to put it in the container environment: WHP sets web root
|
||||
# folders through its own gated path.
|
||||
if [ -n "${DOCROOT_SUBDIR:-}" ] && [ "${environment:-}" != "DEV" ]; then
|
||||
echo "create-vhost: ignoring DOCROOT_SUBDIR (only honoured when environment=DEV)" >&2
|
||||
DOCROOT_SUBDIR=''
|
||||
fi
|
||||
|
||||
docroot="/home/$user/public_html"
|
||||
parent_block=''
|
||||
if [ -n "${DOCROOT_SUBDIR:-}" ]; then
|
||||
|
||||
Reference in new issue
Block a user