Skip to content

Commit

Permalink
fix(encryption): Clicking on default module sets bogus value
Browse files Browse the repository at this point in the history
Fixes #44532 
Helps with #43123 

Also adds a warning so that people aren't confused when the "Enable server-side encryption" toggle can't be toggled anymore after encryption is enabled.

Signed-off-by: Josh <josh.t.richards@gmail.com>
  • Loading branch information
joshtrichards authored Apr 1, 2024
1 parent 536aa8a commit c9ba8fc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions apps/settings/src/components/Encryption.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@

<template>
<NcSettingsSection :name="t('settings', 'Server-side encryption')"
:description="t('settings', 'Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed.')"
:description="t('settings', 'Server-side encryption makes it possible to encrypt files which are uploaded to this server.')"
:doc-url="encryptionAdminDoc">
<NcNoteCard type="info">
<p>This comes with limitations like a performance penalty, so enable this only if needed.</p>
</NcNoteCard>
<NcNoteCard type="warning">
<p>Once enabled, server-side encryption cannot be toggled off here. Disabling encryption requires command line access.</p>
</NcNoteCard>
<NcCheckboxRadioSwitch :checked="encryptionEnabled || shouldDisplayWarning"
:disabled="encryptionEnabled"
type="switch"
Expand Down Expand Up @@ -137,10 +143,9 @@ export default {
key,
})

const stringValue = value ? 'yes' : 'no'
try {
const { data } = await axios.post(url, {
value: stringValue,
value: value,
})
this.handleResponse({
status: data.ocs?.meta?.status,
Expand All @@ -157,7 +162,7 @@ export default {
},
async enableEncryption() {
this.encryptionEnabled = true
await this.update('encryption_enabled', true)
await this.update('encryption_enabled', 'yes')
},
async handleResponse({ status, errorMessage, error }) {
if (status !== 'ok') {
Expand Down

0 comments on commit c9ba8fc

Please sign in to comment.