diff --git a/docs/developer-setup.md b/docs/developer-setup.md index f32609b1402..60819c0c1a8 100644 --- a/docs/developer-setup.md +++ b/docs/developer-setup.md @@ -175,8 +175,8 @@ The provided `docker-compose.yml` file from `nextcloud-docker-dev` supports spin 6. Enable federation in the admin settings of Nextcloud Talk or alternatively via occ: - ./scripts/occ.sh nextcloud -- config:app:set spreed federation_enabled --value yes - ./scripts/occ.sh nextcloud2 -- config:app:set spreed federation_enabled --value yes + ./scripts/occ.sh nextcloud -- config:app:set spreed federation_enabled --value true --type boolean + ./scripts/occ.sh nextcloud2 -- config:app:set spreed federation_enabled --value true --type boolean ### Rebuild / update Talk after code changes diff --git a/docs/settings.md b/docs/settings.md index 7da758687c5..b0ed1cc270b 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -66,80 +66,80 @@ Legend: * 🖌️ - UI option in the admin settings available * 💻 - Dedicated OCC command available -| Key | Internal type | Default | Hash | Option | Valid values | -|--------------------------------------|------------------------------------------------------------------|-------------|------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `allowed_groups` | string[] | `[]` | Yes | 🖌️ | List of group ids that are allowed to use Talk | -| `sip_bridge_groups` | string[] | `[]` | Yes | 🖌️ | List of group ids that are allowed to enable SIP dial-in in a conversation | -| `start_conversations` | string[] | `[]` | Yes | 🖌️ | List of group ids that are allowed to create conversations | -| `start_calls_groups` | string[] | `[]` | Yes | 🖌️ | List of group ids that are allowed to start calls (everyone when empty). This also applies to moderators; guests and federated users can then never start calls. For federated conversations the host server decides. Others can still chat and join ongoing calls | -| `federation_allowed_groups` | string[] | `[]` | Yes | 🖌️ | 🏗️ *Work in progress:* List of group ids that are allowed to invite federated users into their conversations (everyone when empty) | -| `hosted-signaling-server-account` | array | `{}` | No | 🖌️ | Account information of the hosted signaling server | -| `stun_servers` | array[] | `[]` | Yes | 🖌💻️ | List of STUN servers, should be configured via the web interface or the OCC commands | -| `turn_servers` | array[] | `[]` | Yes | 🖌️💻 | List of TURN servers, should be configured via the web interface or the OCC commands | -| `recording_servers` | array[] | `[]` | Yes | 🖌️ | List of recording servers, should be configured via the web interface | -| `signaling_servers` | array[] | `[]` | Yes | 🖌️💻 | List of signaling servers, should be configured via the web interface or the OCC commands | -| `sip_bridge_dialin_info` | string | | Yes | 🖌️ | Additional information added in the SIP dial-in invitation mail and sidebar | -| `sip_bridge_dialout_anonymous` | bool | false | No | | When set to true, all out-going SIP calls will be anonymous calls (CLIR) | -| `sip_bridge_dialout_number` | string | | No | | Fallback phone number that is used as caller for out-going calls when the user has no phone-number configured (has to be E164 `+49123456789` formatted) | -| `sip_bridge_dialout_prefix` | string | `+` | No | | Prefix that is added before the first configured phone-number of a user to make it a valid E164 number to be used as a caller for out-going calls | -| `sip_bridge_shared_secret` | string | | Yes | 🖌️ | Shared secret allowing the SIP bridge to authenticate on the Nextcloud server | -| `signaling_ticket_secret` | string | | Yes | | Secret used to secure the signaling tickets for guests (255 character random string) | -| `signaling_token_alg` | string
`ES256`, `ES384`, `RS256`, `RS384`, `RS512` or `EdDSA` | `ES256` | Yes | | Algorithm for the signaling tickets | -| `signaling_token_privkey_*` | string | * | Yes | | Private key for the signaling ticket creation by the server | -| `signaling_token_pubkey_*` | string | * | Yes | | Public key for the signaling ticket creation by the server | -| `hosted-signaling-server-nonce` | string | | No | | Temporary nonce while configuring the hosted signaling server | -| `hosted-signaling-server-account-id` | string | | No | | Account identifier of the hosted signaling server | -| `matterbridge_binary` | string | | No | | Path to the matterbridge binary file | -| `bridge_bot_password` | string | | No | | Automatically generated password of the matterbridge bot user profile | -| `default_attachment_folder` | string | `/Talk` | No | | Specify default attachment folder location | -| `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 | -| `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) | -| `recording_consent` | int | `0` | Yes | 🖌️ | Whether users have to agree on being recorded before they can join the call (see [constants](constants.md#recording-consent-required)) | -| `grid_videos_limit` | int | `19` | No | | Maximum number of videos to show (additional to the own video) | -| `sip_dialin_default` | int | `0` | No | | Default value of SIP dial-in when creating new conversations | -| `retention_event_rooms` | int | `28` | No | | Retention period of event conversations in days (`0` means no-retention) | -| `retention_phone_rooms` | int | `7` | No | | Retention period of phone dial-in and dial-out conversations in days (`0` means no-retention) | -| `retention_instant_meetings` | int | `1` | No | | Retention period of instant meetings in days (`0` means no-retention) | -| `experiments_users` | int | `0` | Yes | | Bit flag of experiments that should be enabled for logged-in users on this server (see [Experiments](#experiments) below) | -| `experiments_guests` | int | `0` | Yes | | Bit flag of experiments that should be enabled for guests on this server (see [Experiments](#experiments) below) | -| `summary_threshold` | int | `100` | No | | Amount of unread messages a user needs before they see the option to summarize with AI | -| `feature_hints_hidden` | int | `0` | Yes | 🖌️ | Feature hints that should be hidden. Set to `999999` to hide all. | -| `certificate_expiration_days` | int | `10` | No | | Minimum days a certificate needs to be valid for, before ae expiration notification will be shown. (default 10, minimum 0 and maximum 365) | -| `grid_videos_limit_enforced` | string
`yes` or `no` | `no` | No | | Whether the number of grid videos should be enforced | -| `changelog` | string
`yes` or `no` | `yes` | No | | Whether the changelog conversation is updated with new features on major releases | -| `hide_signaling_warning` | string
`yes` or `no` | `no` | No | 🖌️ | Flag that allows to suppress the warning that an HPB should be configured | +| Key | Internal type | Default | Hash | Option | Valid values | +|--------------------------------------|------------------------------------------------------------------|------------|------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `allowed_groups` | array | `[]` | Yes | 🖌️ | List of group ids that are allowed to use Talk | +| `sip_bridge_groups` | array | `[]` | Yes | 🖌️ | List of group ids that are allowed to enable SIP dial-in in a conversation | +| `start_conversations` | array | `[]` | Yes | 🖌️ | List of group ids that are allowed to create conversations | +| `start_calls_groups` | array | `[]` | Yes | 🖌️ | List of group ids that are allowed to start calls (everyone when empty). This also applies to moderators; guests and federated users can then never start calls. For federated conversations the host server decides. Others can still chat and join ongoing calls | +| `federation_allowed_groups` | array | `[]` | Yes | 🖌️ | 🏗️ *Work in progress:* List of group ids that are allowed to invite federated users into their conversations (everyone when empty) | +| `hosted-signaling-server-account` | array | `{}` | No | 🖌️ | Account information of the hosted signaling server | +| `stun_servers` | array[] | `[]` | Yes | 🖌💻️ | List of STUN servers, should be configured via the web interface or the OCC commands | +| `turn_servers` | array[] | `[]` | Yes | 🖌️💻 | List of TURN servers, should be configured via the web interface or the OCC commands | +| `recording_servers` | array[] | `[]` | Yes | 🖌️ | List of recording servers, should be configured via the web interface | +| `signaling_servers` | array[] | `[]` | Yes | 🖌️💻 | List of signaling servers, should be configured via the web interface or the OCC commands | +| `sip_bridge_dialin_info` | string | | Yes | 🖌️ | Additional information added in the SIP dial-in invitation mail and sidebar | +| `sip_bridge_dialout_anonymous` | bool | false | No | | When set to true, all out-going SIP calls will be anonymous calls (CLIR) | +| `sip_bridge_dialout_number` | string | | No | | Fallback phone number that is used as caller for out-going calls when the user has no phone-number configured (has to be E164 `+49123456789` formatted) | +| `sip_bridge_dialout_prefix` | string | `+` | No | | Prefix that is added before the first configured phone-number of a user to make it a valid E164 number to be used as a caller for out-going calls | +| `sip_bridge_shared_secret` | string | | Yes | 🖌️ | Shared secret allowing the SIP bridge to authenticate on the Nextcloud server | +| `signaling_ticket_secret` | string | | Yes | | Secret used to secure the signaling tickets for guests (255 character random string) | +| `signaling_token_alg` | string
`ES256`, `ES384`, `RS256`, `RS384`, `RS512` or `EdDSA` | `ES256` | Yes | | Algorithm for the signaling tickets | +| `signaling_token_privkey_*` | string | * | Yes | | Private key for the signaling ticket creation by the server | +| `signaling_token_pubkey_*` | string | * | Yes | | Public key for the signaling ticket creation by the server | +| `hosted-signaling-server-nonce` | string | | No | | Temporary nonce while configuring the hosted signaling server | +| `hosted-signaling-server-account-id` | string | | No | | Account identifier of the hosted signaling server | +| `matterbridge_binary` | string | | No | | Path to the matterbridge binary file | +| `bridge_bot_password` | string | | No | | Automatically generated password of the matterbridge bot user profile | +| `default_attachment_folder` | string | `/Talk` | No | | Specify default attachment folder location | +| `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 | +| `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) | +| `recording_consent` | int | `0` | Yes | 🖌️ | Whether users have to agree on being recorded before they can join the call (see [constants](constants.md#recording-consent-required)) | +| `grid_videos_limit` | int | `19` | No | | Maximum number of videos to show (additional to the own video) | +| `sip_dialin_default` | int | `0` | No | | Default value of SIP dial-in when creating new conversations | +| `retention_event_rooms` | int | `28` | No | | Retention period of event conversations in days (`0` means no-retention) | +| `retention_phone_rooms` | int | `7` | No | | Retention period of phone dial-in and dial-out conversations in days (`0` means no-retention) | +| `retention_instant_meetings` | int | `1` | No | | Retention period of instant meetings in days (`0` means no-retention) | +| `experiments_users` | int | `0` | Yes | | Bit flag of experiments that should be enabled for logged-in users on this server (see [Experiments](#experiments) below) | +| `experiments_guests` | int | `0` | Yes | | Bit flag of experiments that should be enabled for guests on this server (see [Experiments](#experiments) below) | +| `summary_threshold` | int | `100` | No | | Amount of unread messages a user needs before they see the option to summarize with AI | +| `feature_hints_hidden` | int | `0` | Yes | 🖌️ | Feature hints that should be hidden. Set to `999999` to hide all. | +| `certificate_expiration_days` | int | `10` | No | | Minimum days a certificate needs to be valid for, before ae expiration notification will be shown. (default 10, minimum 0 and maximum 365) | +| `grid_videos_limit_enforced` | string
`yes` or `no` | `no` | No | | Whether the number of grid videos should be enforced | +| `changelog` | string
`yes` or `no` | `yes` | No | | Whether the changelog conversation is updated with new features on major releases | +| `hide_signaling_warning` | string
`yes` or `no` | `no` | No | 🖌️ | Flag that allows to suppress the warning that an HPB should be configured | | `conversations_list_style` | string
`two-lines` or `compact` | `two-lines` | No | | Default conversation list style when not overwritten by the user | -| `chat_style` | string
`split` or `unified` | `split` | No | | Default chat style when not overwritten by the user | -| `calls_start_without_media` | string
`yes` or `no` | `no` | Yes | | Whether participants start with enabled or disabled audio and video by default | -| `breakout_rooms` | bool | true | Yes | | Whether or not breakout rooms are allowed (Will only prevent creating new breakout rooms. Existing conversations are not modified.) | -| `call_recording` | string
`yes` or `no` | `yes` | Yes | | Enable call recording | -| `call_recording_summary` | string
`yes` or `no` | `yes` | No | 🖌️ | Whether call recordings should automatically be summarized when a transcription and summary provider is enabled. | -| `call_recording_transcription` | string
`yes` or `no` | `no` | No | | Whether call recordings should automatically be transcribed when a transcription provider is enabled. | -| `sip_dialout` | string
`yes` or `no` | `no` | Yes | | SIP dial-out is allowed when a SIP bridge is configured | -| `federation_enabled` | bool | false | Yes | | 🏗️ *Work in progress:* Whether or not federation with this instance is allowed | -| `federation_incoming_enabled` | string
`1` or `0` | `1` | Yes | | 🏗️ *Work in progress:* Whether users of this instance can be invited to federated conversations | -| `federation_outgoing_enabled` | string
`1` or `0` | `1` | Yes | | 🏗️ *Work in progress:* Whether users of this instance can invite federated users into conversations | -| `federation_only_trusted_servers` | string
`1` or `0` | `0` | Yes | | 🏗️ *Work in progress:* Whether federation should be limited to the list of "Trusted servers" | -| `federation_allowed_groups` | string[] | `[]` | Yes | 🖌️ | List of local group ids that are allowed to use federated features | -| `conversations_files` | string
`1` or `0` | `1` | No | 🖌️ | Whether the files app integration is enabled allowing to start conversations in the right sidebar | -| `conversations_files_public_shares` | string
`1` or `0` | `1` | No | 🖌️ | Whether the public share integration is enabled allowing to start conversations in the right sidebar on the public share page (Requires `conversations_files` also to be enabled) | -| `delete_one_to_one_conversations` | string
`1` or `0` | `0` | No | ️ | Whether one-to-one conversations can be left by either participant or should be deleted when one participant leaves | -| `enable_matterbridge` | string
`1` or `0` | `0` | No | 🖌️ | Whether the Matterbridge integration is enabled and can be configured | -| `force_passwords` | string
`1` or `0` | `0` | No | ️ | Whether public chats are forced to use a password | -| `create_samples` | string
`1` or `0` | `1` | No | ️ | Create sample conversations (the content can be overwritten by providing files in a provided `samples_directory` app config) | -| `call_end_to_end_encryption` | string
`1` or `0` | `0` | No | 🖌️ | Whether clients should end-to-end encrypt streams in calls (Only supported with High-performance backend) | -| `inactivity_lock_after_days` | int | `0` | No | | A duration (in days) after which rooms are locked. Calculated from the last activity in the room. | -| `inactivity_enable_lobby` | string
`1` or `0` | `0` | No | | Additionally enable the lobby for inactive rooms so they can only be read by moderators. | -| `backgrounds_branded_for_guests` | string
`1` or `0` | `0` | No | | Whether guests are allowed to use the virtual backgrounds provided via `themes/talk-backgrounds/` | -| `backgrounds_default_for_users` | string
`1` or `0` | `1` | No | | Whether users are allowed to use the default virtual backgrounds provided by the releases | -| `backgrounds_upload_users` | string
`1` or `0` | `1` | No | | Whether users are allowed to upload custom virtual backgrounds and choose from their Nextcloud Files | -| `guests_play_sounds` | string
`1` or `0` | `1` | No | | Whether guests hear the join and leave sounds by default | +| `chat_style` | string
`split` or `unified` | `split` | No | | Default chat style when not overwritten by the user | +| `calls_start_without_media` | string
`yes` or `no` | `no` | Yes | | Whether participants start with enabled or disabled audio and video by default | +| `breakout_rooms` | bool | true | Yes | | Whether or not breakout rooms are allowed (Will only prevent creating new breakout rooms. Existing conversations are not modified.) | +| `call_recording` | string
`yes` or `no` | `yes` | Yes | | Enable call recording | +| `call_recording_summary` | string
`yes` or `no` | `yes` | No | 🖌️ | Whether call recordings should automatically be summarized when a transcription and summary provider is enabled. | +| `call_recording_transcription` | string
`yes` or `no` | `no` | No | | Whether call recordings should automatically be transcribed when a transcription provider is enabled. | +| `sip_dialout` | string
`yes` or `no` | `no` | Yes | | SIP dial-out is allowed when a SIP bridge is configured | +| `federation_enabled` | bool | false | Yes | | 🏗️ *Work in progress:* Whether or not federation with this instance is allowed | +| `federation_incoming_enabled` | bool | `true` | Yes | | 🏗️ *Work in progress:* Whether users of this instance can be invited to federated conversations | +| `federation_outgoing_enabled` | bool | `true` | Yes | | 🏗️ *Work in progress:* Whether users of this instance can invite federated users into conversations | +| `federation_only_trusted_servers` | bool | `false` | Yes | | 🏗️ *Work in progress:* Whether federation should be limited to the list of "Trusted servers" | +| `federation_allowed_groups` | array | `[]` | Yes | 🖌️ | List of local group ids that are allowed to use federated features | +| `conversations_files` | string
`1` or `0` | `1` | No | 🖌️ | Whether the files app integration is enabled allowing to start conversations in the right sidebar | +| `conversations_files_public_shares` | string
`1` or `0` | `1` | No | 🖌️ | Whether the public share integration is enabled allowing to start conversations in the right sidebar on the public share page (Requires `conversations_files` also to be enabled) | +| `delete_one_to_one_conversations` | string
`1` or `0` | `0` | No | ️ | Whether one-to-one conversations can be left by either participant or should be deleted when one participant leaves | +| `enable_matterbridge` | string
`1` or `0` | `0` | No | 🖌️ | Whether the Matterbridge integration is enabled and can be configured | +| `force_passwords` | string
`1` or `0` | `0` | No | ️ | Whether public chats are forced to use a password | +| `create_samples` | string
`1` or `0` | `1` | No | ️ | Create sample conversations (the content can be overwritten by providing files in a provided `samples_directory` app config) | +| `call_end_to_end_encryption` | string
`1` or `0` | `0` | No | 🖌️ | Whether clients should end-to-end encrypt streams in calls (Only supported with High-performance backend) | +| `inactivity_lock_after_days` | int | `0` | No | | A duration (in days) after which rooms are locked. Calculated from the last activity in the room. | +| `inactivity_enable_lobby` | string
`1` or `0` | `0` | No | | Additionally enable the lobby for inactive rooms so they can only be read by moderators. | +| `backgrounds_branded_for_guests` | string
`1` or `0` | `0` | No | | Whether guests are allowed to use the virtual backgrounds provided via `themes/talk-backgrounds/` | +| `backgrounds_default_for_users` | string
`1` or `0` | `1` | No | | Whether users are allowed to use the default virtual backgrounds provided by the releases | +| `backgrounds_upload_users` | string
`1` or `0` | `1` | No | | Whether users are allowed to upload custom virtual backgrounds and choose from their Nextcloud Files | +| `guests_play_sounds` | string
`1` or `0` | `1` | No | | Whether guests hear the join and leave sounds by default | ## Experiments diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 07722efbe87..66588122c39 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -138,6 +138,7 @@ use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; +use OCP\AppFramework\Services\IAppConfig; use OCP\Calendar\Events\CalendarObjectCreatedEvent; use OCP\Calendar\Events\CalendarObjectUpdatedEvent; use OCP\Collaboration\AutoComplete\AutoCompleteFilterEvent; @@ -152,7 +153,6 @@ use OCP\Group\Events\GroupDeletedEvent; use OCP\Group\Events\UserAddedEvent; use OCP\Group\Events\UserRemovedEvent; -use OCP\IConfig; use OCP\INavigationManager; use OCP\IURLGenerator; use OCP\IUser; @@ -433,10 +433,10 @@ public function registerNavigationLink(INavigationManager $navigationManager): v } public function registerCloudFederationProviderManager( - IConfig $config, + IAppConfig $appConfig, ICloudFederationProviderManager $manager, ): void { - if ($config->getAppValue('spreed', 'federation_enabled', 'no') !== 'yes') { + if (!$appConfig->getAppValueBool(Config::FEDERATION_ENABLED)) { return; } diff --git a/lib/Capabilities.php b/lib/Capabilities.php index 32bb10bf069..517c2a807b1 100644 --- a/lib/Capabilities.php +++ b/lib/Capabilities.php @@ -359,9 +359,9 @@ public function getCapabilities(): array { if ($this->talkConfig->isFederationEnabled() && $this->talkConfig->isFederationEnabledForUserId($user)) { $capabilities['config']['federation'] = [ 'enabled' => true, - 'incoming-enabled' => $this->appConfig->getAppValueBool('federation_incoming_enabled', true), - 'outgoing-enabled' => $this->appConfig->getAppValueBool('federation_outgoing_enabled', true), - 'only-trusted-servers' => $this->appConfig->getAppValueBool('federation_only_trusted_servers'), + 'incoming-enabled' => $this->appConfig->getAppValueBool(Config::FEDERATION_INCOMING_ENABLED), + 'outgoing-enabled' => $this->appConfig->getAppValueBool(Config::FEDERATION_OUTGOING_ENABLED), + 'only-trusted-servers' => $this->appConfig->getAppValueBool(Config::FEDERATION_ONLY_TRUSTED_SERVERS), ]; } diff --git a/lib/Config.php b/lib/Config.php index a80f20b7b1d..ad8694811da 100644 --- a/lib/Config.php +++ b/lib/Config.php @@ -42,6 +42,11 @@ class Config { public const string ALLOWED_GROUPS_TALK = 'allowed_groups'; public const string ALLOWED_GROUPS_SIP = 'sip_bridge_groups'; public const string ALLOWED_GROUPS_CONVERSATIONS = 'start_conversations'; + public const string ALLOWED_GROUPS_FEDERATION = 'federation_allowed_groups'; + public const string FEDERATION_ENABLED = 'federation_enabled'; + public const string FEDERATION_INCOMING_ENABLED = 'federation_incoming_enabled'; + public const string FEDERATION_OUTGOING_ENABLED = 'federation_outgoing_enabled'; + public const string FEDERATION_ONLY_TRUSTED_SERVERS = 'federation_only_trusted_servers'; public const string BREAKOUT_ROOMS_ENABLED = 'breakout_rooms'; public const string CONVERSATION_SUBFOLDERS = 'conversation_subfolders'; public const string DEFAULT_ROOM_PERMISSIONS = 'default_permissions'; @@ -128,11 +133,11 @@ public function isSIPConfigured(): bool { */ public function isFederationEnabled(): bool { // TODO: Set to default true once implementation is complete - return $this->config->getAppValue('spreed', 'federation_enabled', 'no') === 'yes'; + return $this->appConfig->getAppValueBool(self::FEDERATION_ENABLED); } public function isFederationEnabledForUserId(IUser $user): bool { - $allowedGroups = $this->appConfig->getAppValueArray('federation_allowed_groups', lazy: true); + $allowedGroups = $this->appConfig->getAppValueArray(self::ALLOWED_GROUPS_FEDERATION, lazy: true); if (empty($allowedGroups)) { return true; } diff --git a/lib/ConfigLexicon.php b/lib/ConfigLexicon.php index 8338ad1c108..17661fafcd6 100644 --- a/lib/ConfigLexicon.php +++ b/lib/ConfigLexicon.php @@ -31,6 +31,11 @@ public function getAppConfigs(): array { new Entry(Config::ALLOWED_GROUPS_TALK, ValueType::ARRAY, [], definition: 'List of group ids that are allowed to use Talk'), new Entry(Config::ALLOWED_GROUPS_SIP, ValueType::ARRAY, [], definition: 'List of group ids that are allowed to enable SIP dial-in in a conversation'), new Entry(Config::ALLOWED_GROUPS_CONVERSATIONS, ValueType::ARRAY, [], definition: 'List of group ids that are allowed to create conversation'), + new Entry(Config::ALLOWED_GROUPS_FEDERATION, ValueType::ARRAY, [], definition: 'List of local group ids that are allowed to use federated features'), + new Entry(Config::FEDERATION_ENABLED, ValueType::BOOL, false, definition: 'Whether or not federation with this instance is allowed'), + new Entry(Config::FEDERATION_INCOMING_ENABLED, ValueType::BOOL, true, definition: 'Whether users of this instance can be invited to federated conversations'), + new Entry(Config::FEDERATION_OUTGOING_ENABLED, ValueType::BOOL, true, definition: 'Whether users of this instance can invite federated users into conversations'), + new Entry(Config::FEDERATION_ONLY_TRUSTED_SERVERS, ValueType::BOOL, false, definition: 'Whether federation should be limited to the list of "Trusted servers"'), new Entry(Config::BREAKOUT_ROOMS_ENABLED, ValueType::BOOL, true, definition: 'Whether or not breakout rooms are allowed (Will only prevent creating new breakout rooms. Existing conversations are not modified.'), new Entry(Config::CONVERSATION_SUBFOLDERS, ValueType::BOOL, true, definition: ''), new Entry(Config::DEFAULT_ROOM_PERMISSIONS, ValueType::INT, 246, definition: 'Default permissions for non-moderators (see [constants list](constants.md#attendee-permissions) for bit flags)'), diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 5df874e8739..87eb90e9b67 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -191,7 +191,7 @@ protected function getTalkHashHeader(): array { implode(',', $this->appConfig->getAppValueArray(Config::ALLOWED_GROUPS_CONVERSATIONS)), $this->appConfig->getAppValueInt(Config::DEFAULT_ROOM_PERMISSIONS), $this->appConfig->getAppValueBool(Config::BREAKOUT_ROOMS_ENABLED), - $this->config->getAppValue('spreed', 'federation_enabled'), + $this->appConfig->getAppValueBool(Config::FEDERATION_ENABLED), $this->config->getAppValue('spreed', 'enable_matterbridge'), implode(',', $this->appConfig->getAppValueArray(Config::ALLOWED_GROUPS_SIP)), $this->config->getAppValue('spreed', 'sip_bridge_dialin_info'), @@ -201,10 +201,10 @@ protected function getTalkHashHeader(): array { $this->config->getAppValue('spreed', 'call_recording_summary'), $this->config->getAppValue('theming', 'cachebuster', '1'), $this->config->getUserValue($this->userId, 'theming', 'userCacheBuster', '0'), - $this->config->getAppValue('spreed', 'federation_incoming_enabled'), - $this->config->getAppValue('spreed', 'federation_outgoing_enabled'), - $this->config->getAppValue('spreed', 'federation_only_trusted_servers'), - $this->config->getAppValue('spreed', 'federation_allowed_groups', '[]'), + $this->appConfig->getAppValueBool(Config::FEDERATION_INCOMING_ENABLED), + $this->appConfig->getAppValueBool(Config::FEDERATION_OUTGOING_ENABLED), + $this->appConfig->getAppValueBool(Config::FEDERATION_ONLY_TRUSTED_SERVERS), + implode(',', $this->appConfig->getAppValueArray(Config::ALLOWED_GROUPS_FEDERATION)), $this->appConfig->getAppValueInt('feature_hints_hidden'), ]; diff --git a/lib/Settings/Admin/AdminSettings.php b/lib/Settings/Admin/AdminSettings.php index 92487c9cf9e..03eb2e908b8 100644 --- a/lib/Settings/Admin/AdminSettings.php +++ b/lib/Settings/Admin/AdminSettings.php @@ -91,10 +91,10 @@ protected function initAllowedGroups(): void { protected function initFederation(): void { $this->initialState->provideInitialState('federation_enabled', $this->talkConfig->isFederationEnabled()); - $this->initialState->provideInitialState('federation_incoming_enabled', $this->appConfig->getAppValueBool('federation_incoming_enabled', true)); - $this->initialState->provideInitialState('federation_outgoing_enabled', $this->appConfig->getAppValueBool('federation_outgoing_enabled', true)); - $this->initialState->provideInitialState('federation_only_trusted_servers', $this->appConfig->getAppValueBool('federation_only_trusted_servers')); - $this->initialState->provideInitialState('federation_allowed_groups', $this->appConfig->getAppValueArray('federation_allowed_groups')); + $this->initialState->provideInitialState('federation_incoming_enabled', $this->appConfig->getAppValueBool(Config::FEDERATION_INCOMING_ENABLED)); + $this->initialState->provideInitialState('federation_outgoing_enabled', $this->appConfig->getAppValueBool(Config::FEDERATION_OUTGOING_ENABLED)); + $this->initialState->provideInitialState('federation_only_trusted_servers', $this->appConfig->getAppValueBool(Config::FEDERATION_ONLY_TRUSTED_SERVERS)); + $this->initialState->provideInitialState('federation_allowed_groups', $this->appConfig->getAppValueArray(Config::ALLOWED_GROUPS_FEDERATION)); } protected function initMatterbridge(): void { diff --git a/tests/integration/features/federation/call.feature b/tests/integration/features/federation/call.feature index 6389dd0aec1..cc2e6d40506 100644 --- a/tests/integration/features/federation/call.feature +++ b/tests/integration/features/federation/call.feature @@ -4,11 +4,11 @@ Feature: federation/call Given using server "REMOTE" And user "participant2" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | And using server "LOCAL" And user "participant1" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | Scenario: join call Given user "participant1" creates room "room" (v4) diff --git a/tests/integration/features/federation/chat.feature b/tests/integration/features/federation/chat.feature index 53a0cc2896b..b968396dbd0 100644 --- a/tests/integration/features/federation/chat.feature +++ b/tests/integration/features/federation/chat.feature @@ -4,13 +4,13 @@ Feature: federation/chat And user "participant2" exists And user "participant3" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | And using server "LOCAL" Given user "participant1" exists Given user "participant2" exists Given user "participant3" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | Scenario: Get mention suggestions (translating local users to federated users) Given user "participant1" creates room "room" (v4) diff --git a/tests/integration/features/federation/invite.feature b/tests/integration/features/federation/invite.feature index fb790965c96..b12d790e679 100644 --- a/tests/integration/features/federation/invite.feature +++ b/tests/integration/features/federation/invite.feature @@ -3,15 +3,15 @@ Feature: federation/invite Given using server "REMOTE" Given user "participant2" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | Given using server "LOCAL" Given user "participant1" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | Scenario: Federation is disabled Given the following "spreed" app config is set - | federation_enabled | no | + | federation_enabled | false | Given user "participant1" creates room "room" (v4) | roomType | 3 | | roomName | room | diff --git a/tests/integration/features/federation/join-leave.feature b/tests/integration/features/federation/join-leave.feature index 9f376f71505..25f3a1829c0 100644 --- a/tests/integration/features/federation/join-leave.feature +++ b/tests/integration/features/federation/join-leave.feature @@ -4,11 +4,11 @@ Feature: federation/join-leave Given using server "REMOTE" And user "participant2" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | And using server "LOCAL" And user "participant1" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | Scenario: join a group room Given user "participant1" creates room "room" (v4) diff --git a/tests/integration/features/federation/lobby.feature b/tests/integration/features/federation/lobby.feature index 0b70e9688d6..d7a766beba4 100644 --- a/tests/integration/features/federation/lobby.feature +++ b/tests/integration/features/federation/lobby.feature @@ -4,11 +4,11 @@ Feature: federation/lobby Given using server "REMOTE" And user "participant2" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | And using server "LOCAL" And user "participant1" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | Scenario: set lobby state Given user "participant1" creates room "room" (v4) diff --git a/tests/integration/features/federation/ocm.feature b/tests/integration/features/federation/ocm.feature index debf1f47252..4f30855e20e 100644 --- a/tests/integration/features/federation/ocm.feature +++ b/tests/integration/features/federation/ocm.feature @@ -1,14 +1,14 @@ Feature: federation/ocm Scenario: Check that the OCM resource is not registered when federation is disabled Given the following "spreed" app config is set - | federation_enabled | no | + | federation_enabled | false | Then OCM provider does not have the following resource types | name | shareTypes | protocols | | talk-room | ["user"] | {"talk-v1":"/ocs/v2.php/apps/spreed/api/"} | Scenario: Check that the OCM resource is registered when federation is enabled Given the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | Given OCM provider has the following resource types | name | shareTypes | protocols | | talk-room | ["user"] | {"talk-v1":"/ocs/v2.php/apps/spreed/api/"} | diff --git a/tests/integration/features/federation/permissions.feature b/tests/integration/features/federation/permissions.feature index 054c413b4b7..83d110a46c1 100644 --- a/tests/integration/features/federation/permissions.feature +++ b/tests/integration/features/federation/permissions.feature @@ -4,11 +4,11 @@ Feature: federation/permissions Given using server "REMOTE" And user "participant2" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | And using server "LOCAL" And user "participant1" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | @skip33 Scenario: set participant permissions diff --git a/tests/integration/features/federation/poll.feature b/tests/integration/features/federation/poll.feature index e2392a03d51..35f993c308d 100644 --- a/tests/integration/features/federation/poll.feature +++ b/tests/integration/features/federation/poll.feature @@ -3,15 +3,15 @@ Feature: federation/poll Given using server "REMOTE" And user "participant2" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | And using server "LOCAL" Given user "participant1" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | Scenario: Create a public poll without max votes limit Given the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | Given user "participant1" creates room "room" (v4) | roomType | 2 | | roomName | room | diff --git a/tests/integration/features/federation/reminder.feature b/tests/integration/features/federation/reminder.feature index 11dd19153c1..8aae51c20e4 100644 --- a/tests/integration/features/federation/reminder.feature +++ b/tests/integration/features/federation/reminder.feature @@ -3,11 +3,11 @@ Feature: federation/reminder Given using server "REMOTE" And user "participant2" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | And using server "LOCAL" Given user "participant1" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | Scenario: Get mention suggestions (translating local users to federated users) Given user "participant1" creates room "room" (v4) diff --git a/tests/integration/features/federation/user-statuses.feature b/tests/integration/features/federation/user-statuses.feature index 9232f033bd9..56ecb78254d 100644 --- a/tests/integration/features/federation/user-statuses.feature +++ b/tests/integration/features/federation/user-statuses.feature @@ -5,11 +5,11 @@ Feature: federation/user-statuses And user "participant2" exists And user "participant3" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | And using server "LOCAL" And user "participant1" exists And the following "spreed" app config is set - | federation_enabled | yes | + | federation_enabled | true | Scenario: User statuses are added to the participant request in federated conversations Given user "participant1" creates room "room" (v4)