aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Setup.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2022-09-19 13:53:49 +0200
committerblizzz (Rebase PR Action) <blizzz@users.noreply.github.com>2022-10-21 12:01:26 +0000
commit403923d72cc9509ee7df3d8b2044adb6c69a84fe (patch)
tree6f8a334916c9f715f065d7ffbeb23e6977db3144 /lib/private/Setup.php
parent7848d1cab6e0e3a6fb8cd15c4a8cba7147dabab9 (diff)
downloadnextcloud-server-403923d72cc9509ee7df3d8b2044adb6c69a84fe.tar.gz
nextcloud-server-403923d72cc9509ee7df3d8b2044adb6c69a84fe.zip
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>
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 a94074c37e7..7fe44826d28 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,
+ ];
}
}