diff options
Diffstat (limited to 'lib/private/SystemConfig.php')
-rw-r--r-- | lib/private/SystemConfig.php | 87 |
1 files changed, 56 insertions, 31 deletions
diff --git a/lib/private/SystemConfig.php b/lib/private/SystemConfig.php index 7f0114ec821..7e8946f4d05 100644 --- a/lib/private/SystemConfig.php +++ b/lib/private/SystemConfig.php @@ -1,30 +1,10 @@ <?php + /** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Daniel Kesselberg <mail@danielkesselberg.de> - * @author Joas Schilling <coding@schilljs.com> - * @author Johannes Schlichenmaier <johannes@schlichenmaier.info> - * @author Lukas Reschke <lukas@statuscode.ch> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * + * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-only */ - namespace OC; use OCP\IConfig; @@ -35,15 +15,20 @@ use OCP\IConfig; * fixes cyclic DI: AllConfig needs AppConfig needs Database needs AllConfig */ class SystemConfig { + protected array $sensitiveValues; - /** @var array */ - protected $sensitiveValues = [ + protected const DEFAULT_SENSITIVE_VALUES = [ 'instanceid' => true, 'datadirectory' => true, 'dbname' => true, 'dbhost' => true, 'dbpassword' => true, 'dbuser' => true, + 'dbreplica' => true, + 'activity_dbname' => true, + 'activity_dbhost' => true, + 'activity_dbpassword' => true, + 'activity_dbuser' => true, 'mail_from_address' => true, 'mail_domain' => true, 'mail_smtphost' => true, @@ -52,16 +37,31 @@ class SystemConfig { 'passwordsalt' => true, 'secret' => true, 'updater.secret' => true, + 'updater.server.url' => true, 'trusted_proxies' => true, + 'preview_imaginary_url' => true, + 'preview_imaginary_key' => true, 'proxyuserpwd' => true, + 'sentry.dsn' => true, + 'sentry.public-dsn' => true, + 'zammad.download.secret' => true, + 'zammad.portal.secret' => true, + 'zammad.secret' => true, + 'github.client_id' => true, + 'github.client_secret' => true, 'log.condition' => [ 'shared_secret' => true, + 'matches' => true, ], 'license-key' => true, 'redis' => [ 'host' => true, 'password' => true, ], + 'redis.cluster' => [ + 'seeds' => true, + 'password' => true, + ], 'objectstore' => [ 'arguments' => [ // Legacy Swift (https://github.com/nextcloud/server/pull/17696#discussion_r341302207) @@ -74,6 +74,28 @@ class SystemConfig { // S3 'key' => true, 'secret' => true, + 'sse_c_key' => true, + // Swift v2 + 'username' => true, + 'password' => true, + // Swift v3 + 'user' => [ + 'name' => true, + 'password' => true, + ], + ], + ], + 'objectstore_multibucket' => [ + 'arguments' => [ + 'options' => [ + 'credentials' => [ + 'key' => true, + 'secret' => true, + ] + ], + // S3 + 'key' => true, + 'secret' => true, // Swift v2 'username' => true, 'password' => true, @@ -84,13 +106,16 @@ class SystemConfig { ], ], ], + 'onlyoffice' => [ + 'jwt_secret' => true, + ], + 'PASS' => true, ]; - /** @var Config */ - private $config; - - public function __construct(Config $config) { - $this->config = $config; + public function __construct( + private Config $config, + ) { + $this->sensitiveValues = array_merge(self::DEFAULT_SENSITIVE_VALUES, $this->config->getValue('config_extra_sensitive_values', [])); } /** |