Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@
$betaVersionSignature = 'RYWh27QN+GYl7If3pcpRVnny7ClHXpwjh7HqY06tXU0LXyfFqYciCFDdukdh49gfEVy9ocJjsJtSya/CxoG0DQ==';
$betaVersionLength = 381334544;

//
// stable Qt6.9 (macOS 11 / 12 — not compatible with Qt6.10)
// fixed to the last Qt6.9-compatible stable release
//
$stableQt69ReleaseDate = '2026-01-22 18:00';
$stableQt69Version = '4.0.6';
$stableQt69VersionSignature = 'yzAm+RTOEtHCEmz1L4JHiRJkdfKMIeFAqYEJlaYNYP6s5IBKLq7YZY1sbtlmKQttRqKurB67s7dCuaGA2A6VBA==';
$stableQt69VersionLength = 345060719;
$stableQt69VersionFileProviderSignature = 'BCONOVs9x/wJxP4y5i0gqdwEErYFy9HFfGHYyWuXxUn6mgzhMlFLt3lFQOsuVvz2ADsR+fEdIqSFiSN8zEDYAA==';
$stableQt69VersionFileProviderLength = 373240934;

//
// stable
//
Expand Down Expand Up @@ -81,6 +92,9 @@
$stableVersionString = 'Nextcloud Client ' . $stableVersion;
$stableUrl = 'https://github.com/nextcloud-releases/desktop/releases/download/v' . $stableVersion . '/';

$stableQt69VersionString = 'Nextcloud Client ' . $stableQt69Version;
$stableQt69Url = 'https://github.com/nextcloud-releases/desktop/releases/download/v' . $stableQt69Version . '/';

$enterpriseVersionString = 'Nextcloud Client ' . $enterpriseVersion;
$enterpriseUrl = 'https://github.com/nextcloud-releases/desktop/releases/download/v' . $enterpriseVersion . '/';

