-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix: allow occ maintenance:update:htaccess to create .htaccess file in case it doesn't exist yet
#57227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Currently, the updateHtaccess() function can't deal with a missing .htaccess file, it assumes at least an empty .htaccess file. In some cases, the file may be missing though, and this commit adds functionality for creating it when this edgecase occurs. Signed-off-by: Marc <[email protected]>
This adds a hint to the error message that file creation may also have failed. Signed-off-by: Marc <[email protected]>
szaimen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this. The file needs to exist beforehand otherwise it might misses the important default config: https://github.com/nextcloud/server/blob/master/.htaccess
|
I had a situation where I copied over a directory using I am not aware of many of the potential side issues this may cause, but when I tested this locally, it fixed my problem. I also think it's better to have a It's up to you to do with this what you think is best, of course. |
In my opinion the command should fail if the file does not exist but maybe we could improve the error message? |
|
That's probably a good idea in any case, yeah :) Shall I remove the commit which adds the creation, and keep the single commit which changes the error message? |
Sounds good to me, yes :) |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Currently, the
updateHtaccess()function can't deal with a missing .htaccess file, it assumes at least an empty .htaccess file.In some cases, the file may be missing though, and this PR adds functionality for creating it when this edgecase occurs.
Before this PR, executing
occ maintenance:update:htaccesscan fail without the error message being explicit about this edgecase.occ maintenance:update:htaccessnot working.Summary
occ maintenance:update:htaccesscan now also create .htaccess files, instead of relying on them being present.TODO
Checklist
3. to review, feature component)stable32)