Skip to content

Commit 403923d

Browse files
committed
on installation save channel to config.php if not stable
- the default channel to the NC server is what is provided in /version.php unless it is overridden in config.php - the default channel to the NC Updater however is 'stable' - this resultant in inconsistent results and confusing admin experience - therefore "stable" is considered default and other channels are being written to config.php now upon installation Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent 7848d1c commit 403923d

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

lib/private/Setup.php

+13-11
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,12 @@ public function install($options) {
393393
$config = \OC::$server->getConfig();
394394
$config->setAppValue('core', 'installedat', microtime(true));
395395
$config->setAppValue('core', 'lastupdatedat', microtime(true));
396-
$config->setAppValue('core', 'vendor', $this->getVendor());
396+
397+
$vendorData = $this->getVendorData();
398+
$config->setAppValue('core', 'vendor', $vendorData['vendor']);
399+
if ($vendorData['channel'] !== 'stable') {
400+
$config->setSystemValue('updater.release.channel', $vendorData['channel']);
401+
}
397402

398403
$group = \OC::$server->getGroupManager()->createGroup('admin');
399404
if ($group instanceof IGroup) {
@@ -582,17 +587,14 @@ public static function protectDataDirectory() {
582587
file_put_contents($baseDir . '/index.html', '');
583588
}
584589

585-
/**
586-
* Return vendor from which this version was published
587-
*
588-
* @return string Get the vendor
589-
*
590-
* Copy of \OC\Updater::getVendor()
591-
*/
592-
private function getVendor() {
590+
private function getVendorData(): array {
593591
// this should really be a JSON file
594592
require \OC::$SERVERROOT . '/version.php';
595-
/** @var string $vendor */
596-
return (string)$vendor;
593+
/** @var mixed $vendor */
594+
/** @var mixed $OC_Channel */
595+
return [
596+
'vendor' => (string)$vendor,
597+
'channel' => (string)$OC_Channel,
598+
];
597599
}
598600
}

0 commit comments

Comments
 (0)