Skip to content

Commit 355a483

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 a733a77 commit 355a483

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
@@ -394,7 +394,12 @@ public function install($options) {
394394
$config = \OC::$server->getConfig();
395395
$config->setAppValue('core', 'installedat', microtime(true));
396396
$config->setAppValue('core', 'lastupdatedat', microtime(true));
397-
$config->setAppValue('core', 'vendor', $this->getVendor());
397+
398+
$vendorData = $this->getVendorData();
399+
$config->setAppValue('core', 'vendor', $vendorData['vendor']);
400+
if ($vendorData['channel'] !== 'stable') {
401+
$config->setSystemValue('updater.release.channel', $vendorData['channel']);
402+
}
398403

399404
$group = \OC::$server->getGroupManager()->createGroup('admin');
400405
if ($group instanceof IGroup) {
@@ -591,17 +596,14 @@ public static function protectDataDirectory() {
591596
file_put_contents($baseDir . '/index.html', '');
592597
}
593598

594-
/**
595-
* Return vendor from which this version was published
596-
*
597-
* @return string Get the vendor
598-
*
599-
* Copy of \OC\Updater::getVendor()
600-
*/
601-
private function getVendor() {
599+
private function getVendorData(): array {
602600
// this should really be a JSON file
603601
require \OC::$SERVERROOT . '/version.php';
604-
/** @var string $vendor */
605-
return (string)$vendor;
602+
/** @var mixed $vendor */
603+
/** @var mixed $OC_Channel */
604+
return [
605+
'vendor' => (string)$vendor,
606+
'channel' => (string)$OC_Channel,
607+
];
606608
}
607609
}

0 commit comments

Comments
 (0)