summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-03-08 13:49:08 +0100
committerCarl Schwan <carl@carlschwan.eu>2022-03-08 23:11:08 +0100
commit7496bf3461a382c9a93d876b894448b7c4cd28cb (patch)
tree1c3d6bad8fff2719c98e0b478fd2dec7e1961ffc /lib
parent8a52591335f9fc8ac06002dea17705f860487b09 (diff)
downloadnextcloud-server-7496bf3461a382c9a93d876b894448b7c4cd28cb.tar.gz
nextcloud-server-7496bf3461a382c9a93d876b894448b7c4cd28cb.zip
Require the secret config to be configured
If it's not configured the instance will look like it is working but various features will silently break (end to end encryption, setting alternate email and probably more). One issue is that changing the secret from empty to something will break various other stuff (app token). I don't think there is a good way to solve this issue other than breaking early instead of having to handle a painful migration later on. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/legacy/OC_Util.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php
index 9110678537f..5441d3a2864 100644
--- a/lib/private/legacy/OC_Util.php
+++ b/lib/private/legacy/OC_Util.php
@@ -969,6 +969,13 @@ class OC_Util {
];
}
+ if ($config->getValue('secret', '') === '' && !\OC::$CLI) {
+ $errors[] = [
+ 'error' => $l->t('The required \'secret\' config variable is not configued in the config.php file.'),
+ 'hint' => $l->t('Please ask your server administrator to check the Nextcloud configuration.')
+ ];
+ }
+
$errors = array_merge($errors, self::checkDatabaseVersion());
// Cache the result of this function