You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add stronger pre-run validation and safer execution for the encryption:encrypt-all command:
- more internal state checks before proceeding
- require explicit "yes" (not just "yANYTHING" confirmation to proceed due to sensitivity of action
- better guarantee restoration of state (maintenance/trashbin) via finally block
- explicitly log key failures
- improve user-facing help/warnings/guidance
Signed-off-by: Josh <[email protected]>
$output->writeln('<error>A default Server Side Encryption module is not configured; unable to encrypt files.</error>');
74
+
returnself::FAILURE;
73
75
}
74
76
77
+
// Prevent running if the default SSE module isn't valid
78
+
if (!isset($modules[$defaultModuleId])) {
79
+
$output->writeln('<error>The current default Server Side Encryption module does not exist: ' . $defaultModuleId . '; unable to encrypt files.</error>');
80
+
returnself::FAILURE;
81
+
}
82
+
83
+
// Prevent running if maintenance mode is already enabled
75
84
if ($this->config->getSystemValueBool('maintenance')) {
76
85
$output->writeln('<error>This command cannot be run with maintenance mode enabled.</error>');
77
86
returnself::FAILURE;
78
87
}
79
88
89
+
// TODO: Might make sense to add some additional readiness checks here such as the readiness of key storage/etc
90
+
80
91
$output->writeln("\n");
81
92
$output->writeln('You are about to encrypt all files stored in your Nextcloud installation.');
82
-
$output->writeln('Depending on the number of available files, and their size, this may take quite some time.');
83
-
$output->writeln('Please ensure that no user accesses their files during this time!');
84
-
$output->writeln('Note: The encryption module you use determines which files get encrypted.');
93
+
$output->writeln('Depending on the number and size of files, this may take a long time.');
94
+
$output->writeln('Please ensure that no user accesses their files during this process!');
95
+
$output->writeln('Note: The encryption module you use and its settings determine which files get encrypted.');
96
+
$output->writeln('Reminder: If External Storage is included in encryption, those files will no longer be accessible outside Nextcloud.');
97
+
$output->writeln('WARNING: Please read the documentation prior to utilizing this feature to avoid data loss!');
85
98
$output->writeln('');
86
-
$question = newConfirmationQuestion('Do you really want to continue? (y/n) ', false);
87
-
if ($this->questionHelper->ask($input, $output, $question)) {
0 commit comments