Skip to content
Draft
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ If the default `config.php` doesn't hold update information for this OEM, the co
4. To generate debug logs while developing:
- Create a `php.ini` in the root folder with the following content:
```
error_log = /Users/camila/client_updater_server/test.log
error_log = ~/client_updater_server/test.log
log_errors = on
```
- Start the development php server with: `php -S 0.0.0.0:1234 -c php.ini -t .`.
Expand Down
33 changes: 6 additions & 27 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,25 @@
$betaReleaseDate = '2025-11-25 13:40';
$betaVersionInternal = '4.0.2'; // short string
$betaVersion = '4.0.2'; // long string like '3.16.0-rc3' used to hide the cryptical subversion like .58 from the user;
$betaVersionSignature = 'ynh6SBeDcS0XViB9XJn59gw//hVR9hEhunO83L6uQe5yedplGdW7yacGXFjxAPr/m40unlRH2SI5QGt/gofmCQ==';
$betaVersionLength = 342008680;
$betaVersionFileProviderSignature = 'pfsfGlQUmrHptGCaf1TzssYjKbHxhnMV0rGvT3mmdtEf+URnbUC3eD8xrA27f3iZSIRLmBGuMMrImDSG+YxXDA==';
$betaVersionFileProviderLength = 370127696;
$betaVersionSignature = 'pfsfGlQUmrHptGCaf1TzssYjKbHxhnMV0rGvT3mmdtEf+URnbUC3eD8xrA27f3iZSIRLmBGuMMrImDSG+YxXDA==';
$betaVersionLength = 370127696;

//
// stable
//
$stableReleaseDate = '2025-11-25 13:40';
$stableVersion = '4.0.2';
$stableVersionSignature = 'ynh6SBeDcS0XViB9XJn59gw//hVR9hEhunO83L6uQe5yedplGdW7yacGXFjxAPr/m40unlRH2SI5QGt/gofmCQ==';
$stableVersionLength = 342008680;
$stableVersionFileProviderSignature = 'pfsfGlQUmrHptGCaf1TzssYjKbHxhnMV0rGvT3mmdtEf+URnbUC3eD8xrA27f3iZSIRLmBGuMMrImDSG+YxXDA==';
$stableVersionFileProviderLength = 370127696;
$stableVersionSignature = 'pfsfGlQUmrHptGCaf1TzssYjKbHxhnMV0rGvT3mmdtEf+URnbUC3eD8xrA27f3iZSIRLmBGuMMrImDSG+YxXDA==';
$stableVersionLength = 370127696;

//
// enterprise
// should point to that stable version, that was branded to the customers
//
$enterpriseReleaseDate = '2025-11-25 13:40';
$enterpriseVersion = '3.17.4';
$enterpriseVersionSignature = 'uMKB/UoExWbv8y8VxzX1IAkrS5zhGThK+jemdPJYaxQveB73WyOIZVfi5Me2kFMT52oLJ7uyxLifAgSJ/PzFAg==';
$enterpriseVersionLength = 332821925;
$enterpriseVersionFileProviderSignature = 'Etp40vzjOKAbiLOllzCZugCDkS+TMimkDUeIYigLCZAbIeKTMF7O+OpxiDEO58xfblj7xG2KKqvjej2fSrUcBA==';
$enterpriseVersionFileProviderLength = 374673225;
$enterpriseVersionSignature = 'Etp40vzjOKAbiLOllzCZugCDkS+TMimkDUeIYigLCZAbIeKTMF7O+OpxiDEO58xfblj7xG2KKqvjej2fSrUcBA==';
$enterpriseVersionLength = 374673225;

