Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add maximum.supported.desktop.version #41183

Closed
wants to merge 11 commits into from
4 changes: 3 additions & 1 deletion apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ public function beforeHandler(RequestInterface $request) {
}

$minimumSupportedDesktopVersion = $this->config->getSystemValue('minimum.supported.desktop.version', '2.3.0');
$maximumSupportedDesktopVersion = $this->config->getSystemValue('maximum.supported.desktop.version', '3.10.1');
szaimen marked this conversation as resolved.
Show resolved Hide resolved
preg_match(IRequest::USER_AGENT_CLIENT_DESKTOP, $userAgent, $versionMatches);
if (isset($versionMatches[1]) &&
version_compare($versionMatches[1], $minimumSupportedDesktopVersion) === -1) {
version_compare($versionMatches[1], $minimumSupportedDesktopVersion) === -1 ||
version_compare($versionMatches[1], $maximumSupportedDesktopVersion) === 1) {
throw new \Sabre\DAV\Exception\Forbidden('Unsupported client version.');
}
}
Expand Down
11 changes: 11 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -1999,6 +1999,17 @@
*/
'minimum.supported.desktop.version' => '2.3.0',

/**
* The maximum Nextcloud desktop client version that will be allowed to sync with
* this server instance. All connections made from later clients will be denied
* by the server. Defaults to the maximum officially supported Nextcloud desktop
* client version at the time of release of this server version.
*
*
* Defaults to ``3.10.1``
*/
'maximum.supported.desktop.version' => '3.10.1',

/**
* Option to allow local storage to contain symlinks.
* WARNING: Not recommended. This would make it possible for Nextcloud to access
Expand Down