Unit: Restrict access to hidden files and have PHP process files directly#458
Merged
jaydrogers merged 2 commits intoserversideup:mainfrom Oct 15, 2024
Merged
Conversation
Member
|
I am very grateful for your contributions! Thanks for taking a swing at this for me since I am still very new to Unit. I did pull your changes down and I ran into this error after building your image locally. ErrorSteps to reproduceBuild your image using the bash scripts/dev.sh --version 8.3.11 --variation unit --os bookwormBring up this example app under this specific branch: https://github.com/jaydrogers/docker-php-test-app/tree/458-unit-testing. It looks like it could be a simple syntax error, but I have been heads down on getting v3.4 out. I might bump these updates to v3.5 if we can get a solid way Unit config rolling. |
Contributor
Author
|
Missing common. The build script completes successfully now. |
Member
|
Thank you! This should be made available with v3.4! I will get a |
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.
Updating the routing in the Unit configuration to accomplish a couple of things:
The following routes step restricts access to hidden files and folders (start with
.)The following section allows the processing of PHP files requested directly. See #11 for more details. The issue with PHP files being downloaded instead of processed was due to the
shareentry in theaction. Theshareentry will download the file if there is a match and pass the URI to the application handler only if the file doesn't exist. Removing theshareentry and moving thepassentry out offallbackallows the PHP file to be processed directly.