Error when config file is not writable#7205
Error when config file is not writable#7205Morikko wants to merge 5 commits intonextcloud:masterfrom Morikko:config-write-code-error
Conversation
The http status code is now 500 Internal Server Error when config file can't be written. #6893 Signed-off-by: Eric Masseran <[email protected]>
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 <[email protected]>
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.
Could you fix the indentation of that and one below. We use tabs
Signed-off-by: Eric Masseran <[email protected]>
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.
Go with http_response_code(500); instead.
Signed-off-by: Eric Masseran <[email protected]>
|
@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.
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.
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 <[email protected]>
| echo $l->t('See %s', [ $urlGenerator->linkToDocs('admin-config') ])."\n"; | ||
| exit; | ||
| } else { | ||
| http_response_code(500); |
|
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 <[email protected]>
…instead of the actual resource * found while reviewing #7205 * allow to specify a special status code Signed-off-by: Morris Jobke <[email protected]>
…instead of the actual resource * found while reviewing #7205 * allow to specify a special status code Signed-off-by: Morris Jobke <[email protected]>
|
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 <[email protected]>
Issue: #6893
Fix:
Notes:
Questions: