diff --git a/docs/settings.md b/docs/settings.md index b3a1c171ad2..fcacb07f65f 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -95,8 +95,10 @@ Legend: | `samples_directory` | string | | No | | Specify a readable directory that contains other sample conversation data | | `start_calls` | int | `0` | Yes | 🖌️ | Who can start a call, see [constants list](constants.md#start-call) | | `max_call_duration` | int | `0` | No | | Maximum duration of a call in seconds, 0 for unlimited. Federated calls will be terminated based on the setting of the host server. Calls are ended via a background job, so system cron should be used and calls will last a bit longer (until the next execution of the cron). | + | `max_gif_size` | int | `3145728` | No | | Maximum file size for clients to render gifs previews with animation | -| `session-ping-limit` | int | `200` | No | | Number of sessions the HPB can ping in a single request | + +| `session_ping_limit` | int | `200` | No | | Number of sessions the HPB can ping in a single request | | `token_entropy` | int | `8` | No | | Length of conversation tokens, can be increased to make tokens harder to guess but reduces readability and dial-in comfort | | `default_group_notification` | int | `1` | No | 🖌️ | Default notification level for group conversations [constants list](constants.md#participant-notification-levels) (Default changed from 2 (mentions) to 1 (always) in Nextcloud 33 for new installations) | | `default_permissions` | int | `246` | Yes | | Default permissions for non-moderators (see [constants list](constants.md#attendee-permissions) for bit flags) | diff --git a/lib/Capabilities.php b/lib/Capabilities.php index f313ba060ec..761b99cd44b 100644 --- a/lib/Capabilities.php +++ b/lib/Capabilities.php @@ -332,7 +332,7 @@ public function getCapabilities(): array { 'max-gif-size' => $this->appConfig->getAppValueInt(Config::MAX_GIF_SIZE, 3145728), ], 'signaling' => [ - 'session-ping-limit' => max(0, (int)$this->serverConfig->getAppValue('spreed', 'session-ping-limit', '200')), + 'session-ping-limit' => max(0, $this->appConfig->getAppValueInt(Config::SESSION_PING_LIMIT)), 'mode' => $this->talkConfig->getSignalingMode(), // 'hello-v2-token-key' => string, ], diff --git a/lib/Config.php b/lib/Config.php index f394bc3c52d..299855079a1 100644 --- a/lib/Config.php +++ b/lib/Config.php @@ -76,6 +76,7 @@ class Config { public const string MATTERBRIDGE_ENABLED = 'enable_matterbridge'; public const string DELETE_ONE_TO_ONE_CONVERSATIONS = 'delete_one_to_one_conversations'; public const string MAX_GIF_SIZE = 'max_gif_size'; + public const string SESSION_PING_LIMIT = 'session_ping_limit'; /** * 1. Call recording, … diff --git a/lib/ConfigLexicon.php b/lib/ConfigLexicon.php index 0a14e14dd00..cb31e1952b7 100644 --- a/lib/ConfigLexicon.php +++ b/lib/ConfigLexicon.php @@ -65,6 +65,7 @@ public function getAppConfigs(): array { new Entry(Config::MATTERBRIDGE_ENABLED, ValueType::BOOL, false, definition: 'Whether the Matterbridge integration is enabled and can be configured'), new Entry(Config::DELETE_ONE_TO_ONE_CONVERSATIONS, ValueType::BOOL, false, definition: 'Whether one-to-one conversations can be left by either participant or should be deleted when one participant leaves'), new Entry(Config::MAX_GIF_SIZE, ValueType::INT, 3145728, definition: 'Maximum file size for clients to render gifs previews with animation', rename: 'max-gif-size'), + new Entry(Config::SESSION_PING_LIMIT, ValueType::INT, 200, definition: 'Number of sessions the HPB can ping in a single request', rename: 'session-ping-limit'), ]; } diff --git a/tests/php/CapabilitiesTest.php b/tests/php/CapabilitiesTest.php index da3a4fcb8a3..84a43933c94 100644 --- a/tests/php/CapabilitiesTest.php +++ b/tests/php/CapabilitiesTest.php @@ -140,7 +140,6 @@ public function testGetCapabilitiesGuest(): void { ->method('getAppValue') ->willReturnMap([ ['spreed', 'start_calls', (string)Room::START_CALL_EVERYONE, (string)Room::START_CALL_EVERYONE], - ['spreed', 'session-ping-limit', '200', '200'], ['core', 'backgroundjobs_mode', 'ajax', 'cron'], ]); @@ -155,6 +154,7 @@ public function testGetCapabilitiesGuest(): void { ['summary_threshold', 100, 100], ['feature_hints_hidden', 0, 999], ['max_gif_size', 3145728, 200000], + ['session_ping_limit', 200, 200], ]); $this->assertInstanceOf(IPublicCapability::class, $capabilities); @@ -353,7 +353,6 @@ public function testGetCapabilitiesUserAllowed(bool $isNotAllowed, bool $canCrea ->method('getAppValue') ->willReturnMap([ ['spreed', 'start_calls', (string)Room::START_CALL_EVERYONE, (string)Room::START_CALL_NOONE], - ['spreed', 'session-ping-limit', '200', '50'], ['core', 'backgroundjobs_mode', 'ajax', 'cron'], ]); @@ -364,7 +363,7 @@ public function testGetCapabilitiesUserAllowed(bool $isNotAllowed, bool $canCrea ['backgrounds_upload_users', true, true], ]); - $this->appConfig->method('getAppValueInt') + $this->appConfig->expects($this->any())->method('getAppValueInt') ->willReturnMap([ ['max_call_duration', 0, 0], ['retention_event_rooms', 28, 28], @@ -375,6 +374,7 @@ public function testGetCapabilitiesUserAllowed(bool $isNotAllowed, bool $canCrea ['summary_threshold', 100, 100], ['feature_hints_hidden', 0, 1], ['max_gif_size', 3145728, 200000], + ['session_ping_limit', 200, 50], ]); $this->serverConfig->expects($this->any())