Merge pull request #31492 from nextcloud/fix/check-secret-configured

This commit is contained in:
John Molakvoæ 2022-04-26 17:28:51 +02:00 committed by GitHub
commit 036f871d01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -55,7 +55,7 @@ jobs:
php -S localhost:8080 &
- name: PHPUnit
run: |
echo "<?php return ['run' => true,'hostname' => 'localhost','key' => 'minio','secret' => 'minio123', 'bucket' => 'bucket', 'port' => 9000, 'use_ssl' => false, 'autocreate' => true, 'use_path_style' => true];" > apps/${{ env.APP_NAME }}/tests/config.amazons3.php
echo "<?php return ['run' => true, 'secret' => 'actually-not-secret', 'passwordsalt' => 'actually-not-secret', 'hostname' => 'localhost','key' => 'minio','secret' => 'minio123', 'bucket' => 'bucket', 'port' => 9000, 'use_ssl' => false, 'autocreate' => true, 'use_path_style' => true];" > apps/${{ env.APP_NAME }}/tests/config.amazons3.php
phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/Amazons3Test.php
phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/VersionedAmazonS3Test.php
- name: S3 logs

View file

@ -736,6 +736,15 @@ class OC_Util {
];
}
foreach (['secret', 'instanceid', 'passwordsalt'] as $requiredConfig) {
if ($config->getValue($requiredConfig, '') === '' && !\OC::$CLI && $config->getValue('installed', false)) {
$errors[] = [
'error' => $l->t('The required \'' . $requiredConfig . '\' 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