Skip to content

Commit b86f710

Browse files
committed
Add enterprise update channel options to config.
Consider enterprise channel when returning version to update to. - Update tests. - Remove beta/enterprise/stable platform and Qt5 specific urls. - Renaming of one variable. - Remove obsolete variables. Signed-off-by: Rello <[email protected]> Signed-off-by: Camila Ayres <[email protected]>
1 parent 4c71195 commit b86f710

File tree

3 files changed

+175
-59
lines changed

3 files changed

+175
-59
lines changed

config/config.php

Lines changed: 83 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -6,67 +6,65 @@
66

77
declare(strict_types=1);
88

9-
$stableReleaseDate = '2025-01-07 15:00';
10-
$stableVersion = '3.15.3';
11-
$fileProviderStableReleaseDate = '2025-01-07 15:00';
12-
$fileProviderStableVersion = '3.15.3';
13-
14-
$betaReleaseDate = '2024-09-09 17:00';
15-
$betaVersionInternal = '3.13.83';
16-
$betaVersion = '3.14.0-rc3';
17-
9+
//
10+
// daily
11+
//
1812
$dailyReleaseDateLinux = '20250116';
1913
$dailyReleaseDateWindows = '20250116';
2014
$dailyReleaseDateMacos = '20250116';
2115
$dailyUrl = "https://download.nextcloud.com/desktop/daily/";
2216

23-
$stableVersionString = 'Nextcloud Client ' . $stableVersion;
24-
$fileProviderStableVersionString = 'Nextcloud Client ' . $fileProviderStableVersion;
17+
//
18+
// beta
19+
//
20+
$betaReleaseDate = '2024-09-09 17:00';
21+
$betaVersionInternal = '3.13.83';
22+
$betaVersion = '3.14.0-rc3';
2523
$betaVersionString = 'Nextcloud Client ' . $betaVersion;
24+
$betaUrl = 'https://github.com/nextcloud-releases/desktop/releases/download/v' . $betaVersion . '/';
2625

27-
if (version_compare($version, '3.0.3') < 0) {
28-
$url = 'https://download.nextcloud.com/desktop/releases/';
29-
$stable_linux_url = $url . 'Linux/';
30-
$stable_windows_url = $url . 'Windows/';
31-
$stable_mac_url = $url . 'Mac/Installer/';
32-
33-
$betaUrl = 'https://download.nextcloud.com/desktop/prereleases/';
34-
$stable_linux_url = $url . 'Linux/';
35-
$stable_windows_url = $url . 'Windows/';
36-
$stable_mac_url = $url . 'Mac/';
37-
} else {
38-
$stableUrl = 'https://github.com/nextcloud-releases/desktop/releases/download/v' . $stableVersion . '/';
39-
$stable_linux_url = $stableUrl;
40-
$stable_windows_url = $stableUrl;
41-
$stable_mac_url = $stableUrl;
26+
//
27+
// stable
28+
//
29+
$stableReleaseDate = '2025-01-07 15:00';
30+
$stableVersion = '3.15.3';
31+
$stableVersionString = 'Nextcloud Client ' . $stableVersion;
32+
$stableUrl = 'https://github.com/nextcloud-releases/desktop/releases/download/v' . $stableVersion . '/';
4233

43-
$betaUrl = 'https://github.com/nextcloud-releases/desktop/releases/download/v' . $betaVersion . '/';
44-
$beta_linux_url = $betaUrl;
45-
$beta_windows_url = $betaUrl;
46-
$beta_mac_url = $betaUrl;
47-
}
34+
//
35+
// enterprise
36+
//
37+
$enterpriseReleaseDate = '2025-01-07 15:00';
38+
$enterpriseVersion = '3.15.3';
39+
$enterpriseVersionString = 'Nextcloud Client ' . $enterpriseVersion;
40+
$enterpriseUrl = 'https://github.com/nextcloud-releases/desktop/releases/download/v' . $enterpriseVersion . '/';
4841