Expand Down Expand Up @@ -128,6 +142,23 @@
"fileProviderLength" => 97371547,
],
],
'stable-qt6.9' => [
'release' => $stableQt69ReleaseDate,
'macos' => [
'version' => $stableQt69Version,
'versionstring' => $stableQt69VersionString,
"fileProviderVersionString" => $stableQt69VersionString,
'downloadurl' => $stableQt69Url . 'Nextcloud-' . $stableQt69Version . '.pkg',
'fileProviderDownloadUrl' => $stableQt69Url . 'Nextcloud-' . $stableQt69Version . '-macOS-vfs.pkg',
'web' => 'https://nextcloud.com/install',
"sparkleDownloadUrl" => $stableQt69Url . 'Nextcloud-' . $stableQt69Version . '.pkg.tbz',
"fileProviderSparkleDownloadUrl" => $stableQt69Url . 'Nextcloud-' . $stableQt69Version . '-macOS-vfs.pkg.tbz',
"signature" => $stableQt69VersionSignature,
"length" => $stableQt69VersionLength,
"fileProviderSignature" => $stableQt69VersionFileProviderSignature,
"fileProviderLength" => $stableQt69VersionFileProviderLength,
],
],
'stable' => [
'release' => $stableReleaseDate,
'linux' => [
Expand Down
50 changes: 25 additions & 25 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,16 @@ private function getUpdateVersion() : array {
return [];
}

// if outdated platform, hand out latest stable-qt5, no daily/beta possible
if ($this->checkOldPlatform()) {
$stable = $this->config[$this->oem]['stable-qt5'][$this->platform];
$beta = null;
$daily = null;
$enterprise = null;
} else if (version_compare($this->osVersion, '12.0', '<') &&
version_compare($this->version, '3.14.0', '<') &&
version_compare($this->config[$this->oem]['stable'][$this->platform]['version'], '3.14.0', '==')) {
// Skip 3.14.0 for macOS < 12 when updating as we have an issue with the system requirement settings
// Serve the prior version instead in the meantime (3.13.4)
$stable = $this->config[$this->oem]['stable-qt5'][$this->platform];
$beta = $this->config[$this->oem]['beta'][$this->platform];
$daily = $this->config[$this->oem]['daily'][$this->platform];
$enterprise = null;
// if legacy platform, hand out its dedicated stable version; no daily/beta/enterprise
$legacyChannel = $this->getLegacyChannel();
if ($legacyChannel !== null) {
if (!isset($this->config[$this->oem][$legacyChannel][$this->platform])) {
return [];
}
$stable = $this->config[$this->oem][$legacyChannel][$this->platform];
$beta = null;
$daily = null;
$enterprise = null;
} else {
$stable = $this->config[$this->oem]['stable'][$this->platform];
$beta = $this->config[$this->oem]['beta'][$this->platform];
Expand Down Expand Up @@ -127,8 +122,8 @@ private function getUpdateVersion() : array {
return [];
}

private function checkOldPlatform(): bool {
// Outdated platforms:
private function getLegacyChannel(): ?string {
// Outdated platforms (Qt5 era):
// - macOS < 11
// - Win < 10
// - Win 10 (build number < 1809)
Expand All @@ -139,41 +134,46 @@ private function checkOldPlatform(): bool {

// Mac < 11
if ($this->platform === "macos" && version_compare($this->osVersion, "11") == -1) {
return true;
return 'stable-qt5';
}

// macOS 11/12 — not compatible with Qt6.10 (required by current stable)
if ($this->platform === "macos" && version_compare($this->osVersion, "13") == -1) {
return 'stable-qt6.9';
}

// Windows <10
if ($this->platform === "win32" && version_compare($this->osVersion, "10") == -1) {
return true;
return 'stable-qt5';
}

// Windows 10 (build number < 1809)
if ($this->platform === "win32" && version_compare($this->osVersion, "10") == 0 && version_compare($this->kernelVersion, '10.0.1809') == -1) {
return true;
return 'stable-qt5';
}

// - Win 11 (build number < 17764)
if ($this->platform === "win32" && version_compare($this->osVersion, "11") == 0 && version_compare($this->kernelVersion, '10.0.17764') == -1) {
return true;
return 'stable-qt5';
}

// - Ubuntu <22.04
if ($this->platform === "linux" && $this->osRelease == "ubuntu" && version_compare($this->osVersion, '22.04') == -1) {
return true;
return 'stable-qt5';
}

// - RHEL <9.2
if ($this->platform === "linux" && $this->osRelease == "rhel" && version_compare($this->osVersion, '9.2') == -1) {
return true;
return 'stable-qt5';
}


// - openSuse <15.5
if ($this->platform === "linux" && $this->osRelease == "opensuse-leap" && version_compare($this->osVersion, '15.5') == -1) {
return true;
return 'stable-qt5';
}

return false;
return null;
}

/**
Expand Down
95 changes: 80 additions & 15 deletions tests/unit/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@ public function updateDataProvider(): array
'length' => 62738920,
]
],
'stable' => [
'stable-qt6.9' => [
'release' => '2024-06-01 01:01',
'macos' => [
'version' => '2.1.0.2000',
'versionstring' => 'Nextcloud Client 2.1.0 (build 2000)',
'downloadurl' => 'https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg',
'sparkleDownloadUrl' => 'https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz',
'signature' => 'LEGACYMACSIG==',
'length' => 55555555,
],
],
'stable' => [
'release' => '2019-02-24 17:05',
'linux' => [
'version' => '2.2.2',
Expand Down Expand Up @@ -207,7 +218,7 @@ public function updateDataProvider(): array
false,
$config,
'<?xml version="1.0"?>
<owncloudclient><version>2.2.2.3472</version><versionstring>Nextcloud Client 2.2.2 (build 3472)</versionstring><downloadurl>https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg</downloadurl><sparkleDownloadUrl>https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg.tbz</sparkleDownloadUrl><signature>MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=</signature><length>62738920</length></owncloudclient>
<owncloudclient><version>2.1.0.2000</version><versionstring>Nextcloud Client 2.1.0 (build 2000)</versionstring><downloadurl>https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg</downloadurl><sparkleDownloadUrl>https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz</sparkleDownloadUrl><signature>LEGACYMACSIG==</signature><length>55555555</length></owncloudclient>
'
],
// #5
Expand All @@ -229,9 +240,9 @@ public function updateDataProvider(): array
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>Nextcloud Client 2.2.2 (build 3472)</title>
<title>Nextcloud Client 2.1.0 (build 2000)</title>
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
<enclosure url="https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg.tbz" sparkle:version="2.2.2.3472" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz" sparkle:version="2.1.0.2000" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="LEGACYMACSIG==" length="55555555"/>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
</item>
</channel>
Expand Down Expand Up @@ -400,9 +411,9 @@ public function updateDataProvider(): array
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>Nextcloud Client 2.2.2 (build 3472)</title>
<title>Nextcloud Client 2.1.0 (build 2000)</title>
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
<enclosure url="https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg.tbz" sparkle:version="2.2.2.3472" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz" sparkle:version="2.1.0.2000" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="LEGACYMACSIG==" length="55555555"/>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
</item>
</channel>
Expand Down Expand Up @@ -491,15 +502,15 @@ public function updateDataProvider(): array
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>Nextcloud Client 2.2.2 (build 3472)</title>
<title>Nextcloud Client 2.1.0 (build 2000)</title>
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
<enclosure url="https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg.tbz" sparkle:version="2.2.2.3472" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz" sparkle:version="2.1.0.2000" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="LEGACYMACSIG==" length="55555555"/>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
</item>
</channel>
</rss>'
],
// #21 Sparkle on, always needs to know what the latest version is
// #21 macOS 12 (legacy) on beta channel with RC version — gets stable-qt6.9, not beta
[
'nextcloud',
'macos',
Expand All @@ -518,15 +529,15 @@ public function updateDataProvider(): array
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>Nextcloud Client 2.2.2-rc2</title>
<title>Nextcloud Client 2.1.0 (build 2000)</title>
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-rc1.pkg.tbz" sparkle:version="2.2.2-rc2" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz" sparkle:version="2.1.0.2000" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="LEGACYMACSIG==" length="55555555"/>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
</item>
</channel>
</rss>'
],
// #22 Sparkle on, always needs to know what the latest version is
// #22 macOS 12 (legacy) on beta channel with stable version — gets stable-qt6.9, not beta
[
'nextcloud',
'macos',
Expand All @@ -545,9 +556,9 @@ public function updateDataProvider(): array
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>Nextcloud Client 2.2.2-rc2</title>
<title>Nextcloud Client 2.1.0 (build 2000)</title>
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-rc1.pkg.tbz" sparkle:version="2.2.2-rc2" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz" sparkle:version="2.1.0.2000" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="LEGACYMACSIG==" length="55555555"/>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
</item>
</channel>
Expand Down Expand Up @@ -820,7 +831,7 @@ public function updateDataProvider(): array
<owncloudclient><version>2.2.2.6192</version><versionstring>Nextcloud Client 2.2.2 (build 6192)</versionstring><downloadurl>https://download.nextcloud.com/desktop/stable/ownCloud-2.2.2.6192-setup.exe</downloadurl></owncloudclient>
'
],
// #39 Again, Sparkle needs to know about the latest version
// #39 macOS 11 (legacy) on enterprise channel — gets stable-qt6.9, not enterprise
[
'nextcloud',
'macos',
Expand All @@ -833,6 +844,33 @@ public function updateDataProvider(): array
false,
$config,
'<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Download Channel</title>
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>Nextcloud Client 2.1.0 (build 2000)</title>
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz" sparkle:version="2.1.0.2000" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="LEGACYMACSIG==" length="55555555"/>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
</item>
</channel>
</rss>'
],
// #40 macOS 13 — not legacy, gets regular stable via sparkle
[
'nextcloud',
'macos',
'1.9.0',
'',
'13.0',
'22.00.00',
'stable',
true,
false,
$config,
'<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Download Channel</title>
Expand All @@ -845,6 +883,33 @@ public function updateDataProvider(): array
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
</item>
</channel>
</rss>'
],
// #41 macOS 13 — not legacy, gets regular beta via sparkle
[
'nextcloud',
'macos',
'2.2.2-rc1',
'',
'13.0',
'22.00.00',
'beta',
true,
false,
$config,
'<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Download Channel</title>
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>Nextcloud Client 2.2.2-rc2</title>
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-rc1.pkg.tbz" sparkle:version="2.2.2-rc2" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
</item>
</channel>
</rss>'
],
];
Expand Down