summaryrefslogtreecommitdiffstats
path: root/lib/private/Setup.php
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-10-21 17:14:56 +0200
committerGitHub <noreply@github.com>2022-10-21 17:14:56 +0200
commit294a00d8e0b87a29c9f9de5de56e84a76c95182b (patch)
treec8ad0eeaa4bf2db832e0bd3fa50daa204bb4c721 /lib/private/Setup.php
parent4aa8e8051199f9e00580a4931e08e4acad80eee1 (diff)
parent2ef9826c3b293816a092db2eee670ea48b4df1eb (diff)
downloadnextcloud-server-294a00d8e0b87a29c9f9de5de56e84a76c95182b.tar.gz
nextcloud-server-294a00d8e0b87a29c9f9de5de56e84a76c95182b.zip
Merge pull request #34136 from nextcloud/fix/default-channel
on installation save channel to config.php if not stable
Diffstat (limited to 'lib/private/Setup.php')
-rw-r--r--lib/private/Setup.php24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/private/Setup.php b/lib/private/Setup.php
index cd11f73abbe..3b79b31b849 100644
--- a/lib/private/Setup.php
+++ b/lib/private/Setup.php
@@ -393,7 +393,12 @@ class Setup {
$config = \OC::$server->getConfig();
$config->setAppValue('core', 'installedat', microtime(true));
$config->setAppValue('core', 'lastupdatedat', microtime(true));
- $config->setAppValue('core', 'vendor', $this->getVendor());
+
+ $vendorData = $this->getVendorData();
+ $config->setAppValue('core', 'vendor', $vendorData['vendor']);
+ if ($vendorData['channel'] !== 'stable') {
+ $config->setSystemValue('updater.release.channel', $vendorData['channel']);
+ }
$group = \OC::$server->getGroupManager()->createGroup('admin');
if ($group instanceof IGroup) {
@@ -582,17 +587,14 @@ class Setup {
file_put_contents($baseDir . '/index.html', '');
}
- /**
- * Return vendor from which this version was published
- *
- * @return string Get the vendor
- *
- * Copy of \OC\Updater::getVendor()
- */
- private function getVendor() {
+ private function getVendorData(): array {
// this should really be a JSON file
require \OC::$SERVERROOT . '/version.php';
- /** @var string $vendor */
- return (string)$vendor;
+ /** @var mixed $vendor */
+ /** @var mixed $OC_Channel */
+ return [
+ 'vendor' => (string)$vendor,
+ 'channel' => (string)$OC_Channel,
+ ];
}
}