refactor(encryption): Migrate appconfig keys to typed bool IAppConfig with repair step#60002
refactor(encryption): Migrate appconfig keys to typed bool IAppConfig with repair step#60002cuppett wants to merge 3 commits intonextcloud:masterfrom
Conversation
cuppett
left a comment
There was a problem hiding this comment.
I don't know the convention when trying to refactor the legacy values out. Happy to simplify to only the minimal set or wait until next version for another PR. Just LMK.
864ad6a to
f3679b4
Compare
f3679b4 to
39b6d31
Compare
| if ($app === 'core' && $key === 'encryption_enabled' | ||
| && !in_array(strtolower(trim($value)), ['yes', '1', 'true', 'on'], true)) { |
There was a problem hiding this comment.
| if ($app === 'core' && $key === 'encryption_enabled' | |
| && !in_array(strtolower(trim($value)), ['yes', '1', 'true', 'on'], true)) { | |
| if ($app === 'core' && $key === 'encryption_enabled' && $value !== 'yes) { |
There was a problem hiding this comment.
Will this be okay if repair is needed or the database on upgrades hasn't been migrated yet?
There was a problem hiding this comment.
In #57279, test and application bootstrapping was dying early on and added this in response from this comment:
There was a problem hiding this comment.
Is the repair step really needed? I just checked, and simply using the IAppConfig API seems to be enough.
server/core/Command/Encryption/Enable.php
Line 39 in 585ca98
There was a problem hiding this comment.
My hope here is to get it all consistent with using getBoolVal and setBoolVal. That this PR has lots of changes where getBoolVal replaces things like:
$encryptHomeStorage = $this->config->getAppValue(
'encryption',
'encryptHomeStorage',
'1'
);
return ($encryptHomeStorage === '1');Has me worried it's messy out there. How does this release get everything to a boolVal and the code uses it consistently here forward?
a6fff8f to
e4f6ece
Compare
e4f6ece to
ed8afc2
Compare
… with repair step Switch all encryption config reads/writes from deprecated string-typed IConfig to bool-typed IAppConfig (getValueBool/setValueBool). Adds RetypeEncryptionConfigKeys repair step to retype existing string values to bool on upgrade. Includes lazy IAppConfig resolution in Manager and AppConfigTypeConflictException fallbacks throughout for safety during the upgrade window. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Stephen Cuppett <steve@cuppett.com>
Signed-off-by: Stephen Cuppett <steve@cuppett.com>
Apply suggestion from @artonge Co-authored-by: Louis <louis@chmn.me> Signed-off-by: Stephen Cuppett <steve@cuppett.com>
ed8afc2 to
d837de5
Compare
Summary
Switch all encryption config reads/writes from deprecated string-typed IConfig to bool-typed IAppConfig (getValueBool/setValueBool). Adds RetypeEncryptionConfigKeys repair step to retype existing string values to bool on upgrade. Includes lazy IAppConfig resolution in Manager and AppConfigTypeConflictException fallbacks throughout for safety during the upgrade window.
conflict between new type (mixed) and old type (boolean)#58778Checklist
3. to review, feature component)stable32)AI (if applicable)