42+
//
43+
// stable Qt5 (legacy)
44+
//
45+
$stableQt5_url = 'https://download.nextcloud.com/desktop/releases/';
46+
$stableQt5_linux_url = $stableQt5_url . 'Linux/';
47+
$stableQt5_windows_url = $stableQt5_url . 'Windows/';
48+
$stableQt5_mac_url = $stableQt5_url . 'Mac/Installer/';
4949
$stableQt5ReleaseDate = '2024-09-13 12:00';
5050
$stableQt5Version = '3.13.4';
51-
$fileProviderStableQt5Version = '3.13.4';
51+
$stableQt5fileProviderVersion = '3.13.4';
5252
$stableQt5VersionString = 'Nextcloud Client ' . $stableQt5Version;
53-
$fileProviderStableQt5VersionString = 'Nextcloud Client ' . $fileProviderStableQt5Version;
54-
$stableQt5_linux_url = $stable_linux_url;
55-
$stableQt5_windows_url = $stable_windows_url;
56-
$stableQt5_mac_url = $stable_mac_url;
53+
$stableQt5fileProviderVersionString = 'Nextcloud Client ' . $stableQt5fileProviderVersion;
5754

55+
//
56+
// Windows installer
57+
//
58+
$windows_suffix = '-x64.msi';
5859
if (version_compare($version, '3.1.0') < 0) {
5960
$windows_suffix = '-setup.exe';
6061
$stableVersion = '3.1.3';
6162
} else {
6263
if ($buildArch === 'i386') {
6364
$windows_suffix = '-x86.msi';
64-
} else {
65-
$windows_suffix = '-x64.msi';
66-
}
65+
}
6766
}
6867

