Fix ASSET_URL not reaching PHP-FPM behind reverse proxy (#2026)#2182
Draft
lancepioch wants to merge 2 commits intomainfrom
Draft
Fix ASSET_URL not reaching PHP-FPM behind reverse proxy (#2026)#2182lancepioch wants to merge 2 commits intomainfrom
lancepioch wants to merge 2 commits intomainfrom
Conversation
PHP-FPM's clear_env default strips shell environment variables, so the exported ASSET_URL was never visible to Laravel. This persists it to .env where Dotenv can read it.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@docker/entrypoint.sh`:
- Around line 69-74: The current ASSET_URL write only targets /pelican-data/.env
which can miss the actual app .env when /var/www/html/.env is a non-symlink
file; update the entrypoint.sh ASSET_URL block to resolve the real target .env
(e.g., check if /var/www/html/.env exists and if it is a symlink use readlink -f
to get the real path, otherwise use /var/www/html/.env directly) and write or
sed to that resolved path, falling back to /pelican-data/.env only if the
resolved/app .env does not exist or is not writable; modify the ASSET_URL
handling in docker/entrypoint.sh to operate on the resolved_env_path variable
instead of hardcoding /pelican-data/.env so PHP‑FPM will see the change.
- Around line 70-72: The sed replacement for ASSET_URL uses the raw APP_URL
which can contain '&' or the '|' delimiter and corrupt /pelican-data/.env;
update the block that builds the sed command so APP_URL is escaped before being
used in the replacement (escape '&' and the chosen sed delimiter or switch to a
delimiter that is also escaped) and then use the escaped value in the sed
invocation that updates the ASSET_URL line; ensure you reference ASSET_URL and
APP_URL in the change so the replacement is safe for any APP_URL value.
3 tasks
Contributor
|
When I originally tested this caddy is where I set the asset_url and that resolved the issue. |
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.
PHP-FPM's clear_env default strips shell environment variables, so the exported ASSET_URL was never visible to Laravel. This persists it to .env where Dotenv can read it.
Fixes #2026