-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Error when config file is not writable #7205
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
Conversation
The http status code is now 500 Internal Server Error when config file can't be written. #6893 Signed-off-by: Eric Masseran <rico.masseran@gmail.com>
If the config.php is not writable, print an error message: #6893 - with HTTP status 500 - Set config writable - Or set option to keep it read only Signed-off-by: Eric Masseran <rico.masseran@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #7205 +/- ##
============================================
- Coverage 51.91% 50.85% -1.06%
+ Complexity 25361 24541 -820
============================================
Files 1606 1584 -22
Lines 95311 93809 -1502
Branches 1394 1358 -36
============================================
- Hits 49478 47704 -1774
- Misses 45833 46105 +272
|
lib/base.php
Outdated
| [ $urlGenerator->linkToDocs('admin-dir_permissions') ]) | ||
| [ $urlGenerator->linkToDocs('admin-dir_permissions') ]) . '. ' | ||
| . $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See %s', | ||
| [ $urlGenerator->linkToDocs('admin-config') ] ) |
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.
Could you fix the indentation of that and one below. We use tabs
Signed-off-by: Eric Masseran <rico.masseran@gmail.com>
lib/base.php
Outdated
| } else { | ||
|
|
||
| header('HTTP/1.1 500 Internal Server Error'); | ||
| header('Status: 500 Internal Server Error'); |
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.
Go with http_response_code(500); instead.
Signed-off-by: Eric Masseran <rico.masseran@gmail.com>
|
@Morikko There is another check in |
That is normal. Translations will be added though transifex after the PR is merged.
Yes, I'd say 500 makes more sense here.
Yes, we should probably consolidate all those config checks into one method that can then be used in the different places. |
| [ $urlGenerator->linkToDocs('admin-dir_permissions') ]) . '. ' | ||
| . $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See %s', | ||
| [ $urlGenerator->linkToDocs('admin-config') ] ) | ||
| ); |
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.
Could you check the indentation of this, because it looks off. We usually use tabs for indenting lines. Beside that the changes look good 👍
MorrisJobke
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.
Looks good except the one little nitpick.
|
@juliushaertl you broke the sign-off ^^ |
|
@Morikko could you rebase and drop the unsigned merge pr? |
…instead of the actual resource * found while reviewing #7205 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
| echo $l->t('See %s', [ $urlGenerator->linkToDocs('admin-config') ])."\n"; | ||
| exit; | ||
| } else { | ||
| http_response_code(500); |
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 added this to the printErrorPage one in #9995
|
Let me take this one and create a new PR out of this. |
|
@Morikko Sorry that we missed this for so long. I rebased your PR and squashed the commits into one (with you as Author). Thanks for this contribution and you are welcome to help out with other issues :) See #9996 for the rebased version of this. See https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 for other good first issues ;) Thanks a lot |
…instead of the actual resource * found while reviewing #7205 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
…instead of the actual resource * found while reviewing #7205 * allow to specify a special status code Signed-off-by: Morris Jobke <hey@morrisjobke.de>
…instead of the actual resource * found while reviewing #7205 * allow to specify a special status code Signed-off-by: Morris Jobke <hey@morrisjobke.de>
|
Thank you @MorrisJobke for merging this. I had started when I had more time few months ago. Now, I am still busy on some other projects to keep continuing. |
…instead of the actual resource * found while reviewing #7205 * allow to specify a special status code Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Issue: #6893
Fix:
Notes:
Questions: