1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
<!--
- SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<script setup lang="ts">
import type { IDialogButton } from '@nextcloud/dialogs'
import { t } from '@nextcloud/l10n'
import { textExistingFilesNotEncrypted } from './sharedTexts.ts'
import NcDialog from '@nextcloud/vue/components/NcDialog'
import NcNoteCard from '@nextcloud/vue/components/NcNoteCard'
const emit = defineEmits<{
(e: 'close', encrypt: boolean): void
}>()
const buttons: IDialogButton[] = [
{
label: t('settings', 'Cancel encryption'),
// @ts-expect-error Needs to be fixed in the dialogs library - value is allowed but missing from the types
type: 'tertiary',
callback: () => emit('close', false),
},
{
label: t('settings', 'Enable encryption'),
type: 'error',
callback: () => emit('close', true),
},
]
/**
* When closed we need to emit the close event
* @param isOpen open state of the dialog
*/
function onUpdateOpen(isOpen: boolean) {
if (!isOpen) {
emit('close', false)
}
}
</script>
<template>
<NcDialog :buttons="buttons"
:name="t('settings', 'Confirm enabling encryption')"
size="normal"
@update:open="onUpdateOpen">
<NcNoteCard type="warning">
<p>
{{ t('settings', 'Please read carefully before activating server-side encryption:') }}
<ul>
<li>
{{ t('settings', 'Once encryption is enabled, all files uploaded to the server from that point forward will be encrypted at rest on the server. It will only be possible to disable encryption at a later date if the active encryption module supports that function, and all pre-conditions (e.g. setting a recover key) are met.') }}
</li>
<li>
{{ t('settings', 'By default a master key for the whole instance will be generated. Please check if that level of access is compliant with your needs.') }}
</li>
<li>
{{ t('settings', 'Encryption alone does not guarantee security of the system. Please see documentation for more information about how the encryption app works, and the supported use cases.') }}
</li>
<li>
{{ t('settings', 'Be aware that encryption always increases the file size.') }}
</li>
<li>
{{ t('settings', 'It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data.') }}
</li>
<li>
{{ textExistingFilesNotEncrypted }}
{{ t('settings', 'Refer to the admin documentation on how to manually also encrypt existing files.') }}
</li>
</ul>
</p>
</NcNoteCard>
<p>
{{ t('settings', 'This is the final warning: Do you really want to enable encryption?') }}
</p>
</NcDialog>
</template>
<style scoped>
li {
list-style-type: initial;
margin-inline-start: 1rem;
padding: 0.25rem 0;
}
p + p,
div + p {
margin-block: 0.75rem;
}
</style>
|