//
// stable Qt5 (legacy)
Expand Down Expand Up @@ -138,16 +132,11 @@
'macos' => [
'version' => $stableVersion,
'versionstring' => $stableVersionString,
"fileProviderVersionString" => $stableVersionString,
'downloadurl' => $stableUrl . 'Nextcloud-' . $stableVersion . '.pkg',
'fileProviderDownloadUrl' => $stableUrl . 'Nextcloud-' . $stableVersion . '-macOS-vfs.pkg',
'web' => 'https://nextcloud.com/install',
"sparkleDownloadUrl" => $stableUrl . 'Nextcloud-' . $stableVersion . '.pkg.tbz',
"fileProviderSparkleDownloadUrl" => $stableUrl . 'Nextcloud-' . $stableVersion . '-macOS-vfs.pkg.tbz',
"signature" => $stableVersionSignature,
"length" => $stableVersionLength,
"fileProviderSignature" => $stableVersionFileProviderSignature,
"fileProviderLength" => $stableVersionFileProviderLength,
],
],
'enterprise' => [
Expand All @@ -167,16 +156,11 @@
'macos' => [
'version' => $enterpriseVersion,
'versionstring' => $enterpriseVersionString,
"fileProviderVersionString" => $enterpriseVersionString,
'downloadurl' => $enterpriseUrl . 'Nextcloud-' . $enterpriseVersion . '.pkg',
'fileProviderDownloadUrl' => $enterpriseUrl . 'Nextcloud-' . $enterpriseVersion . '-macOS-vfs.pkg',
'web' => 'https://nextcloud.com/install',
"sparkleDownloadUrl" => $enterpriseUrl . 'Nextcloud-' . $enterpriseVersion . '.pkg.tbz',
"fileProviderSparkleDownloadUrl" => $enterpriseUrl . 'Nextcloud-' . $enterpriseVersion . '-macOS-vfs.pkg.tbz',
"signature" => $enterpriseVersionSignature,
"length" => $enterpriseVersionLength,
"fileProviderSignature" => $enterpriseVersionFileProviderSignature,
"fileProviderLength" => $enterpriseVersionFileProviderLength,
],
],
'beta' => [
Expand All @@ -196,16 +180,11 @@
'macos' => [
'version' => $betaVersionInternal,
'versionstring' => $betaVersionString,
"fileProviderVersionString" => $betaVersionString,
'downloadurl' => $betaUrl . 'Nextcloud-' . $betaVersion . '.pkg',
'fileProviderDownloadUrl' => $betaUrl . 'Nextcloud-' . $betaVersion . '-macOS-vfs.pkg',
'web' => 'https://nextcloud.com/install',
"sparkleDownloadUrl" => $betaUrl . 'Nextcloud-' . $betaVersion . '.pkg.tbz',
"fileProviderSparkleDownloadUrl" => $betaUrl . 'Nextcloud-' . $betaVersion . '-macOS-vfs.pkg.tbz',
"signature" => $betaVersionSignature,
"length" => $betaVersionLength,
"fileProviderSignature" => $betaVersionFileProviderSignature,
"fileProviderLength" => $betaVersionFileProviderLength,
],
],
'daily' => [
Expand Down
2 changes: 0 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
$currentArch = isset($_GET['currentArch']) ? (string)$_GET['currentArch'] : "x86_64";
$version = isset($_GET['version']) ? (string)$_GET['version'] : null;
$isSparkle = isset($_GET['sparkle']) ? true : false;
$isFileProvider = isset($_GET['fileprovider']) ? true : false;
// due to a bug in an old version, the channels were translated. we need to catch them again
$channel = isset($_GET['channel']) && in_array((string)$_GET['channel'], $allowedChannels, true)
? (string)$_GET['channel']
Expand Down Expand Up @@ -105,7 +104,6 @@
$kernelVersion,
$channel,
$isSparkle,
$isFileProvider,
$config
);
echo $response->buildResponse();
12 changes: 4 additions & 8 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class Response {
private $channel;
/** @var bool */
private $isSparkle;
/** @var bool */
private $isFileProvider;
/** @var array */
private $config;

Expand All @@ -38,7 +36,6 @@ public function __construct(string $oem,
string $kernelVersion,
string $channel,
bool $isSparkle,
bool $isFileProvider,
array $config) {
$this->oem = $oem;
$this->platform = $platform;
Expand All @@ -48,7 +45,6 @@ public function __construct(string $oem,
$this->kernelVersion = $kernelVersion;
$this->channel = $channel;
$this->isSparkle = $isSparkle;
$this->isFileProvider = $isFileProvider;
$this->config = $config;
}

Expand Down Expand Up @@ -188,22 +184,22 @@ protected function getCurrentTimeStamp() : string {
* Convenience functions to get specific file provider or standard client update information
*/
private function getSparkleUpdateUrl(array $updateVersion) : string {
$updateUrlKey = $this->isFileProvider ? 'fileProviderSparkleDownloadUrl' : 'sparkleDownloadUrl';
$updateUrlKey = 'sparkleDownloadUrl';
return $updateVersion[$updateUrlKey];
}

private function getSparkleUpdateSignature(array $updateVersion) : string {
$updateSignatureKey = $this->isFileProvider ? 'fileProviderSignature' : 'signature';
$updateSignatureKey = 'signature';
return $updateVersion[$updateSignatureKey];
}

private function getSparkleUpdateLength(array $updateVersion) : int {
$updateLengthKey = $this->isFileProvider ? 'fileProviderLength' : 'length';
$updateLengthKey = 'length';
return $updateVersion[$updateLengthKey];
}

private function getSparkleVersionString(array $updateVersion) : string {
$updateLengthKey = $this->isFileProvider ? 'fileProviderVersionString' : 'versionstring';
$updateLengthKey = 'versionstring';
return $updateVersion[$updateLengthKey];
}

Expand Down
Loading