Skip to content

Commit

Permalink
Add maximum.supported.desktop.version
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Grabmeier <flo.grabmeier@gmail.com>
  • Loading branch information
flooxo committed Oct 29, 2023
1 parent fe471da commit a0a7ce6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
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');
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

0 comments on commit a0a7ce6

Please sign in to comment.