Don't write to config file if config_is_read_only is set#30130
Don't write to config file if config_is_read_only is set#30130ChristophWurst merged 1 commit intomasterfrom
config_is_read_only is set#30130Conversation
This depends on nextcloud/server#30130. Signed-off-by: Jonas Meurer <[email protected]>
|
I opened a corresponding PR in nextcloud/documentation: nextcloud/documentation#7795 |
|
So this means all the paths which set a config need to check for the exception? |
33bd721 to
25b3ecf
Compare
Right now, a config file with read-only permissions throws the same kind of exception. So in my eyes, adding the check is not a regression to how it was before. What do you think? I agree that proper notifications about the config file being set to read-only would be nice in the long term. But that can be tackled in another PR later, no? |
|
Does it make sense to use |
|
That also is true for cron jobs where I would not expects write to happen. |
Also don't write to cache in this case to prevent cache and config file being out of sync. Fixes: #29901 Signed-off-by: Jonas Meurer <[email protected]>
25b3ecf to
241dfef
Compare
Do you mean that throwing the exception should be exposed on the interface ( |
|
Leaving the merge to a re-review from @ChristophWurst or @nickvergessen |
|
Yay, thanks @ChristophWurst! Added to #29914. Docs should be updated automatically with this PR. At least @nickvergessen said that |
|
The admin docs will be updated with the sample config, yes. But https://docs.nextcloud.com/server/latest/developer_manual/basics/storage/configuration.html should receive an update about the new exception |
With nextcloud/server#30130, `setConfigValue` throws a HintException when config is read-only.
Ah, thanks for the pointer! Did this now: nextcloud/documentation#7851 |
With nextcloud/server#30130, `setConfigValue` throws a HintException when config is read-only. Signed-off-by: Jonas Meurer <[email protected]>
Also don't write to cache in this case to prevent cache and config file
being out of sync.
Fixes: #29901