Skip to content

Commit 1b510ff

Browse files
authored
Merge pull request #175 from nextcloud/add/enterprise
Check for enterprise channel
2 parents 4c71195 + a6c519a commit 1b510ff

File tree

4 files changed

+217
-75
lines changed

4 files changed

+217
-75
lines changed

README.md

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,24 @@ If the default `config.php` doesn't hold update information for this OEM, the co
1919
"stable": {
2020
"release": "2022-01-01 13:00",
2121
"linux": {
22-
"version": "2.3.2",
23-
"versionstring": "Nextcloud Client 2.3.2",
24-
"downloadurl": "https://download.nextcloud.com/desktop/releases/Linux/Nextcloud-2.3.2.1-setup.AppImage",
22+
"version": "3.2.1",
23+
"versionstring": "Nextcloud Client 3.2.1",
24+
"downloadurl": "https://download.nextcloud.com/desktop/releases/Linux/Nextcloud-3.2.1.AppImage",
2525
"web": "https://nextcloud.com/install/?pk_campaign=clientupdate#install-clients"
2626
},
2727
"win32": {
28-
"version": "2.3.2.1",
29-
"versionstring": "Nextcloud Client 2.3.2 (build 1)",
30-
"downloadurl": "https://download.nextcloud.com/desktop/releases/Windows/Nextcloud-2.3.2.1-setup.exe",
28+
"version": "3.2.1.0",
29+
"versionstring": "Nextcloud Client 3.2.1 (build 1234)",
30+
"downloadurl": "https://download.nextcloud.com/desktop/releases/Windows/Nextcloud-3.2.1-x64.msi",
3131
"web": "https://nextcloud.com/install/?pk_campaign=clientupdate#install-clients"
3232
},
3333
"macos": {
34-
"version": "2.2.4.1",
35-
"versionstring": "Nextcloud Client 2.2.4 (build 1)",
36-
"downloadurl": "https://download.nextcloud.com/desktop/releases/Mac/Updates/Nextcloud-2.2.4.1.pkg.tbz",
37-
"signature": "MCwCFGC3X/fejC/y/3T2X+c8ldDk7pJGAhQoR8v6vtvvV57nIcMNePA+jNRYcw=="
34+
"version": "3.5.2",
35+
"versionstring": "Nextcloud Client 3.5.2",
36+
"downloadurl": "https://download.nextcloud.com/desktop/releases/Mac/Installer/Nextcloud-3.15.2.pkg",
37+
"sparkleDownloadUrl": "https://download.nextcloud.com/desktop/releases/Mac/Installer/Nextcloud-3.15.2.pkg.tbz",
38+
"signature": "AAAaaaAAA001AAA001AAA001AAA001AAA123456001AAA+001AAA01+001AAA001AAA12345+001AAA001AAAA==",
39+
"length": 123123123
3840
}
3941
},
4042
"beta": {
@@ -52,17 +54,41 @@ If the default `config.php` doesn't hold update information for this OEM, the co
5254
"web": "https://nextcloud.com/install/?pk_campaign=clientupdate#install-clients"
5355
},
5456
"macos": {
55-
"version": "3.5.6-rc1",
56-
"versionstring": "Nextcloud Client 3.5.6 RC1",
57-
"downloadurl": "https://download.nextcloud.com/desktop/releases/Mac/Updates/Nextcloud-3.5.6-rc1-pkg.tbz",
58-
"signature": "MCwCFGC3X/fejC/y/3T2X+c8ldDk7pJGAhQoR8v6vtvvV57nIcMNePA+jNRYcw=="
57+
"version": "3.5.0-rc1",
58+
"versionstring": "Nextcloud Client 3.5.0 RC1",
59+
"downloadurl": "https://download.nextcloud.com/desktop/releases/Mac/Installer/Nextcloud-3.15.0-rc1.pkg",
60+
"sparkleDownloadUrl": "https://download.nextcloud.com/desktop/releases/Mac/Installer/Nextcloud-3.15.0-rc1.pkg.tbz",
61+
"signature": "AAAaaaAAA001AAA001AAA001AAA001AAA123456001AAA+001AAA01+001AAA001AAA12345+001AAA001AAAA==",
62+
"length": 123123123
5963
}
6064
}
6165
}
6266
```
6367

64-
## Developement
65-
To test this update server locally use `composer start`, which then will run the server on localhost port 1234.
68+
## Development
69+
70+
1. Create the json file in `config/` with the name of the OEM that contains the same entries as the `config.php`, e.g. `nextcloudev.json`.
71+
2. To test this update server locally use `composer start`, which then will run the server on localhost port 1234.
72+
3. Alternativately, you can directly execute: `php -S 0.0.0.0:1234 -t .`.
73+
4. To generate debug logs while developing:
74+
- Create a `php.ini` in the root folder with the following content:
75+
```
76+
error_log = /Users/camila/client_updater_server/test.log
77+
log_errors = on
78+
```
79+
- Start the development php server with: `php -S 0.0.0.0:1234 -c php.ini -t .`.
80+
81+
### Desktop client
82+
83+
- For all platforms, with cmake:
84+
- Enable `BUILD_UPDATER`.
85+
- Set `APPLICATION_UPDATE_URL` with `http://0.0.0.0:1234` or the following environment variable when running the client: `export OCC_UPDATE_URL="http://0.0.0.0:1234"`.
86+
- On mac OS:
87+
- Build the app bundle and codesign it using [mac-crafter](https://github.com/nextcloud/desktop/tree/master/admin/osx/mac-crafter).
88+
- Alternativately, with cmake:
89+
- Enable `BUILD_OWNCLOUD_OSX_BUNDLE`.
90+
- Set `SPARKLE_LIBRARY`.
91+
- `codesign` the `Sparkle.framework` and the app bundle.
6692
6793
## Deployment
6894

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.2';
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,52 +104,81 @@
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',
124122
'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',
123+
"sparkleDownloadUrl" => $stableUrl . 'Nextcloud-' . $stableVersion . '.pkg.tbz',
124+
"fileProviderSparkleDownloadUrl" => $stableUrl . 'Nextcloud-' . $stableVersion . '-macOS-vfs.pkg.tbz',
127125
"signature" => "6nYH9xj3jnyfNltKzFjW/ftxCiRbYISnYe51OHemuQRhbmXccldD0Jf3F2t7oClyeDW6UDjz+RIGJm9Yke28Aw==",
128126
"length" => 321201506,
129127
"fileProviderSignature" => "ES+XyMp0pg+NrudwJFxOStK/hh0dZ3crqO1wefSP34AxzfJlNtcbt6tA/fl9dEIdkHI3p3mHQ3Ksjqbg4JJzCw==",
130128
"fileProviderLength" => 369951114,
131129
],
132130
],
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',
151+
'web' => 'https://nextcloud.com/install',
152+
"sparkleDownloadUrl" => $enterpriseUrl . 'Nextcloud-' . $enterpriseVersion . '.pkg.tbz',
153+
"fileProviderSparkleDownloadUrl" => $enterpriseUrl . 'Nextcloud-' . $enterpriseVersion . '-macOS-vfs.pkg.tbz',
154+
"signature" => "wKIuw5109sTIvGvSuBTXlGp93TizSjFka45OslbgTIFrK+XzLJc2Zs+xCcpPcHLXBeFeKByq+ST1XpinWKSdBA==",
155+
"length" => 321172605,
156+
"fileProviderSignature" => "fQUSg4tLPip6etSv2ESVj9ALrcfVTMQNbuPPZD8alKLasAsEkGRAVZinNaRITDfNJo0cmkyEdePniZ4EAvDPAg==",
157+
"fileProviderLength" => 369917941,
158+
],
159+
],
133160
'beta' => [
134161
'release' => $betaReleaseDate,
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

0 commit comments

Comments
 (0)