setName('encryption:enable-master-key') ->setDescription('Enable the master key. Only available for fresh installations with no existing encrypted data! There is also no way to disable it again.'); } protected function execute(InputInterface $input, OutputInterface $output): int { $isAlreadyEnabled = $this->util->isMasterKeyEnabled(); if ($isAlreadyEnabled) { $output->writeln('Master key already enabled'); return self::SUCCESS; } $question = new ConfirmationQuestion( 'Warning: Only available for fresh installations with no existing encrypted data! ' . 'There is also no way to disable it again. Do you want to continue? (y/n) ', false); if ($this->questionHelper->ask($input, $output, $question)) { $this->config->setAppValue('encryption', 'useMasterKey', '1'); $output->writeln('Master key successfully enabled.'); return self::SUCCESS; } $output->writeln('aborted.'); return self::FAILURE; } }