69-
7068
/**
7169
* Associative array of OEM => OS => version
7270
*/
@@ -89,12 +87,12 @@
8987
'macos' => [
9088
'version' => $stableQt5Version,
9189
'versionstring' => $stableQt5VersionString,
92-
"fileProviderVersionString" => $fileProviderStableQt5VersionString,
90+
"fileProviderVersionString" => $stableQt5fileProviderVersionString,
9391
'downloadurl' => $stableQt5_mac_url . 'Nextcloud-' . $stableQt5Version . '.pkg',
94-
'fileProviderDownloadUrl' => $stableQt5_mac_url . 'Nextcloud-' . $fileProviderStableQt5Version . '-macOS-vfs.pkg',
92+
'fileProviderDownloadUrl' => $stableQt5_mac_url . 'Nextcloud-' . $stableQt5fileProviderVersion . '-macOS-vfs.pkg',
9593
'web' => 'https://nextcloud.com/install',
9694
"sparkleDownloadUrl" => $stableQt5_mac_url . 'Nextcloud-' . $stableQt5Version . '.pkg.tbz',
97-
"fileProviderSparkleDownloadUrl" => $stableQt5_mac_url . 'Nextcloud-' . $fileProviderStableQt5Version . '-macOS-vfs.pkg.tbz',
95+
"fileProviderSparkleDownloadUrl" => $stableQt5_mac_url . 'Nextcloud-' . $stableQt5fileProviderVersion . '-macOS-vfs.pkg.tbz',
9896
"signature" => "8cG1fsKD6OaFpe8npjDNAfI0EGWK69UHsusTKIAv0pGcd0MALM9Hqc+cWKGxH338LNPe4It65/KRI5cykoScDw==",
9997
"length" => 64634085,
10098
"fileProviderSignature" => "ZI/hNmZ3zedPHEwWuzAvqSSf5ddPkW+XrzYjRguRIcX0zDxXh1OR9iEr5BDIS8X9LeLoaRbaGLGHXlm7xQCxAA==",
@@ -106,24 +104,53 @@
106104
'linux' => [
107105
'version' => $stableVersion,
108106
'versionstring' => $stableVersionString,
109-
'downloadurl' => $stable_linux_url . 'Nextcloud-' . $stableVersion . '-x64.AppImage',
107+
'downloadurl' => $stableUrl . 'Nextcloud-' . $stableVersion . '-x64.AppImage',
110108
'web' => 'https://nextcloud.com/install',
111109
],
112110
'win32' => [
113111
'version' => $stableVersion,
114112
'versionstring' => $stableVersionString,
115-
'downloadurl' => $stable_windows_url . 'Nextcloud-' . $stableVersion . $windows_suffix,
113+
'downloadurl' => $stableUrl . 'Nextcloud-' . $stableVersion . $windows_suffix,
116114
'web' => 'https://nextcloud.com/install',
117115
],
118116
'macos' => [
119117
'version' => $stableVersion,
120118
'versionstring' => $stableVersionString,
121-
"fileProviderVersionString" => $fileProviderStableVersionString,
122-
'downloadurl' => $stable_mac_url . 'Nextcloud-' . $stableVersion . '.pkg',
123-
'fileProviderDownloadUrl' => $stable_mac_url . 'Nextcloud-' . $fileProviderStableVersion . '-macOS-vfs.pkg',
119+
"fileProviderVersionString" => $stableVersionString,
120+
'downloadurl' => $stableUrl . 'Nextcloud-' . $stableVersion . '.pkg',
121+
'fileProviderDownloadUrl' => $stableUrl . 'Nextcloud-' . $stableVersion . '-macOS-vfs.pkg',
122+
'web' => 'https://nextcloud.com/install',
123+
"sparkleDownloadUrl" => $stableUrl . 'Nextcloud-' . $stableVersion . '.pkg.tbz',
124+
"fileProviderSparkleDownloadUrl" => $stableUrl . 'Nextcloud-' . $stableVersion . '-macOS-vfs.pkg.tbz',
125+
"signature" => "6nYH9xj3jnyfNltKzFjW/ftxCiRbYISnYe51OHemuQRhbmXccldD0Jf3F2t7oClyeDW6UDjz+RIGJm9Yke28Aw==",
126+
"length" => 321201506,
127+
"fileProviderSignature" => "ES+XyMp0pg+NrudwJFxOStK/hh0dZ3crqO1wefSP34AxzfJlNtcbt6tA/fl9dEIdkHI3p3mHQ3Ksjqbg4JJzCw==",
128+
"fileProviderLength" => 369951114,
129+
],
130+
],
131+
'enterprise' => [
132+
'release' => $enterpriseReleaseDate,
133+
'linux' => [
134+
'version' => $enterpriseVersion,
135+
'versionstring' => $enterpriseVersionString,
136+
'downloadurl' => $enterpriseUrl . 'Nextcloud-' . $enterpriseVersion . '-x64.AppImage',
137+
'web' => 'https://nextcloud.com/install',
138+
],
139+
'win32' => [
140+
'version' => $enterpriseVersion,
141+
'versionstring' => $enterpriseVersionString,
142+
'downloadurl' => $enterpriseUrl . 'Nextcloud-' . $enterpriseVersion . $windows_suffix,
143+
'web' => 'https://nextcloud.com/install',
144+
],
145+
'macos' => [
146+
'version' => $enterpriseVersion,
147+
'versionstring' => $enterpriseVersionString,
148+
"fileProviderVersionString" => $enterpriseVersionString,
149+
'downloadurl' => $enterpriseUrl . 'Nextcloud-' . $enterpriseVersion . '.pkg',
150+
'fileProviderDownloadUrl' => $enterpriseUrl . 'Nextcloud-' . $enterpriseVersion . '-macOS-vfs.pkg',
124151
'web' => 'https://nextcloud.com/install',
125-
"sparkleDownloadUrl" => $stable_mac_url . 'Nextcloud-' . $stableVersion . '.pkg.tbz',
126-
"fileProviderSparkleDownloadUrl" => $stable_mac_url . 'Nextcloud-' . $fileProviderStableVersion . '-macOS-vfs.pkg.tbz',
152+
"sparkleDownloadUrl" => $enterpriseUrl . 'Nextcloud-' . $enterpriseVersion . '.pkg.tbz',
153+
"fileProviderSparkleDownloadUrl" => $enterpriseUrl . 'Nextcloud-' . $enterpriseVersion . '-macOS-vfs.pkg.tbz',
127154
"signature" => "6nYH9xj3jnyfNltKzFjW/ftxCiRbYISnYe51OHemuQRhbmXccldD0Jf3F2t7oClyeDW6UDjz+RIGJm9Yke28Aw==",
128155
"length" => 321201506,
129156
"fileProviderSignature" => "ES+XyMp0pg+NrudwJFxOStK/hh0dZ3crqO1wefSP34AxzfJlNtcbt6tA/fl9dEIdkHI3p3mHQ3Ksjqbg4JJzCw==",
@@ -135,23 +162,23 @@
135162
'linux' => [
136163
'version' => $betaVersionInternal,
137164
'versionstring' => $betaVersionString,
138-
'downloadurl' => $beta_linux_url . 'Nextcloud-' . $betaVersion . '-x64.AppImage',
165+
'downloadurl' => $betaUrl . 'Nextcloud-' . $betaVersion . '-x64.AppImage',
139166
'web' => 'https://nextcloud.com/install',
140167
],
141168
'win32' => [
142169
'version' => $betaVersionInternal,
143170
'versionstring' => $betaVersionString,
144-
'downloadurl' => $beta_windows_url . 'Nextcloud-' . $betaVersion . $windows_suffix,
171+
'downloadurl' => $betaUrl . 'Nextcloud-' . $betaVersion . $windows_suffix,
145172
'web' => 'https://nextcloud.com/install',
146173
],
147174
'macos' => [
148175
'version' => $betaVersionInternal,
149176
'versionstring' => $betaVersionString,
150-
'downloadurl' => $beta_mac_url . 'Nextcloud-' . $betaVersion . '.pkg',
151-
'fileProviderDownloadUrl' => $beta_mac_url . 'Nextcloud-macOS-vfs-' . $betaVersion . '.pkg',
177+
'downloadurl' => $betaUrl . 'Nextcloud-' . $betaVersion . '.pkg',
178+
'fileProviderDownloadUrl' => $betaUrl . 'Nextcloud-macOS-vfs-' . $betaVersion . '.pkg',
152179
'web' => 'https://nextcloud.com/install',
153-
"sparkleDownloadUrl" => $beta_mac_url . 'Nextcloud-' . $betaVersion . '.pkg.tbz',
154-
"fileProviderSparkleDownloadUrl" => $beta_mac_url . 'Nextcloud-macOS-vfs-' . $betaVersion . '.pkg',
180+
"sparkleDownloadUrl" => $betaUrl . 'Nextcloud-' . $betaVersion . '.pkg.tbz',
181+
"fileProviderSparkleDownloadUrl" => $betaUrl . 'Nextcloud-macOS-vfs-' . $betaVersion . '.pkg',
155182
"signature" => "DZQGmsUNZBwsbks+q59/qoRyEtLIfq41TUce5olxiLzXVUMi+BmJMQB9K50fRhYbp3TE+ranCOa5xh1gnLPhAw==",
156183
"fileProviderSignature" => "ruLAEp2bOmfe9s/4WjaOr3m1JMP7dtGcoZaoFN5tgtbdFT7XVAvNT166ZDMgDUiWy3bRwrg3I6gMlpKRHpMqAw==",
157184
"length" => 317860352,

src/Response.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ private function getUpdateVersion() : array {
8989
$stable = $this->config[$this->oem]['stable-qt5'][$this->platform];
9090
$beta = null;
9191
$daily = null;
92+
$enterprise = null;
9293
} else if (version_compare($this->osVersion, '12.0', '<') &&
9394
version_compare($this->version, '3.14.0', '<') &&
9495
version_compare($this->config[$this->oem]['stable'][$this->platform]['version'], '3.14.0', '==')) {
@@ -97,22 +98,29 @@ private function getUpdateVersion() : array {
9798
$stable = $this->config[$this->oem]['stable-qt5'][$this->platform];
9899
$beta = $this->config[$this->oem]['beta'][$this->platform];
99100
$daily = $this->config[$this->oem]['daily'][$this->platform];
101+
$enterprise = null;
100102
} else {
101103
$stable = $this->config[$this->oem]['stable'][$this->platform];
102104
$beta = $this->config[$this->oem]['beta'][$this->platform];
103105
$daily = $this->config[$this->oem]['daily'][$this->platform];
106+
$enterprise = $this->config[$this->oem]['enterprise'][$this->platform];
104107
}
105108

109+
$isMacOs = ($this->platform === 'macos' && $this->isSparkle === true);
110+
106111
if (isset($daily) && $this->channel == 'daily' && (version_compare($this->version, $daily['version']) == -1)) {
107112
return $daily;
108113
}
109114

110-
if (isset($beta) && $this->channel == 'beta' && (version_compare($stable['version'], $beta['version']) == -1 ||
111-
($this->platform === 'macos' && $this->isSparkle === true))) {
115+
if (isset($beta) && $this->channel == 'beta' && (version_compare($stable['version'], $beta['version']) == -1 || $isMacOs)) {
112116
return $beta;
113117
}
114118

115-
if (version_compare($this->version, $stable['version']) == -1 || ($this->platform === 'macos' && $this->isSparkle === true)) {
119+
if (isset($enterprise) && $this->channel == 'enterprise' && (version_compare($this->version, $enterprise['version']) == -1 || $isMacOs)) {
120+
return $enterprise;
121+
}
122+
123+
if (version_compare($this->version, $stable['version']) == -1 || $isMacOs) {
116124
return $stable;
117125
}
118126

tests/unit/ResponseTest.php

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,28 @@ public function updateDataProvider(): array
5858
'length' => 62738920,
5959
]
6060
],
61+
'enterprise' => [
62+
'release' => '2019-02-24 17:05',
63+
'linux' => [
64+
'version' => '2.2.2',
65+
'versionstring' => 'Nextcloud Client 2.2.2',
66+
'downloadurl' => 'https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-x64.AppImage',
67+
'web' => 'https://nextcloud.com/install/#install-clients',
68+
],
69+
'win32' => [
70+
'version' => '2.2.2.6192',
71+
'versionstring' => 'Nextcloud Client 2.2.2 (build 6192)',
72+
'downloadurl' => 'https://download.nextcloud.com/desktop/stable/ownCloud-2.2.2.6192-setup.exe',
73+
],
74+
'macos' => [
75+
'version' => '2.2.2.3472',
76+
'versionstring' => 'Nextcloud Client 2.2.2 (build 3472)',
77+
'downloadurl' => 'https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg',
78+
'sparkleDownloadUrl' => 'https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg.tbz',
79+
'signature' => 'MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=',
80+
'length' => 62738920,
81+
]
82+
],
6183
'beta' => [
6284
'release' => '2020-01-01 01:01',
6385
'linux' => [
@@ -766,6 +788,65 @@ public function updateDataProvider(): array
766788
<owncloudclient><version>2.2.2</version><versionstring>Nextcloud Client 2.2.2</versionstring><downloadurl>https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-x64.AppImage</downloadurl><web>https://nextcloud.com/install/#install-clients</web></owncloudclient>
767789
'
768790
],
791+
// #37 new openSuse
792+
[
793+
'nextcloud',
794+
'linux',
795+
'1.9.0',
796+
'opensuse-leap',
797+
'15.6',
798+
'6.6.0',
799+
'enterprise',
800+
false,
801+
false,
802+
$config,
803+
'<?xml version="1.0"?>
804+
<owncloudclient><version>2.2.2</version><versionstring>Nextcloud Client 2.2.2</versionstring><downloadurl>https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-x64.AppImage</downloadurl><web>https://nextcloud.com/install/#install-clients</web></owncloudclient>
805+
'
806+
],
807+
// #38 Win11 -> QT6
808+
[
809+
'nextcloud',
810+
'win32',
811+
'1.9.0',
812+
'',
813+
"11",
814+
"10.0.22622",
815+
'enterprise',
816+
true,
817+
false,
818+
$config,
819+
'<?xml version="1.0"?>
820+
<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>
821+
'
822+
],
823+
// #39 Again, Sparkle needs to know about the latest version
824+
[
825+
'nextcloud',
826+
'macos',
827+
'2.3',
828+
'',
829+
'11.0',
830+
'21.04.00',
831+
'enterprise',
832+
true,
833+
false,
834+
$config,
835+
'<?xml version="1.0" encoding="utf-8"?>
836+
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
837+
<channel>
838+
<title>Download Channel</title>
839+
<description>Most recent changes with links to updates.</description>
840+
<language>en</language>
841+
<item>
842+
<title>Nextcloud Client 2.2.2 (build 3472)</title>
843+
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
844+
<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:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
845+
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
846+
</item>
847+
</channel>
848+
</rss>'
849+
],
769850
];
770851
}
771852

0 commit comments

Comments
 (0)