34
packages/docker/nextcloud/declarative-secrets.patch
Normal file
34
packages/docker/nextcloud/declarative-secrets.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
diff --git a/lib/private/Setup.php b/lib/private/Setup.php
|
||||
index 271e10d6..d21e2dd6 100644
|
||||
--- a/lib/private/Setup.php
|
||||
+++ b/lib/private/Setup.php
|
||||
@@ -272,21 +272,22 @@ class Setup {
|
||||
$dbType = 'sqlite3';
|
||||
}
|
||||
|
||||
- //generate a random salt that is used to salt the local passwords
|
||||
- $salt = $this->random->generate(30);
|
||||
- // generate a secret
|
||||
- $secret = $this->random->generate(48);
|
||||
-
|
||||
//write the config file
|
||||
$newConfigValues = [
|
||||
- 'passwordsalt' => $salt,
|
||||
- 'secret' => $secret,
|
||||
'trusted_domains' => $trustedDomains,
|
||||
'datadirectory' => $dataDir,
|
||||
'dbtype' => $dbType,
|
||||
'version' => implode('.', \OCP\Util::getVersion()),
|
||||
];
|
||||
|
||||
+ if ($this->config->getValue('passwordsalt', null) === null) {
|
||||
+ $newConfigValues['passwordsalt'] = $this->random->generate(30);
|
||||
+ }
|
||||
+
|
||||
+ if ($this->config->getValue('secret', null) === null) {
|
||||
+ $newConfigValues['secret'] = $this->random->generate(48);
|
||||
+ }
|
||||
+
|
||||
if ($this->config->getValue('overwrite.cli.url', null) === null) {
|
||||
$newConfigValues['overwrite.cli.url'] = $request->getServerProtocol() . '://' . $request->getInsecureServerHost() . \OC::$WEBROOT;
|
||||
}
|
Reference in New Issue
Block a user