Skip DataDirectoryProtected check if data directory is outside of webroot
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
How to use GitHub
- Please use the 👍 reaction to show that you are interested into the same feature.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Is your feature request related to a problem? Please describe.
The check for the data directory protection is superfluous if the data directory resides outside of the webroot.
On some instances it also causes errors to be logged:
The requested uri(/var/my_datadir/.ocdata) cannot be processed by the script '/nextcloud/index.php'
Describe the solution you'd like
Check if the datadir is inside the webroot before performing the check - i.e. the head request in DataDirectoryProtected.
Describe alternatives you've considered
- Fix the setup so the request does not include
/nextcloudin the script name. Working on that in parallel - but I think both fixes make sense.
Additional context
Errors only started appearing after data directory was moved out of webroot.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the DataDirectoryProtected check and the head request described in the issue. Trace how the configured data directory is compared with the webroot before the check runs. Done means the check is skipped for data directories outside the webroot and the reported error is no longer logged in that setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100