Skip to content

Commit

Permalink
fix(hpb): Deprecate multiple HPBs and fake-clustering
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Sep 30, 2024
1 parent f67e2ff commit cfb72e0
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 49 deletions.
4 changes: 2 additions & 2 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
use OCA\Talk\Settings\Personal;
use OCA\Talk\SetupCheck\BackgroundBlurLoading;
use OCA\Talk\SetupCheck\FederationLockCache;
use OCA\Talk\SetupCheck\RecommendCache;
use OCA\Talk\SetupCheck\HighPerformanceBackend;
use OCA\Talk\SetupCheck\RecordingBackend;
use OCA\Talk\SetupCheck\SIPConfiguration;
use OCA\Talk\Share\Listener as ShareListener;
Expand Down Expand Up @@ -338,7 +338,7 @@ public function register(IRegistrationContext $context): void {

$context->registerTeamResourceProvider(TalkTeamResourceProvider::class);

$context->registerSetupCheck(RecommendCache::class);
$context->registerSetupCheck(HighPerformanceBackend::class);
$context->registerSetupCheck(FederationLockCache::class);
$context->registerSetupCheck(RecordingBackend::class);
$context->registerSetupCheck(SIPConfiguration::class);
Expand Down
62 changes: 62 additions & 0 deletions lib/SetupCheck/HighPerformanceBackend.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Talk\SetupCheck;

use OCA\Talk\Config;
use OCP\ICacheFactory;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\SetupCheck\ISetupCheck;
use OCP\SetupCheck\SetupResult;

class HighPerformanceBackend implements ISetupCheck {
public function __construct(
readonly protected Config $talkConfig,
readonly protected ICacheFactory $cacheFactory,
readonly protected IURLGenerator $urlGenerator,
readonly protected IL10N $l,
) {
}

public function getCategory(): string {
return 'talk';
}

public function getName(): string {
return $this->l->t('High-performance backend');
}

public function run(): SetupResult {
if ($this->talkConfig->getSignalingMode() === Config::SIGNALING_INTERNAL) {
return SetupResult::success();
}

if ($this->talkConfig->getSignalingMode() === Config::SIGNALING_CLUSTER_CONVERSATION) {
return SetupResult::warning(
$this->l->t('Running the High-performance backend "conversation_cluster" mode is deprecated and will no longer be supported in the upcoming version. The High-performance backend supports real clustering nowadays which should be used instead.'),
'https://portal.nextcloud.com/article/Partner-Products/Talk-High-Performance-Backend/Nextcloud-Talk-High-Performance-Back-End-Requirements#content-clustering-and-use-of-multiple-hpbs',
);
}

if (count($this->talkConfig->getSignalingServers()) > 1) {
return SetupResult::warning(
$this->l->t('Defining multiple High-performance backends is deprecated and will no longer be supported in the upcoming version. Instead a load-balancer should be set up together with clustered signaling servers and configured in the Talk settings.'),
'https://portal.nextcloud.com/article/Partner-Products/Talk-High-Performance-Backend/Nextcloud-Talk-High-Performance-Back-End-Requirements#content-clustering-and-use-of-multiple-hpbs',
);
}

if ($this->cacheFactory->isAvailable()) {
return SetupResult::success();
}
return SetupResult::warning(
$this->l->t('It is highly recommended to configure a memory cache when running Nextcloud Talk with a High-performance backend.'),
$this->urlGenerator->linkToDocs('admin-cache'),
);
}
}
47 changes: 0 additions & 47 deletions lib/SetupCheck/RecommendCache.php

This file was deleted.

0 comments on commit cfb72e0

Please sign in to comment.