From 46015fdfb0115f3dec6373f090cc8968c71c3fce Mon Sep 17 00:00:00 2001 From: timo Date: Fri, 30 Oct 2026 20:42:19 +0100 Subject: [PATCH 01/18] Store OIDC subject identifier of users Save the sub claim in users.oidc_sub at every OIDC login. The column is hidden from serialization. --- app/Auth/OIDC/OIDCProvider.php | 3 ++ app/Models/User.php | 2 +- ..._30_000000_add_oidc_sub_to_users_table.php | 30 +++++++++++ tests/Backend/Feature/api/v1/OIDCTest.php | 50 +++++++++++++++++++ 4 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2026_10_30_000000_add_oidc_sub_to_users_table.php diff --git a/app/Auth/OIDC/OIDCProvider.php b/app/Auth/OIDC/OIDCProvider.php index 2101c45b12..37c870d5bb 100644 --- a/app/Auth/OIDC/OIDCProvider.php +++ b/app/Auth/OIDC/OIDCProvider.php @@ -87,6 +87,9 @@ public function login(Request $request): User // Get eloquent user (existing or new) $user = $oidc_user->createOrFindEloquentModel('oidc'); + // Store the subject identifier, it is used to identify the user in external services + $user->oidc_sub = $user_info['sub']; + // Sync attributes $oidc_user->syncWithEloquentModel($user, config('services.oidc.mapping')->roles); diff --git a/app/Models/User.php b/app/Models/User.php index 7940c509e0..91ecdbc2be 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -43,7 +43,7 @@ class User extends Authenticatable implements HasLocalePreference * @var array */ protected $hidden = [ - 'password', 'remember_token', + 'password', 'remember_token', 'oidc_sub', ]; /** diff --git a/database/migrations/2026_10_30_000000_add_oidc_sub_to_users_table.php b/database/migrations/2026_10_30_000000_add_oidc_sub_to_users_table.php new file mode 100644 index 0000000000..5b3a069f1e --- /dev/null +++ b/database/migrations/2026_10_30_000000_add_oidc_sub_to_users_table.php @@ -0,0 +1,30 @@ +string('oidc_sub', 255)->nullable()->after('external_id'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('oidc_sub'); + }); + } +}; diff --git a/tests/Backend/Feature/api/v1/OIDCTest.php b/tests/Backend/Feature/api/v1/OIDCTest.php index 05a67675e6..cbfb865d3c 100644 --- a/tests/Backend/Feature/api/v1/OIDCTest.php +++ b/tests/Backend/Feature/api/v1/OIDCTest.php @@ -1027,6 +1027,56 @@ public function test_callback_with_existing_user() $this->assertEquals($user->roles()->pluck('name')->toArray(), ['admin', 'user']); } + /** + * Log in via the fake OIDC server with the given subject identifier + */ + private function loginWithSubject(string $sub): void + { + $nonce = Str::random(); + $state = Str::random(); + + $userInfoClaims = [ + 'sub' => $sub, + 'given_name' => 'Ada', + 'family_name' => 'Testperson', + 'email' => 'ada.testperson@example.org', + 'groups' => ['student'], + ]; + + $this->fake_oidc_server($sub, $this->faker->uuid(), $nonce, $userInfoClaims); + + Session::put('openid_connect_state', $state); + Session::put('openid_connect_nonce', $nonce); + + $this->get(route('auth.oidc.callback', [ + 'code' => Str::random(), + 'state' => $state, + ])); + } + + public function test_callback_stores_oidc_sub_for_new_user() + { + $this->loginWithSubject('fixture-sub-ada-0001'); + + $this->assertAuthenticated(); + $this->assertEquals('fixture-sub-ada-0001', Auth::user()->oidc_sub); + $this->assertEquals('fixture-sub-ada-0001', Auth::user()->fresh()->oidc_sub); + } + + public function test_callback_updates_oidc_sub_of_existing_user() + { + $user = User::factory()->create([ + 'authenticator' => 'oidc', + 'external_id' => 'fixture-sub-ada-0001', + 'oidc_sub' => 'fixture-sub-stale-0000', + ]); + + $this->loginWithSubject('fixture-sub-ada-0001'); + + $this->assertAuthenticatedAs($user); + $this->assertEquals('fixture-sub-ada-0001', $user->fresh()->oidc_sub); + } + public function test_callback_with_user_info_unsigned() { // Create a new RSA key pair for signing the ID token From 1fc96a179a791c42635ee9e6cc3b5ff9bece7f2e Mon Sep 17 00:00:00 2001 From: timo Date: Fri, 30 Oct 2026 20:42:19 +0100 Subject: [PATCH 02/18] Add meeting summary room setting and room type fields Add the non-expert room setting recap, which only the room owner can change and which is only available if the feature is enabled and the owner has an OIDC subject. Room types can set a default and enforce it off, but not on. Room types get a meeting type and a sink name for the summaries. Custom create parameters must not contain the reserved meta parameters of the summaries. --- .env.example | 6 + .../Controllers/api/v1/RoomTypeController.php | 6 + app/Http/Requests/RoomTypeRequest.php | 8 + .../Requests/UpdateRoomSettingsRequest.php | 11 ++ app/Http/Resources/ConfigResource.php | 3 + app/Http/Resources/RoomSettingsResource.php | 1 + app/Http/Resources/RoomTypeResource.php | 2 + app/Models/Room.php | 13 ++ app/Policies/RoomPolicy.php | 9 + app/Rules/CustomCreateMeetingParameters.php | 10 + config/recap.php | 8 + ...0_000001_add_recap_to_room_types_table.php | 33 ++++ ..._10_30_000002_add_recap_to_rooms_table.php | 30 +++ lang/ar/admin.php | 7 + lang/ar/rooms.php | 2 + lang/ar/validation.php | 13 ++ lang/de-gender/admin.php | 7 + lang/de-gender/rooms.php | 2 + lang/de-gender/validation.php | 13 ++ lang/de/admin.php | 7 + lang/de/rooms.php | 2 + lang/de/validation.php | 13 ++ lang/en/admin.php | 7 + lang/en/rooms.php | 2 + lang/en/validation.php | 13 ++ lang/fa/admin.php | 7 + lang/fa/rooms.php | 2 + lang/fa/validation.php | 13 ++ lang/fr/admin.php | 7 + lang/fr/rooms.php | 2 + lang/fr/validation.php | 13 ++ .../Feature/api/v1/Room/RoomRecapTest.php | 186 ++++++++++++++++++ .../Backend/Feature/api/v1/Room/RoomTest.php | 4 +- .../Feature/api/v1/RoomTypeRecapTest.php | 153 ++++++++++++++ tests/Backend/Feature/api/v1/RoomTypeTest.php | 4 + 35 files changed, 618 insertions(+), 1 deletion(-) create mode 100644 config/recap.php create mode 100644 database/migrations/2026_10_30_000001_add_recap_to_room_types_table.php create mode 100644 database/migrations/2026_10_30_000002_add_recap_to_rooms_table.php create mode 100644 tests/Backend/Feature/api/v1/Room/RoomRecapTest.php create mode 100644 tests/Backend/Feature/api/v1/RoomTypeRecapTest.php diff --git a/.env.example b/.env.example index 6996bc6703..3b6485857c 100644 --- a/.env.example +++ b/.env.example @@ -83,6 +83,12 @@ MAIL_FROM_NAME="${APP_NAME}" #OIDC_CLIENT_SECRET= #OIDC_SCOPES=profile,email +# Meeting summaries (recap) +# Master switch for the room setting and the room type fields +#RECAP_ENABLED=false +# Prefix of the BBB meta parameters (meta_-*), must match the recording exporter +#RECAP_META_PREFIX=recap + # Enabled locales # Comma separated list, e.g. de,en # If unset all available locales are enabled (lang + resources/custom/lang) diff --git a/app/Http/Controllers/api/v1/RoomTypeController.php b/app/Http/Controllers/api/v1/RoomTypeController.php index 9f4a50c0c3..f088c3e5f4 100644 --- a/app/Http/Controllers/api/v1/RoomTypeController.php +++ b/app/Http/Controllers/api/v1/RoomTypeController.php @@ -112,6 +112,9 @@ public function update(RoomTypeRequest $request, RoomType $roomType) $roomType->has_access_code_default = $request->has_access_code_default; $roomType->has_access_code_enforced = $request->has_access_code_enforced; + $roomType->recap_type = $request->recap_type; + $roomType->recap_sink = $request->recap_sink; + $roomType->save(); if ($roomType->restrict) { @@ -148,6 +151,9 @@ public function store(RoomTypeRequest $request) $roomType->has_access_code_default = $request->has_access_code_default; $roomType->has_access_code_enforced = $request->has_access_code_enforced; + $roomType->recap_type = $request->recap_type; + $roomType->recap_sink = $request->recap_sink; + $roomType->save(); if ($roomType->restrict) { diff --git a/app/Http/Requests/RoomTypeRequest.php b/app/Http/Requests/RoomTypeRequest.php index 3182711768..59a7256072 100644 --- a/app/Http/Requests/RoomTypeRequest.php +++ b/app/Http/Requests/RoomTypeRequest.php @@ -37,6 +37,14 @@ public function rules() $rules[$setting.'_enforced'] = ['required', 'boolean']; } + // Meeting summaries (recap) can only be enforced off, never on + $rules['recap_default'][] = 'declined_if:recap_enforced,true'; + + // Meeting type and sink of the summaries, required if the room type offers summaries + $recapOffered = config('recap.enabled') && ! $this->boolean('recap_enforced'); + $rules['recap_type'] = [Rule::requiredIf($recapOffered), 'nullable', 'string', 'regex:/^[a-z][a-z0-9-]{0,62}$/']; + $rules['recap_sink'] = [Rule::requiredIf($recapOffered), 'nullable', 'string', 'regex:/^[a-z][a-z0-9-]{0,62}$/']; + if ($this->roomType) { $rules['name'] = ['required', 'string', 'max:255', Rule::unique('room_types', 'name')->ignore($this->roomType->id)]; } diff --git a/app/Http/Requests/UpdateRoomSettingsRequest.php b/app/Http/Requests/UpdateRoomSettingsRequest.php index 8d50976d0d..637edb58be 100644 --- a/app/Http/Requests/UpdateRoomSettingsRequest.php +++ b/app/Http/Requests/UpdateRoomSettingsRequest.php @@ -11,6 +11,17 @@ class UpdateRoomSettingsRequest extends FormRequest { + /** + * Keep the current recap setting if the user is not allowed to change it + * or if the feature is not available for the room. + */ + protected function prepareForValidation(): void + { + if (! $this->room->isRecapAvailable() || ! $this->user()->can('manageRecap', $this->room)) { + $this->merge(['recap' => $this->room->recap]); + } + } + public function rules() { $rules = [ diff --git a/app/Http/Resources/ConfigResource.php b/app/Http/Resources/ConfigResource.php index a0f495113b..9681b4f46b 100644 --- a/app/Http/Resources/ConfigResource.php +++ b/app/Http/Resources/ConfigResource.php @@ -108,6 +108,9 @@ public function toArray($request) 'refresh_interval' => config('streaming.refresh_interval'), 'show_fps' => config('streaming.show_fps'), ], + 'recap' => [ + 'enabled' => config('recap.enabled'), + ], 'auth' => [ 'local' => config('auth.local.enabled'), 'ldap' => config('ldap.enabled'), diff --git a/app/Http/Resources/RoomSettingsResource.php b/app/Http/Resources/RoomSettingsResource.php index 6c1851f1dd..9a667c662e 100644 --- a/app/Http/Resources/RoomSettingsResource.php +++ b/app/Http/Resources/RoomSettingsResource.php @@ -36,6 +36,7 @@ public function toArray($request) 'short_description' => $this->short_description, 'access_code' => $this->access_code, 'room_type' => (new RoomTypeResource($this->roomType))->withDefaultRoomSettings()->withFeatures(), + 'recap_available' => $this->isRecapAvailable(), $this->merge($this->getRoomSettings()), ]; } diff --git a/app/Http/Resources/RoomTypeResource.php b/app/Http/Resources/RoomTypeResource.php index ebc2917748..901cd3db69 100644 --- a/app/Http/Resources/RoomTypeResource.php +++ b/app/Http/Resources/RoomTypeResource.php @@ -103,6 +103,8 @@ public function toArray($request) 'max_duration' => $this->max_duration, 'create_parameters' => $this->create_parameters, 'join_parameters' => $this->join_parameters, + 'recap_type' => $this->recap_type, + 'recap_sink' => $this->recap_sink, 'roles' => new RoleResourceCollection($this->roles), ]), diff --git a/app/Models/Room.php b/app/Models/Room.php index ce6469ff54..404716a296 100644 --- a/app/Models/Room.php +++ b/app/Models/Room.php @@ -122,6 +122,10 @@ protected function casts() 'cast' => 'boolean', 'expert' => true, ], + 'recap' => [ + 'cast' => 'boolean', + 'expert' => false, + ], ]; /** @@ -402,6 +406,15 @@ public function getRoomSetting(string $settingName) return $this->roomType[$settingName.'_default']; } + /** + * Indicates whether the meeting summary (recap) can be activated for this room. + * Requires the feature to be enabled and the room owner to have logged in via OIDC (stored subject). + */ + public function isRecapAvailable(): bool + { + return config('recap.enabled') && ! empty($this->owner->oidc_sub); + } + /** * Returns true if the passed owner has rights to create a room * with the passed room type. diff --git a/app/Policies/RoomPolicy.php b/app/Policies/RoomPolicy.php index a40566e284..15598f356b 100644 --- a/app/Policies/RoomPolicy.php +++ b/app/Policies/RoomPolicy.php @@ -130,6 +130,15 @@ public function update(User $user, Room $room) return $room->owner->is($user) || $room->isCoOwner($user) || $user->can('rooms.manage'); } + /** + * Determine whether the user can change the meeting summary (recap) setting of the room. + * Only the room owner can opt in, as the summary is delivered to the owner. + */ + public function manageRecap(User $user, Room $room): bool + { + return $room->owner->is($user); + } + /** * Determine whether the user can transfer the room ownership * diff --git a/app/Rules/CustomCreateMeetingParameters.php b/app/Rules/CustomCreateMeetingParameters.php index e0e823151c..e81bdad372 100644 --- a/app/Rules/CustomCreateMeetingParameters.php +++ b/app/Rules/CustomCreateMeetingParameters.php @@ -8,6 +8,7 @@ use BigBlueButton\Parameters\CreateMeetingParameters; use Closure; use Illuminate\Contracts\Validation\ValidationRule; +use Illuminate\Support\Str; use Illuminate\Translation\PotentiallyTranslatedString; class CustomCreateMeetingParameters implements ValidationRule @@ -24,5 +25,14 @@ public function validate(string $attribute, mixed $value, Closure $fail): void foreach ($errors as $error) { $fail($error); } + + // Meta parameters of the meeting summary (recap) are reserved, they are set per room by the application + $reservedPrefix = 'meta_'.Str::lower(config('recap.meta_prefix')).'-'; + foreach (preg_split('/\n|\r\n?/', $value) as $createParameter) { + $parameter = trim(explode('=', $createParameter, 2)[0]); + if (Str::startsWith(Str::lower($parameter), $reservedPrefix)) { + $fail(__('validation.custom_parameter_reserved', ['parameter' => $parameter])); + } + } } } diff --git a/config/recap.php b/config/recap.php new file mode 100644 index 0000000000..1fa1b503ef --- /dev/null +++ b/config/recap.php @@ -0,0 +1,8 @@ + (bool) env('RECAP_ENABLED', false), + 'meta_prefix' => env('RECAP_META_PREFIX', 'recap'), +]; diff --git a/database/migrations/2026_10_30_000001_add_recap_to_room_types_table.php b/database/migrations/2026_10_30_000001_add_recap_to_room_types_table.php new file mode 100644 index 0000000000..d67711fa97 --- /dev/null +++ b/database/migrations/2026_10_30_000001_add_recap_to_room_types_table.php @@ -0,0 +1,33 @@ +boolean('recap_default')->default(false); + $table->boolean('recap_enforced')->default(false); + $table->string('recap_type', 63)->nullable(); + $table->string('recap_sink', 63)->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('room_types', function (Blueprint $table) { + $table->dropColumn(['recap_default', 'recap_enforced', 'recap_type', 'recap_sink']); + }); + } +}; diff --git a/database/migrations/2026_10_30_000002_add_recap_to_rooms_table.php b/database/migrations/2026_10_30_000002_add_recap_to_rooms_table.php new file mode 100644 index 0000000000..63744e06a4 --- /dev/null +++ b/database/migrations/2026_10_30_000002_add_recap_to_rooms_table.php @@ -0,0 +1,30 @@ +boolean('recap')->default(false); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('rooms', function (Blueprint $table) { + $table->dropColumn('recap'); + }); + } +}; diff --git a/lang/ar/admin.php b/lang/ar/admin.php index 999af0c1d7..c28379d6e4 100644 --- a/lang/ar/admin.php +++ b/lang/ar/admin.php @@ -182,6 +182,13 @@ 'no_data' => 'لم يتم العثور على أنواع غرف!', 'no_data_filtered' => 'لم يتم العثور على أنواع غرف لمعايير البحث المحددة!', 'preview' => 'معاينة', + 'recap' => [ + 'enforced_hint' => 'يمكن فرض إيقاف ملخصات الاجتماعات فقط.', + 'sink' => 'وجهة الملخص', + 'sink_description' => 'اسم الوجهة التي تُسلَّم إليها الملخصات. أحرف لاتينية صغيرة وأرقام وشرطات.', + 'type' => 'نوع الاجتماع', + 'type_description' => 'اسم نوع الاجتماع الذي يحدد قالب الملخص. أحرف لاتينية صغيرة وأرقام وشرطات.', + ], 'restrict' => 'تقييد الاستخدام', 'restrict_description' => 'سيتم تقييد استخدام نوع الغرفة هذا والخوادم المرتبطة به للأدوار المحددة.', 'select_roles' => 'اختيار الأدوار', diff --git a/lang/ar/rooms.php b/lang/ar/rooms.php index f5d610e26f..1b901aa4f2 100644 --- a/lang/ar/rooms.php +++ b/lang/ar/rooms.php @@ -426,6 +426,8 @@ ], 'recordings' => [ 'auto_start_recording' => 'بدء التسجيل تلقائيًا', + 'recap' => 'إنشاء ملخص للاجتماع (ذكاء اصطناعي)', + 'recap_unavailable' => 'متاح بعد تسجيل دخولك مرة واحدة عبر OpenID Connect.', 'record_attendance' => 'تسجيل حضور المشاركين', 'record_video_conference' => 'تسجيل مؤتمر الفيديو', 'title' => 'التسجيلات', diff --git a/lang/ar/validation.php b/lang/ar/validation.php index d6b4f09047..c361e5d50e 100644 --- a/lang/ar/validation.php +++ b/lang/ar/validation.php @@ -118,6 +118,9 @@ 'per_page' => 'عدد السجلات في الصفحة', 'permissions' => 'الصلاحيات', 'phone' => 'الهاتف', + 'recap' => 'ملخص الاجتماع', + 'recap_sink' => 'وجهة الملخص', + 'recap_type' => 'نوع الاجتماع للملخص', 'recording_attendance_retention_period' => 'فترة الاحتفاظ بسجلات الحضور بالأيام', 'recording_meeting_usage_enabled' => 'تسجيل بيانات استخدام الاجتماعات', 'recording_meeting_usage_retention_period' => 'فترة الاحتفاظ ببيانات استخدام الاجتماعات بالأيام', @@ -218,6 +221,15 @@ 'in' => 'اللغة المختارة غير مدعومة من الخادم.', ], 'password' => 'يجب أن تحتوي كلمة المرور على حرف واحد على الأقل من كل فئة من الفئات التالية: حرف كبير (A - Z)، حرف صغير (a - z)، رقم (0 - 9)، رمز خاص (مثال: !، $، #، أو %).', + 'recap_default' => [ + 'declined_if' => 'يمكن فرض إيقاف ملخصات الاجتماعات فقط، وليس تشغيلها.', + ], + 'recap_sink' => [ + 'regex' => 'يجب أن يحتوي :attribute على أحرف لاتينية صغيرة وأرقام وشرطات فقط، وأن يبدأ بحرف، وألا يتجاوز 63 حرفًا.', + ], + 'recap_type' => [ + 'regex' => 'يجب أن يحتوي :attribute على أحرف لاتينية صغيرة وأرقام وشرطات فقط، وأن يبدأ بحرف، وألا يتجاوز 63 حرفًا.', + ], 'replacement_room_type' => [ 'exists' => 'نوع الغرفة البديل غير صالح! مطلوب نوع غرفة بديل لأن هناك غرفًا لا تزال مرتبطة بهذا النوع.', 'not_in' => 'نوع الغرفة البديل غير صالح! مطلوب نوع غرفة بديل لأن هناك غرفًا لا تزال مرتبطة بهذا النوع.', @@ -273,6 +285,7 @@ 'custom_parameter_invalid' => 'قيمة المعامل :parameter غير صالحة.', 'custom_parameter_missing' => 'المعامل :parameter يفتقد قيمة.', 'custom_parameter_not_found' => 'المعامل :parameter غير موجود.', + 'custom_parameter_reserved' => 'المعامل :parameter محجوز ولا يمكن تعيينه هنا.', 'date' => ':attribute ليس تاريخًا صالحًا.', 'date_equals' => ':attribute يجب أن يكون تاريخًا مساويًا لـ :date.', 'date_format' => ':attribute لا يتطابق مع التنسيق :format.', diff --git a/lang/de-gender/admin.php b/lang/de-gender/admin.php index 0be7863175..5838313b93 100644 --- a/lang/de-gender/admin.php +++ b/lang/de-gender/admin.php @@ -182,6 +182,13 @@ 'no_data' => 'Es sind keine Raumarten vorhanden!', 'no_data_filtered' => 'Für die Suchanfrage wurden keine Raumarten gefunden!', 'preview' => 'Vorschau', + 'recap' => [ + 'enforced_hint' => 'Besprechungszusammenfassungen können nur ausgeschaltet erzwungen werden.', + 'sink' => 'Ziel der Zusammenfassung', + 'sink_description' => 'Name des Ziels, an das die Zusammenfassungen geliefert werden. Kleinbuchstaben, Ziffern und Bindestriche.', + 'type' => 'Besprechungsart', + 'type_description' => 'Name der Besprechungsart, die die Vorlage der Zusammenfassung bestimmt. Kleinbuchstaben, Ziffern und Bindestriche.', + ], 'restrict' => 'Verwendung einschränken', 'restrict_description' => 'Die Verwendung dieser Raumart und der dazugehörigen Server wird nur für die nachfolgend angegebenen Rollen gestattet.', 'select_roles' => 'Rollen auswählen', diff --git a/lang/de-gender/rooms.php b/lang/de-gender/rooms.php index c89374ae33..3cf90f782e 100644 --- a/lang/de-gender/rooms.php +++ b/lang/de-gender/rooms.php @@ -432,6 +432,8 @@ ], 'recordings' => [ 'auto_start_recording' => 'Automatischer Aufnahmestart', + 'recap' => 'Zusammenfassung der Besprechung erstellen (KI)', + 'recap_unavailable' => 'Verfügbar, nachdem Sie sich einmal per OpenID Connect angemeldet haben.', 'record_attendance' => 'Anwesenheit der Teilnehmer protokollieren', 'record_video_conference' => 'Videokonferenz aufzeichnen', 'title' => 'Aufzeichnungen', diff --git a/lang/de-gender/validation.php b/lang/de-gender/validation.php index 0efefc5276..98efddf1e8 100644 --- a/lang/de-gender/validation.php +++ b/lang/de-gender/validation.php @@ -118,6 +118,9 @@ 'per_page' => 'Einträge pro Seite', 'permissions' => 'Rechte', 'phone' => 'Telefonnummer', + 'recap' => 'Besprechungszusammenfassung', + 'recap_sink' => 'Ziel der Zusammenfassung', + 'recap_type' => 'Besprechungsart der Zusammenfassung', 'recording_attendance_retention_period' => 'Speicherdauer der Anwesenheitsprotokollierung in Tagen', 'recording_meeting_usage_enabled' => 'Auslastung der Meetings aufzeichnen', 'recording_meeting_usage_retention_period' => 'Speicherdauer der Meetingauslastung in Tagen', @@ -218,6 +221,15 @@ 'in' => 'Die gewählte Sprache wird vom Server nicht unterstützt.', ], 'password' => 'Das Passwort muss mindestens ein Zeichen aus jeder der folgenden vier Kategorien enthalten: Großbuchstabe (A - Z), Kleinbuchstaben (a - z), Zahl (0 - 9), nicht alphanumerisches Zeichen (zum Beispiel: !, $, #, oder %).', + 'recap_default' => [ + 'declined_if' => 'Besprechungszusammenfassungen können nur ausgeschaltet erzwungen werden, nicht eingeschaltet.', + ], + 'recap_sink' => [ + 'regex' => 'Das Feld :attribute darf nur Kleinbuchstaben, Ziffern und Bindestriche enthalten, muss mit einem Buchstaben beginnen und darf höchstens 63 Zeichen lang sein.', + ], + 'recap_type' => [ + 'regex' => 'Das Feld :attribute darf nur Kleinbuchstaben, Ziffern und Bindestriche enthalten, muss mit einem Buchstaben beginnen und darf höchstens 63 Zeichen lang sein.', + ], 'replacement_room_type' => [ 'exists' => 'Ersatzraumart ungültig! Es wird eine Ersatzraumart benötigt, da dieser Raumart noch Räume zugeordnet sind.', 'not_in' => 'Ersatzraumart ungültig! Es wird eine Ersatzraumart benötigt, da dieser Raumart noch Räume zugeordnet sind.', @@ -273,6 +285,7 @@ 'custom_parameter_invalid' => 'Der Wert des Parameters :parameter ist ungültig.', 'custom_parameter_missing' => 'Dem Parameter :parameter fehlt ein Wert.', 'custom_parameter_not_found' => 'Der Parameter :parameter existiert nicht.', + 'custom_parameter_reserved' => 'Der Parameter :parameter ist reserviert und kann hier nicht gesetzt werden.', 'date' => ':attribute muss ein gültiges Datum sein.', 'date_equals' => ':attribute muss ein Datum gleich :date sein.', 'date_format' => ':attribute entspricht nicht dem gültigen Format für :format.', diff --git a/lang/de/admin.php b/lang/de/admin.php index 49abe5c9e2..c94ee3cf46 100644 --- a/lang/de/admin.php +++ b/lang/de/admin.php @@ -184,6 +184,13 @@ 'no_data' => 'Es sind keine Raumarten vorhanden!', 'no_data_filtered' => 'Für die Suchanfrage wurden keine Raumarten gefunden!', 'preview' => 'Vorschau', + 'recap' => [ + 'enforced_hint' => 'Besprechungszusammenfassungen können nur ausgeschaltet erzwungen werden.', + 'sink' => 'Ziel der Zusammenfassung', + 'sink_description' => 'Name des Ziels, an das die Zusammenfassungen geliefert werden. Kleinbuchstaben, Ziffern und Bindestriche.', + 'type' => 'Besprechungsart', + 'type_description' => 'Name der Besprechungsart, die die Vorlage der Zusammenfassung bestimmt. Kleinbuchstaben, Ziffern und Bindestriche.', + ], 'restrict' => 'Verwendung einschränken', 'restrict_description' => 'Die Verwendung dieser Raumart und der dazugehörigen Server wird nur für die nachfolgend angegebenen Rollen gestattet.', 'search_aria' => 'Raumarten suchen', diff --git a/lang/de/rooms.php b/lang/de/rooms.php index db0ce131d7..ac9d28466c 100644 --- a/lang/de/rooms.php +++ b/lang/de/rooms.php @@ -487,6 +487,8 @@ ], 'recordings' => [ 'auto_start_recording' => 'Automatischer Aufzeichnungsstart', + 'recap' => 'Zusammenfassung der Besprechung erstellen (KI)', + 'recap_unavailable' => 'Verfügbar, nachdem Sie sich einmal per OpenID Connect angemeldet haben.', 'record_attendance' => 'Anwesenheit der Teilnehmer protokollieren', 'record_video_conference' => 'Videokonferenz aufzeichnen', 'title' => 'Aufzeichnungen', diff --git a/lang/de/validation.php b/lang/de/validation.php index 13f070b74f..65c23bbbbf 100644 --- a/lang/de/validation.php +++ b/lang/de/validation.php @@ -118,6 +118,9 @@ 'per_page' => 'Einträge pro Seite', 'permissions' => 'Rechte', 'phone' => 'Telefonnummer', + 'recap' => 'Besprechungszusammenfassung', + 'recap_sink' => 'Ziel der Zusammenfassung', + 'recap_type' => 'Besprechungsart der Zusammenfassung', 'recording_attendance_retention_period' => 'Speicherdauer der Anwesenheitsprotokollierung in Tagen', 'recording_meeting_usage_enabled' => 'Auslastung der Meetings aufzeichnen', 'recording_meeting_usage_retention_period' => 'Speicherdauer der Meetingauslastung in Tagen', @@ -218,6 +221,15 @@ 'in' => 'Die gewählte Sprache wird vom Server nicht unterstützt.', ], 'password' => 'Das Passwort muss mindestens ein Zeichen aus jeder der folgenden vier Kategorien enthalten: Großbuchstabe (A - Z), Kleinbuchstaben (a - z), Zahl (0 - 9), nicht alphanumerisches Zeichen (zum Beispiel: !, $, #, oder %).', + 'recap_default' => [ + 'declined_if' => 'Besprechungszusammenfassungen können nur ausgeschaltet erzwungen werden, nicht eingeschaltet.', + ], + 'recap_sink' => [ + 'regex' => 'Das Feld :attribute darf nur Kleinbuchstaben, Ziffern und Bindestriche enthalten, muss mit einem Buchstaben beginnen und darf höchstens 63 Zeichen lang sein.', + ], + 'recap_type' => [ + 'regex' => 'Das Feld :attribute darf nur Kleinbuchstaben, Ziffern und Bindestriche enthalten, muss mit einem Buchstaben beginnen und darf höchstens 63 Zeichen lang sein.', + ], 'replacement_room_type' => [ 'exists' => 'Ersatzraumart ungültig! Es wird eine Ersatzraumart benötigt, da dieser Raumart noch Räume zugeordnet sind.', 'not_in' => 'Ersatzraumart ungültig! Es wird eine Ersatzraumart benötigt, da dieser Raumart noch Räume zugeordnet sind.', @@ -273,6 +285,7 @@ 'custom_parameter_invalid' => 'Der Wert des Parameters :parameter ist ungültig.', 'custom_parameter_missing' => 'Für den Parameter :parameter fehlt ein Wert.', 'custom_parameter_not_found' => 'Der Parameter :parameter ist nicht vorhanden.', + 'custom_parameter_reserved' => 'Der Parameter :parameter ist reserviert und kann hier nicht gesetzt werden.', 'date' => ':attribute muss ein gültiges Datum sein.', 'date_equals' => ':attribute muss ein Datum gleich :date sein.', 'date_format' => ':attribute entspricht nicht dem gültigen Format für :format.', diff --git a/lang/en/admin.php b/lang/en/admin.php index aed5e4d799..7d1c57b578 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -184,6 +184,13 @@ 'no_data' => 'No room types found!', 'no_data_filtered' => 'For the filter query no room types were found!', 'preview' => 'Preview', + 'recap' => [ + 'enforced_hint' => 'Meeting summaries can only be enforced off.', + 'sink' => 'Summary destination', + 'sink_description' => 'Name of the destination the summaries are delivered to. Lowercase letters, digits and hyphens.', + 'type' => 'Meeting type', + 'type_description' => 'Name of the meeting type that selects the summary template. Lowercase letters, digits and hyphens.', + ], 'restrict' => 'Restrict usage', 'restrict_description' => 'The usage of this room type and the corresponding servers will be restricted to the selected roles.', 'search_aria' => 'Search room types', diff --git a/lang/en/rooms.php b/lang/en/rooms.php index a589a54415..89631e8be1 100644 --- a/lang/en/rooms.php +++ b/lang/en/rooms.php @@ -487,6 +487,8 @@ ], 'recordings' => [ 'auto_start_recording' => 'Automatic recording start', + 'recap' => 'Create a meeting summary (AI)', + 'recap_unavailable' => 'Available after you have logged in once via OpenID Connect.', 'record_attendance' => 'Log attendance of participants', 'record_video_conference' => 'Record video conference', 'title' => 'Recordings', diff --git a/lang/en/validation.php b/lang/en/validation.php index ead0a02820..a90d0552be 100644 --- a/lang/en/validation.php +++ b/lang/en/validation.php @@ -118,6 +118,9 @@ 'per_page' => 'Entries per page', 'permissions' => 'Permissions', 'phone' => 'Phone', + 'recap' => 'Meeting summary', + 'recap_sink' => 'Summary destination', + 'recap_type' => 'Summary meeting type', 'recording_attendance_retention_period' => 'Retention period of the attendance logging in days', 'recording_meeting_usage_enabled' => 'Record utilisation of meetings', 'recording_meeting_usage_retention_period' => 'Retention period of the meeting utilisation in days', @@ -218,6 +221,15 @@ 'in' => 'The selected language isn\'t supported by the server.', ], 'password' => 'The password must contain at least one character from each of the following four categories: Uppercase letter (A - Z), lowercase letter (a - z), number (0 - 9), non-alphanumeric character (for example: !, $, #, or %).', + 'recap_default' => [ + 'declined_if' => 'Meeting summaries can only be enforced off, not on.', + ], + 'recap_sink' => [ + 'regex' => 'The :attribute may only contain lowercase letters, digits and hyphens, must start with a letter and be at most 63 characters long.', + ], + 'recap_type' => [ + 'regex' => 'The :attribute may only contain lowercase letters, digits and hyphens, must start with a letter and be at most 63 characters long.', + ], 'replacement_room_type' => [ 'exists' => 'Replacement room type invalid! A replacement room type is required because rooms are still assigned to this room type.', 'not_in' => 'Replacement room type invalid! A replacement room type is required because rooms are still assigned to this room type.', @@ -273,6 +285,7 @@ 'custom_parameter_invalid' => 'The :parameter parameter value is invalid.', 'custom_parameter_missing' => 'The :parameter parameter is missing a value.', 'custom_parameter_not_found' => 'The :parameter parameter does not exist.', + 'custom_parameter_reserved' => 'The :parameter parameter is reserved and cannot be set here.', 'date' => 'The :attribute is not a valid date.', 'date_equals' => 'The :attribute must be a date equal to :date.', 'date_format' => 'The :attribute does not match the format :format.', diff --git a/lang/fa/admin.php b/lang/fa/admin.php index 01dd9ba0b2..f0d48db751 100644 --- a/lang/fa/admin.php +++ b/lang/fa/admin.php @@ -182,6 +182,13 @@ 'no_data' => 'هیچ نوع اتاقی یافت نشد!', 'no_data_filtered' => 'برای این پرس‌وجوی فیلتر، هیچ نوع اتاقی یافت نشد!', 'preview' => 'پیش‌نمایش', + 'recap' => [ + 'enforced_hint' => 'خلاصه‌های جلسه فقط می‌توانند به‌صورت غیرفعال اجباری شوند.', + 'sink' => 'مقصد خلاصه', + 'sink_description' => 'نام مقصدی که خلاصه‌ها به آن تحویل داده می‌شوند. حروف کوچک لاتین، ارقام و خط تیره.', + 'type' => 'نوع جلسه', + 'type_description' => 'نام نوع جلسه که قالب خلاصه را انتخاب می‌کند. حروف کوچک لاتین، ارقام و خط تیره.', + ], 'restrict' => 'محدود کردن استفاده', 'restrict_description' => 'استفاده از این نوع اتاق و سرورهای مربوطه به نقش‌های انتخاب‌شده محدود می‌شود.', 'select_roles' => 'انتخاب نقش‌ها', diff --git a/lang/fa/rooms.php b/lang/fa/rooms.php index e24d33124b..a3e6c7b17f 100644 --- a/lang/fa/rooms.php +++ b/lang/fa/rooms.php @@ -426,6 +426,8 @@ ], 'recordings' => [ 'auto_start_recording' => 'شروع خودکار ضبط', + 'recap' => 'ایجاد خلاصه جلسه (هوش مصنوعی)', + 'recap_unavailable' => 'پس از یک بار ورود از طریق OpenID Connect در دسترس است.', 'record_attendance' => 'ثبت حضور شرکت‌کنندگان', 'record_video_conference' => 'ضبط کنفرانس ویدئویی', 'title' => 'ضبط‌ها', diff --git a/lang/fa/validation.php b/lang/fa/validation.php index 29c4ea1002..719db8a931 100644 --- a/lang/fa/validation.php +++ b/lang/fa/validation.php @@ -118,6 +118,9 @@ 'per_page' => 'ورودی در هر صفحه', 'permissions' => 'مجوزها', 'phone' => 'تلفن', + 'recap' => 'خلاصه جلسه', + 'recap_sink' => 'مقصد خلاصه', + 'recap_type' => 'نوع جلسه برای خلاصه', 'recording_attendance_retention_period' => 'مدت نگهداری ثبت حضور (روز)', 'recording_meeting_usage_enabled' => 'ثبت استفاده از جلسات', 'recording_meeting_usage_retention_period' => 'مدت نگهداری استفاده از جلسات (روز)', @@ -218,6 +221,15 @@ 'in' => 'زبان انتخاب شده توسط سرور پشتیبانی نمی‌شود.', ], 'password' => 'رمز عبور باید حداقل شامل یک کاراکتر از هر یک از چهار دسته زیر باشد: حروف بزرگ (A - Z)، حروف کوچک (a - z)، اعداد (0 - 9)، کاراکترهای غیر الفبایی-عددی (مثل: !, $, #, یا %).', + 'recap_default' => [ + 'declined_if' => 'خلاصه‌های جلسه فقط می‌توانند به‌صورت غیرفعال اجباری شوند.', + ], + 'recap_sink' => [ + 'regex' => ':attribute فقط می‌تواند شامل حروف کوچک لاتین، ارقام و خط تیره باشد، باید با یک حرف شروع شود و حداکثر 63 نویسه داشته باشد.', + ], + 'recap_type' => [ + 'regex' => ':attribute فقط می‌تواند شامل حروف کوچک لاتین، ارقام و خط تیره باشد، باید با یک حرف شروع شود و حداکثر 63 نویسه داشته باشد.', + ], 'replacement_room_type' => [ 'exists' => 'نوع اتاق جایگزین نامعتبر است! به دلیل اختصاص اتاق‌ها به این نوع، نیاز به نوع اتاق جایگزین است.', 'not_in' => 'نوع اتاق جایگزین نامعتبر است! به دلیل اختصاص اتاق‌ها به این نوع، نیاز به نوع اتاق جایگزین است.', @@ -273,6 +285,7 @@ 'custom_parameter_invalid' => 'مقدار پارامتر :parameter نامعتبر است.', 'custom_parameter_missing' => 'پارامتر :parameter مقدار ندارد.', 'custom_parameter_not_found' => 'پارامتر :parameter وجود ندارد.', + 'custom_parameter_reserved' => 'پارامتر :parameter رزرو شده است و در اینجا قابل تنظیم نیست.', 'date' => 'فیلد :attribute تاریخ معتبری نیست.', 'date_equals' => 'فیلد :attribute باید تاریخی برابر با :date باشد.', 'date_format' => 'فیلد :attribute با فرمت :format مطابقت ندارد.', diff --git a/lang/fr/admin.php b/lang/fr/admin.php index 3ba19a5a9e..4b4b36ae17 100644 --- a/lang/fr/admin.php +++ b/lang/fr/admin.php @@ -184,6 +184,13 @@ 'no_data' => 'Aucun type de salle trouvé!', 'no_data_filtered' => 'Aucune salle existante avec ces filtres de recherche !', 'preview' => 'Aperçu', + 'recap' => [ + 'enforced_hint' => 'Les résumés de réunion peuvent seulement être imposés comme désactivés.', + 'sink' => 'Destination du résumé', + 'sink_description' => 'Nom de la destination à laquelle les résumés sont livrés. Lettres minuscules, chiffres et tirets.', + 'type' => 'Type de réunion', + 'type_description' => 'Nom du type de réunion qui sélectionne le modèle de résumé. Lettres minuscules, chiffres et tirets.', + ], 'restrict' => 'Restreindre l\'utilisation', 'restrict_description' => 'L\'utilisation de ce type de salle et des serveurs correspondants sera limitée aux rôles sélectionnés.', 'search_aria' => 'Rechercher des types de salles', diff --git a/lang/fr/rooms.php b/lang/fr/rooms.php index 8f82911394..9e5cd2e87a 100644 --- a/lang/fr/rooms.php +++ b/lang/fr/rooms.php @@ -487,6 +487,8 @@ ], 'recordings' => [ 'auto_start_recording' => 'Enregistrement automatique au démarrage', + 'recap' => 'Créer un résumé de la réunion (IA)', + 'recap_unavailable' => 'Disponible après votre première connexion via OpenID Connect.', 'record_attendance' => 'Enregistrer l\'historique des présences', 'record_video_conference' => 'Enregistrer la vidéo conférence', 'title' => 'Enregistrements', diff --git a/lang/fr/validation.php b/lang/fr/validation.php index d31c667175..d4d0dd7c8e 100644 --- a/lang/fr/validation.php +++ b/lang/fr/validation.php @@ -118,6 +118,9 @@ 'per_page' => 'Entrées par page', 'permissions' => 'Permissions', 'phone' => 'Téléphone', + 'recap' => 'Résumé de la réunion', + 'recap_sink' => 'Destination du résumé', + 'recap_type' => 'Type de réunion du résumé', 'recording_attendance_retention_period' => 'Nombre de jours de rétention de l\'historique des présences', 'recording_meeting_usage_enabled' => 'Enregistrer les statistiques des salles', 'recording_meeting_usage_retention_period' => 'Nombre de jours de rétention des statistiques des salles', @@ -218,6 +221,15 @@ 'in' => 'La langue sélectionné n\'est pas supportée par le serveur.', ], 'password' => 'Le mot de passe doit contenir au moins un caractère de chacune des quatre catégories suivantes : lettre majuscule (A-Z), lettre minuscule (a-z), chiffre (0-9), caractère non alphanumérique (par exemple : !, $ , #, ou %).', + 'recap_default' => [ + 'declined_if' => 'Les résumés de réunion peuvent seulement être imposés comme désactivés.', + ], + 'recap_sink' => [ + 'regex' => 'Le champ :attribute ne peut contenir que des lettres minuscules, des chiffres et des tirets, doit commencer par une lettre et comporter au plus 63 caractères.', + ], + 'recap_type' => [ + 'regex' => 'Le champ :attribute ne peut contenir que des lettres minuscules, des chiffres et des tirets, doit commencer par une lettre et comporter au plus 63 caractères.', + ], 'replacement_room_type' => [ 'exists' => 'Type de salle de remplacement invalide ! Un type de salle de remplacement est requis car des salles sont toujours attribuées à ce type de salle.', 'not_in' => 'Type de salle de remplacement invalide ! Un type de salle de remplacement est requis car des salles sont toujours attribuées à ce type de salle.', @@ -273,6 +285,7 @@ 'custom_parameter_invalid' => 'La valeur du paramètre :parameter est invalide.', 'custom_parameter_missing' => 'La valeur du paramètre :parameter est manquante.', 'custom_parameter_not_found' => 'Le paramètre :parameter n\'existe pas.', + 'custom_parameter_reserved' => 'Le paramètre :parameter est réservé et ne peut pas être défini ici.', 'date' => 'Le champ :attribute n\'est pas une date valide.', 'date_equals' => 'Le champ :attribute doit être une date égale à :date.', 'date_format' => 'Le champ :attribute ne correspond pas au format :format.', diff --git a/tests/Backend/Feature/api/v1/Room/RoomRecapTest.php b/tests/Backend/Feature/api/v1/Room/RoomRecapTest.php new file mode 100644 index 0000000000..7249fdb5aa --- /dev/null +++ b/tests/Backend/Feature/api/v1/Room/RoomRecapTest.php @@ -0,0 +1,186 @@ +seed(RolesAndPermissionsSeeder::class); + + config(['recap.enabled' => true]); + + $owner = User::factory()->create([ + 'authenticator' => 'oidc', + 'oidc_sub' => 'fixture-sub-ada-0001', + ]); + $this->room = Room::factory()->create([ + 'user_id' => $owner->id, + 'expert_mode' => false, + 'recap' => false, + ]); + } + + /** + * Build the settings payload for a room update without expert mode + */ + private function settingsPayload(bool $recap): array + { + return [ + 'access_code' => null, + 'room_type' => $this->room->roomType->id, + 'expert_mode' => false, + 'name' => RoomFactory::createValidRoomName(), + 'short_description' => null, + 'allow_guests' => false, + 'recap' => $recap, + ]; + } + + public function test_owner_can_change_recap() + { + $this->actingAs($this->room->owner)->getJson(route('api.v1.rooms.settings', ['room' => $this->room])) + ->assertSuccessful() + ->assertJsonPath('data.recap', false) + ->assertJsonPath('data.recap_available', true); + + $this->actingAs($this->room->owner)->putJson(route('api.v1.rooms.update', ['room' => $this->room]), $this->settingsPayload(true)) + ->assertSuccessful() + ->assertJsonPath('data.recap', true); + + $this->assertTrue($this->room->refresh()->recap); + + $this->actingAs($this->room->owner)->putJson(route('api.v1.rooms.update', ['room' => $this->room]), $this->settingsPayload(false)) + ->assertSuccessful() + ->assertJsonPath('data.recap', false); + + $this->assertFalse($this->room->refresh()->recap); + + // Invalid value + $this->actingAs($this->room->owner)->putJson(route('api.v1.rooms.update', ['room' => $this->room]), array_merge($this->settingsPayload(true), ['recap' => 'yes'])) + ->assertJsonValidationErrors(['recap']); + } + + public function test_others_cannot_change_recap() + { + $coOwner = User::factory()->create(['oidc_sub' => 'fixture-sub-dup-0007']); + $this->room->members()->attach($coOwner, ['role' => RoomUserRole::CO_OWNER]); + + $member = User::factory()->create(); + $this->room->members()->attach($member, ['role' => RoomUserRole::MODERATOR]); + + $admin = User::factory()->create(['oidc_sub' => 'fixture-sub-admin-0010']); + $role = Role::factory()->create(); + $role->permissions()->attach(Permission::where('name', 'rooms.manage')->first()); + $admin->roles()->attach($role); + + // Co-owner and admin can update the settings, but the recap value is ignored + foreach ([$coOwner, $admin] as $user) { + $this->actingAs($user)->putJson(route('api.v1.rooms.update', ['room' => $this->room]), $this->settingsPayload(true)) + ->assertSuccessful() + ->assertJsonPath('data.recap', false); + + $this->assertFalse($this->room->refresh()->recap); + } + + // Value set by the owner is kept, even if others send a different value + $this->room->recap = true; + $this->room->save(); + $this->actingAs($coOwner)->putJson(route('api.v1.rooms.update', ['room' => $this->room]), $this->settingsPayload(false)) + ->assertSuccessful() + ->assertJsonPath('data.recap', true); + $this->assertTrue($this->room->refresh()->recap); + + // Members cannot update the settings at all + $this->actingAs($member)->putJson(route('api.v1.rooms.update', ['room' => $this->room]), $this->settingsPayload(false)) + ->assertForbidden(); + $this->assertTrue($this->room->refresh()->recap); + } + + public function test_recap_unavailable_without_oidc_sub() + { + $this->room->owner->oidc_sub = null; + $this->room->owner->save(); + + $this->actingAs($this->room->owner)->getJson(route('api.v1.rooms.settings', ['room' => $this->room])) + ->assertSuccessful() + ->assertJsonPath('data.recap_available', false); + + // Value is ignored while the feature is unavailable + $this->actingAs($this->room->owner)->putJson(route('api.v1.rooms.update', ['room' => $this->room]), $this->settingsPayload(true)) + ->assertSuccessful() + ->assertJsonPath('data.recap', false); + $this->assertFalse($this->room->refresh()->recap); + } + + public function test_recap_unavailable_if_disabled() + { + config(['recap.enabled' => false]); + + $this->actingAs($this->room->owner)->getJson(route('api.v1.rooms.settings', ['room' => $this->room])) + ->assertSuccessful() + ->assertJsonPath('data.recap_available', false); + + $this->actingAs($this->room->owner)->putJson(route('api.v1.rooms.update', ['room' => $this->room]), $this->settingsPayload(true)) + ->assertSuccessful() + ->assertJsonPath('data.recap', false); + $this->assertFalse($this->room->refresh()->recap); + } + + public function test_recap_enforced_off_by_room_type() + { + $roomType = RoomType::factory()->create([ + 'recap_default' => false, + 'recap_enforced' => true, + ]); + $this->room->roomType()->associate($roomType); + $this->room->recap = true; + $this->room->save(); + + $this->assertFalse($this->room->getRoomSetting('recap')); + + $this->actingAs($this->room->owner)->getJson(route('api.v1.rooms.settings', ['room' => $this->room])) + ->assertSuccessful() + ->assertJsonPath('data.recap', false) + ->assertJsonPath('data.room_type.recap_default', false) + ->assertJsonPath('data.room_type.recap_enforced', true); + } + + public function test_new_room_uses_room_type_default() + { + $roomType = RoomType::factory()->create(['recap_default' => true]); + $user = User::factory()->create(); + $role = Role::factory()->create(); + $role->permissions()->attach(Permission::where('name', 'rooms.create')->first()); + $user->roles()->attach($role); + + $response = $this->actingAs($user)->postJson(route('api.v1.rooms.store'), [ + 'name' => RoomFactory::createValidRoomName(), + 'room_type' => $roomType->id, + ])->assertCreated(); + + $this->assertTrue(Room::find($response->json('data.id'))->recap); + } +} diff --git a/tests/Backend/Feature/api/v1/Room/RoomTest.php b/tests/Backend/Feature/api/v1/Room/RoomTest.php index bd7830fc13..e44338c9de 100644 --- a/tests/Backend/Feature/api/v1/Room/RoomTest.php +++ b/tests/Backend/Feature/api/v1/Room/RoomTest.php @@ -2924,7 +2924,7 @@ public function test_update_settings_expert() // Check if correct setting values get returned $new_settings = $response->json('data'); - $settings['room_type'] = (new RoomTypeResource($roomType))->withDefaultRoomSettings()->withFeatures(); + $settings['room_type'] = (new RoomTypeResource($roomType->refresh()))->withDefaultRoomSettings()->withFeatures(); $settings['allow_membership'] = false; $settings['everyone_can_start'] = false; $settings['lock_settings_disable_cam'] = true; @@ -2941,6 +2941,8 @@ public function test_update_settings_expert() $settings['record_attendance'] = false; $settings['record'] = false; $settings['auto_start_recording'] = false; + $settings['recap'] = false; + $settings['recap_available'] = false; $this->assertJsonStringEqualsJsonString(json_encode($new_settings), json_encode($settings)); diff --git a/tests/Backend/Feature/api/v1/RoomTypeRecapTest.php b/tests/Backend/Feature/api/v1/RoomTypeRecapTest.php new file mode 100644 index 0000000000..d62e6f8d69 --- /dev/null +++ b/tests/Backend/Feature/api/v1/RoomTypeRecapTest.php @@ -0,0 +1,153 @@ +seed(RolesAndPermissionsSeeder::class); + + config(['recap.enabled' => true]); + + $this->user = User::factory()->create(); + $role = Role::factory()->create(); + $role->permissions()->attach(Permission::where('name', 'roomTypes.update')->first()); + $this->user->roles()->attach($role); + + $this->roomType = RoomType::factory()->create()->refresh(); + } + + /** + * Build a valid update payload for the room type + */ + private function payload(array $overrides = []): array + { + $data = [ + 'name' => $this->roomType->name, + 'color' => $this->roomType->color, + 'description' => $this->roomType->description, + 'server_pool' => $this->roomType->serverPool->id, + 'restrict' => false, + 'max_duration' => null, + 'max_participants' => null, + 'has_access_code_default' => false, + 'has_access_code_enforced' => false, + 'create_parameters' => null, + 'join_parameters' => null, + 'recap_type' => 'lecture', + 'recap_sink' => 'docs', + 'updated_at' => $this->roomType->updated_at, + ]; + + foreach (Room::ROOM_SETTINGS_DEFINITION as $setting => $config) { + $data[$setting.'_default'] = $this->roomType[$setting.'_default']; + $data[$setting.'_enforced'] = false; + } + + return array_merge($data, $overrides); + } + + private function update(array $overrides = []) + { + $response = $this->actingAs($this->user)->putJson(route('api.v1.roomTypes.update', ['roomType' => $this->roomType->id]), $this->payload($overrides)); + $this->roomType->refresh(); + + return $response; + } + + public function test_recap_settings_saved() + { + $this->update(['recap_default' => true, 'recap_enforced' => false]) + ->assertSuccessful() + ->assertJsonPath('data.recap_default', true) + ->assertJsonPath('data.recap_enforced', false) + ->assertJsonPath('data.recap_type', 'lecture') + ->assertJsonPath('data.recap_sink', 'docs'); + + $this->assertTrue($this->roomType->recap_default); + $this->assertEquals('lecture', $this->roomType->recap_type); + $this->assertEquals('docs', $this->roomType->recap_sink); + + $this->actingAs($this->user)->getJson(route('api.v1.roomTypes.show', ['roomType' => $this->roomType->id])) + ->assertSuccessful() + ->assertJsonPath('data.recap_type', 'lecture') + ->assertJsonPath('data.recap_sink', 'docs'); + } + + public function test_recap_cannot_be_enforced_on() + { + $this->update(['recap_default' => true, 'recap_enforced' => true]) + ->assertJsonValidationErrors(['recap_default']); + + $this->assertFalse($this->roomType->recap_enforced); + + // Enforced off is allowed, type and sink are not required then + $this->update(['recap_default' => false, 'recap_enforced' => true, 'recap_type' => null, 'recap_sink' => null]) + ->assertSuccessful() + ->assertJsonPath('data.recap_enforced', true); + } + + public function test_recap_type_and_sink_validation() + { + // Required if recap is offered + $this->update(['recap_type' => null, 'recap_sink' => null]) + ->assertJsonValidationErrors(['recap_type', 'recap_sink']); + + // Invalid names + foreach (['Lecture', '1lecture', '-lecture', 'lec_ture', 'lec ture', 'lécture', 'a'.str_repeat('b', 63)] as $invalid) { + $this->update(['recap_type' => $invalid, 'recap_sink' => $invalid]) + ->assertJsonValidationErrors(['recap_type', 'recap_sink']); + } + + // Valid names (maximum length 63) + $maxLength = 'a'.str_repeat('b', 62); + $this->update(['recap_type' => 'seminar-2', 'recap_sink' => $maxLength]) + ->assertSuccessful(); + $this->assertEquals('seminar-2', $this->roomType->recap_type); + $this->assertEquals($maxLength, $this->roomType->recap_sink); + + // Not required if the feature is disabled + config(['recap.enabled' => false]); + $this->update(['recap_type' => null, 'recap_sink' => null]) + ->assertSuccessful(); + } + + public function test_reserved_create_parameters_rejected() + { + foreach (['meta_recap-v=1', 'META_RECAP-ENABLED=true', "meetingLayout=PRESENTATION_FOCUS\nmeta_Recap-type=lecture"] as $parameters) { + $this->update(['create_parameters' => $parameters]) + ->assertJsonValidationErrors(['create_parameters']); + } + + // Other meta parameters are allowed + $this->update(['create_parameters' => "meta_recapitulation=1\nmeta_other-key=1"]) + ->assertSuccessful(); + + // Prefix comes from the config + config(['recap.meta_prefix' => 'summary']); + $this->update(['create_parameters' => 'meta_summary-v=1']) + ->assertJsonValidationErrors(['create_parameters']); + } +} diff --git a/tests/Backend/Feature/api/v1/RoomTypeTest.php b/tests/Backend/Feature/api/v1/RoomTypeTest.php index 53ecda1ae4..5b70fa9a4f 100644 --- a/tests/Backend/Feature/api/v1/RoomTypeTest.php +++ b/tests/Backend/Feature/api/v1/RoomTypeTest.php @@ -388,6 +388,8 @@ public function test_create() 'record_enforced' => false, 'auto_start_recording_default' => false, 'auto_start_recording_enforced' => false, + 'recap_default' => false, + 'recap_enforced' => false, 'has_access_code_default' => true, 'has_access_code_enforced' => false, 'create_parameters' => 'meetingLayout=PRESENTATION_FOCUS', @@ -663,6 +665,8 @@ public function test_update() 'record_enforced' => false, 'auto_start_recording_default' => false, 'auto_start_recording_enforced' => false, + 'recap_default' => false, + 'recap_enforced' => false, 'has_access_code_default' => true, 'has_access_code_enforced' => false, 'create_parameters' => 'meetingLayout=PRESENTATION_FOCUS', From c68f4078a8d530256ed92c8546977ba05a09a3bd Mon Sep 17 00:00:00 2001 From: timo Date: Fri, 30 Oct 2026 20:42:19 +0100 Subject: [PATCH 03/18] Add meeting summary settings to room and room type views --- resources/js/components/RoomTabSettings.vue | 14 +++ .../js/composables/useRoomTypeSettings.js | 11 ++ resources/js/constants/roomSettings.js | 3 + resources/js/policies/RoomPolicy.js | 11 ++ resources/js/views/AdminRoomTypesView.vue | 106 ++++++++++++++++++ 5 files changed, 145 insertions(+) diff --git a/resources/js/components/RoomTabSettings.vue b/resources/js/components/RoomTabSettings.vue index 07729a164a..c2b5fd390f 100644 --- a/resources/js/components/RoomTabSettings.vue +++ b/resources/js/components/RoomTabSettings.vue @@ -249,6 +249,20 @@ const form = computed(() => { label: t("rooms.settings.recordings.auto_start_recording"), component: RoomTabSettingsToggleSwitch, }, + ...(settingsStore.getSetting("recap.enabled") && + userPermissions.can("manageRecap", props.room) + ? [ + { + setting: "recap", + label: t("rooms.settings.recordings.recap"), + component: RoomTabSettingsToggleSwitch, + disabled: disabled.value || !settings.value.recap_available, + warningMessage: settings.value.recap_available + ? null + : t("rooms.settings.recordings.recap_unavailable"), + }, + ] + : []), ], }, { diff --git a/resources/js/composables/useRoomTypeSettings.js b/resources/js/composables/useRoomTypeSettings.js index 8d63b78758..3e85db9310 100644 --- a/resources/js/composables/useRoomTypeSettings.js +++ b/resources/js/composables/useRoomTypeSettings.js @@ -1,8 +1,10 @@ import { computed } from "vue"; import { useI18n } from "vue-i18n"; +import { useSettingsStore } from "../stores/settings"; export function useRoomTypeSettings() { const { t } = useI18n(); + const settingsStore = useSettingsStore(); return computed(() => { return [ { @@ -63,6 +65,15 @@ export function useRoomTypeSettings() { label: t("rooms.settings.recordings.auto_start_recording"), type: "switch", }, + ...(settingsStore.getSetting("recap.enabled") + ? [ + { + key: "recap", + label: t("rooms.settings.recordings.recap"), + type: "switch", + }, + ] + : []), ], }, { diff --git a/resources/js/constants/roomSettings.js b/resources/js/constants/roomSettings.js index 9a035eecce..d2de8cfd3d 100644 --- a/resources/js/constants/roomSettings.js +++ b/resources/js/constants/roomSettings.js @@ -47,6 +47,9 @@ export const ROOM_SETTINGS_DEFINITION = { auto_start_recording: { expert_setting: true, }, + recap: { + expert_setting: false, + }, visibility: { expert_setting: true, }, diff --git a/resources/js/policies/RoomPolicy.js b/resources/js/policies/RoomPolicy.js index aea3e698fa..6a38ee435b 100644 --- a/resources/js/policies/RoomPolicy.js +++ b/resources/js/policies/RoomPolicy.js @@ -88,6 +88,17 @@ export default { user.permissions.includes("rooms.manage"); }, + /** + * Is user allowed to change the meeting summary (recap) setting of this room + * Only the room owner can opt in, as the summary is delivered to the owner + * @param user + * @param model + * @return {boolean} + */ + manageRecap(user, model) { + return !user ? false : model.owner?.id === user.id; + }, + /** * Is user allowed to become member of this room * @param user diff --git a/resources/js/views/AdminRoomTypesView.vue b/resources/js/views/AdminRoomTypesView.vue index 1d547f36a4..217ceb6c59 100644 --- a/resources/js/views/AdminRoomTypesView.vue +++ b/resources/js/views/AdminRoomTypesView.vue @@ -772,6 +772,106 @@ + +

{{ $t("rooms.settings.restrictions.title") }} @@ -1529,6 +1629,7 @@ import { useConfirm } from "primevue/useconfirm"; import { useI18n } from "vue-i18n"; import ConfirmDialog from "primevue/confirmdialog"; import { useColors } from "../composables/useColors.js"; +import { useSettingsStore } from "../stores/settings"; import { HTTP_STATUS_NOT_FOUND, HTTP_STATUS_STALE_MODEL, @@ -1541,6 +1642,7 @@ const api = useApi(); const router = useRouter(); const confirm = useConfirm(); const colors = useColors(); +const settingsStore = useSettingsStore(); const breadcrumbLabelData = inject("breadcrumbLabelData"); const { t } = useI18n(); @@ -1599,6 +1701,10 @@ const model = ref({ record_enforced: false, auto_start_recording_default: false, auto_start_recording_enforced: false, + recap_default: false, + recap_enforced: false, + recap_type: null, + recap_sink: null, visibility_default: 0, visibility_enforced: false, has_access_code_default: true, From 50e1c6257bcfd80aa364f4db250c8ab759e137b1 Mon Sep 17 00:00:00 2001 From: timo Date: Fri, 30 Oct 2026 20:53:09 +0100 Subject: [PATCH 04/18] Restrict meeting summary availability and validate meta prefix Return recap_available only to the room owner. Disable the feature with a warning if RECAP_META_PREFIX does not match ^[a-z][a-z0-9]{1,15}$. --- .env.example | 3 +- app/Http/Requests/RoomTypeRequest.php | 2 +- app/Http/Resources/ConfigResource.php | 3 +- app/Http/Resources/RoomSettingsResource.php | 3 +- app/Models/Room.php | 22 ++++++++- .../Feature/api/v1/Room/RoomRecapTest.php | 47 +++++++++++++++++++ 6 files changed, 75 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 3b6485857c..5b58a11fd2 100644 --- a/.env.example +++ b/.env.example @@ -86,7 +86,8 @@ MAIL_FROM_NAME="${APP_NAME}" # Meeting summaries (recap) # Master switch for the room setting and the room type fields #RECAP_ENABLED=false -# Prefix of the BBB meta parameters (meta_-*), must match the recording exporter +# Prefix of the BBB meta parameters (meta_-*), must equal the prefix of the recording exporter +# Lowercase letter followed by 1-15 lowercase letters or digits; an invalid prefix disables the feature #RECAP_META_PREFIX=recap # Enabled locales diff --git a/app/Http/Requests/RoomTypeRequest.php b/app/Http/Requests/RoomTypeRequest.php index 59a7256072..1663ef3c2e 100644 --- a/app/Http/Requests/RoomTypeRequest.php +++ b/app/Http/Requests/RoomTypeRequest.php @@ -41,7 +41,7 @@ public function rules() $rules['recap_default'][] = 'declined_if:recap_enforced,true'; // Meeting type and sink of the summaries, required if the room type offers summaries - $recapOffered = config('recap.enabled') && ! $this->boolean('recap_enforced'); + $recapOffered = Room::isRecapEnabled() && ! $this->boolean('recap_enforced'); $rules['recap_type'] = [Rule::requiredIf($recapOffered), 'nullable', 'string', 'regex:/^[a-z][a-z0-9-]{0,62}$/']; $rules['recap_sink'] = [Rule::requiredIf($recapOffered), 'nullable', 'string', 'regex:/^[a-z][a-z0-9-]{0,62}$/']; diff --git a/app/Http/Resources/ConfigResource.php b/app/Http/Resources/ConfigResource.php index 9681b4f46b..208ea0e960 100644 --- a/app/Http/Resources/ConfigResource.php +++ b/app/Http/Resources/ConfigResource.php @@ -4,6 +4,7 @@ namespace App\Http\Resources; +use App\Models\Room; use App\Settings\BannerSettings; use App\Settings\GeneralSettings; use App\Settings\RecordingSettings; @@ -109,7 +110,7 @@ public function toArray($request) 'show_fps' => config('streaming.show_fps'), ], 'recap' => [ - 'enabled' => config('recap.enabled'), + 'enabled' => Room::isRecapEnabled(), ], 'auth' => [ 'local' => config('auth.local.enabled'), diff --git a/app/Http/Resources/RoomSettingsResource.php b/app/Http/Resources/RoomSettingsResource.php index 9a667c662e..857da296a5 100644 --- a/app/Http/Resources/RoomSettingsResource.php +++ b/app/Http/Resources/RoomSettingsResource.php @@ -7,6 +7,7 @@ use App\Models\Room; use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; +use Illuminate\Support\Facades\Auth; class RoomSettingsResource extends JsonResource { @@ -36,7 +37,7 @@ public function toArray($request) 'short_description' => $this->short_description, 'access_code' => $this->access_code, 'room_type' => (new RoomTypeResource($this->roomType))->withDefaultRoomSettings()->withFeatures(), - 'recap_available' => $this->isRecapAvailable(), + 'recap_available' => $this->when(Auth::user()?->can('manageRecap', $this->resource) ?? false, fn () => $this->isRecapAvailable()), $this->merge($this->getRoomSettings()), ]; } diff --git a/app/Models/Room.php b/app/Models/Room.php index 404716a296..41eef82f90 100644 --- a/app/Models/Room.php +++ b/app/Models/Room.php @@ -18,6 +18,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Support\Facades\Context; +use Illuminate\Support\Facades\Log; use Illuminate\Validation\Rule; #[ObservedBy([RoomObserver::class])] @@ -406,13 +407,32 @@ public function getRoomSetting(string $settingName) return $this->roomType[$settingName.'_default']; } + /** + * Indicates whether the meeting summary (recap) feature is enabled. + * An invalid meta parameter prefix disables the feature, as the meta parameters would not match the exporter. + */ + public static function isRecapEnabled(): bool + { + if (! config('recap.enabled')) { + return false; + } + + if (preg_match('/^[a-z][a-z0-9]{1,15}$/', (string) config('recap.meta_prefix')) !== 1) { + Log::warning('Meeting summaries disabled: RECAP_META_PREFIX must match ^[a-z][a-z0-9]{1,15}$'); + + return false; + } + + return true; + } + /** * Indicates whether the meeting summary (recap) can be activated for this room. * Requires the feature to be enabled and the room owner to have logged in via OIDC (stored subject). */ public function isRecapAvailable(): bool { - return config('recap.enabled') && ! empty($this->owner->oidc_sub); + return self::isRecapEnabled() && ! empty($this->owner->oidc_sub); } /** diff --git a/tests/Backend/Feature/api/v1/Room/RoomRecapTest.php b/tests/Backend/Feature/api/v1/Room/RoomRecapTest.php index 7249fdb5aa..fbb547f608 100644 --- a/tests/Backend/Feature/api/v1/Room/RoomRecapTest.php +++ b/tests/Backend/Feature/api/v1/Room/RoomRecapTest.php @@ -13,7 +13,10 @@ use Database\Factories\RoomFactory; use Database\Seeders\RolesAndPermissionsSeeder; use Illuminate\Foundation\Testing\RefreshDatabase; +use Illuminate\Support\Facades\Log; use Tests\Backend\TestCase; +use TiMacDonald\Log\LogEntry; +use TiMacDonald\Log\LogFake; /** * Tests for the meeting summary (recap) room setting @@ -149,6 +152,50 @@ public function test_recap_unavailable_if_disabled() $this->assertFalse($this->room->refresh()->recap); } + public function test_recap_available_only_shown_to_owner() + { + $coOwner = User::factory()->create(); + $this->room->members()->attach($coOwner, ['role' => RoomUserRole::CO_OWNER]); + + $this->actingAs($coOwner)->getJson(route('api.v1.rooms.settings', ['room' => $this->room])) + ->assertSuccessful() + ->assertJsonPath('data.recap', false) + ->assertJsonMissingPath('data.recap_available'); + + $this->actingAs($this->room->owner)->getJson(route('api.v1.rooms.settings', ['room' => $this->room])) + ->assertSuccessful() + ->assertJsonPath('data.recap_available', true); + } + + public function test_recap_disabled_with_invalid_meta_prefix() + { + Log::swap(new LogFake); + + foreach (['Recap', 'recap-x', 'r', 'recap_x', '1recap', 'a'.str_repeat('b', 16)] as $invalidPrefix) { + config(['recap.meta_prefix' => $invalidPrefix]); + + $this->actingAs($this->room->owner)->getJson(route('api.v1.rooms.settings', ['room' => $this->room])) + ->assertSuccessful() + ->assertJsonPath('data.recap_available', false); + + $this->getJson(route('api.v1.config')) + ->assertSuccessful() + ->assertJsonPath('data.recap.enabled', false); + } + + Log::assertLogged(fn (LogEntry $log) => $log->level === 'warning' + && $log->message === 'Meeting summaries disabled: RECAP_META_PREFIX must match ^[a-z][a-z0-9]{1,15}$'); + + // Valid prefixes (minimum and maximum length) + foreach (['ab', 'a'.str_repeat('b', 15), 'summary2'] as $validPrefix) { + config(['recap.meta_prefix' => $validPrefix]); + + $this->actingAs($this->room->owner)->getJson(route('api.v1.rooms.settings', ['room' => $this->room])) + ->assertSuccessful() + ->assertJsonPath('data.recap_available', true); + } + } + public function test_recap_enforced_off_by_room_type() { $roomType = RoomType::factory()->create([ From 3e39bd83a09d10bd4074091c54b7577da868eb18 Mon Sep 17 00:00:00 2001 From: timo Date: Fri, 30 Oct 2026 21:02:30 +0100 Subject: [PATCH 05/18] Register meeting summaries with the recap service on meeting start Add the meta_-* parameters to the BBB create call when the room owner enabled meeting summaries, store the internal meeting id and register the owner with the recap service in a queued job. Cancel pending registrations when a room is deleted. --- .env.example | 9 +- app/Jobs/CancelRecapRegistration.php | 125 +++++++++ app/Jobs/RegisterRecapMeeting.php | 129 ++++++++++ app/Observers/RoomObserver.php | 8 + app/Services/MeetingService.php | 13 + app/Services/RecapService.php | 73 ++++++ app/Services/RoomService.php | 22 ++ config/recap.php | 10 +- ..._30_000003_add_recap_to_meetings_table.php | 31 +++ .../api/v1/Room/RoomRecapStartTest.php | 237 ++++++++++++++++++ .../Unit/Jobs/CancelRecapRegistrationTest.php | 121 +++++++++ .../Unit/Jobs/RegisterRecapMeetingTest.php | 213 ++++++++++++++++ tests/Backend/Unit/RecapConfigTest.php | 62 +++++ 13 files changed, 1051 insertions(+), 2 deletions(-) create mode 100644 app/Jobs/CancelRecapRegistration.php create mode 100644 app/Jobs/RegisterRecapMeeting.php create mode 100644 app/Services/RecapService.php create mode 100644 database/migrations/2026_10_30_000003_add_recap_to_meetings_table.php create mode 100644 tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php create mode 100644 tests/Backend/Unit/Jobs/CancelRecapRegistrationTest.php create mode 100644 tests/Backend/Unit/Jobs/RegisterRecapMeetingTest.php create mode 100644 tests/Backend/Unit/RecapConfigTest.php diff --git a/.env.example b/.env.example index 5b58a11fd2..ad3b3c5620 100644 --- a/.env.example +++ b/.env.example @@ -84,11 +84,18 @@ MAIL_FROM_NAME="${APP_NAME}" #OIDC_SCOPES=profile,email # Meeting summaries (recap) -# Master switch for the room setting and the room type fields +# Master switch for the room setting and the room type fields (also requires RECAP_SERVICE_URL and RECAP_FRONTEND_TOKEN) #RECAP_ENABLED=false # Prefix of the BBB meta parameters (meta_-*), must equal the prefix of the recording exporter # Lowercase letter followed by 1-15 lowercase letters or digits; an invalid prefix disables the feature #RECAP_META_PREFIX=recap +# Base URL of the meeting summary service; the feature stays off without it +#RECAP_SERVICE_URL=https://recap.example.org +# Bearer token of this front end at the meeting summary service; the feature stays off without it +#RECAP_FRONTEND_TOKEN= +# Timeouts in seconds for requests to the meeting summary service +#RECAP_SERVER_TIMEOUT=10 +#RECAP_SERVER_CONNECT_TIMEOUT=20 # Enabled locales # Comma separated list, e.g. de,en diff --git a/app/Jobs/CancelRecapRegistration.php b/app/Jobs/CancelRecapRegistration.php new file mode 100644 index 0000000000..7e27e6e5c5 --- /dev/null +++ b/app/Jobs/CancelRecapRegistration.php @@ -0,0 +1,125 @@ +recordId; + } + + /** + * Get the tags that should be assigned to the job. + * + * @return array + */ + public function tags(): array + { + return ['recap']; + } + + /** + * Determine the time at which the job should timeout. + */ + public function retryUntil(): DateTime + { + return now()->addDay(); + } + + /** + * Calculate the number of seconds to wait before retrying the job. + * + * @return array + */ + public function backoff(): array + { + return [30, 60, 60 * 5]; + } + + /** + * Execute the job. + * + * @throws RuntimeException + */ + public function handle(RecapService $recapService): void + { + if (! RecapService::isConfigured()) { + Log::warning('Meeting summary registration {record} not cancelled; service not configured', ['record' => $this->recordId]); + $this->fail('Meeting summary service not configured'); + + return; + } + + // Connection errors are thrown and the job is retried + $response = $recapService->cancel($this->recordId); + + // 204: cancelled, 202: running job stopped, 404: unknown or already removed + if ($response->successful() || $response->notFound()) { + Log::info('Cancelled meeting summary registration {record}', ['record' => $this->recordId]); + + return; + } + + if ($response->conflict() && $response->json('type') === 'urn:recap:problem:already-delivered') { + Log::notice('Meeting summary registration {record} not cancelled; summary already delivered', ['record' => $this->recordId]); + + return; + } + + if (RecapService::isRetryable($response)) { + throw new RuntimeException('Cancelling meeting summary registration failed with status '.$response->status()); + } + + Log::error('Cancelling meeting summary registration {record} rejected with status {status}', [ + 'record' => $this->recordId, + 'status' => $response->status(), + 'type' => $response->json('type'), + ]); + $this->fail('Cancelling meeting summary registration rejected with status '.$response->status()); + } +} diff --git a/app/Jobs/RegisterRecapMeeting.php b/app/Jobs/RegisterRecapMeeting.php new file mode 100644 index 0000000000..df75ba41f8 --- /dev/null +++ b/app/Jobs/RegisterRecapMeeting.php @@ -0,0 +1,129 @@ +meeting->id; + } + + /** + * Get the tags that should be assigned to the job. + * + * @return array + */ + public function tags(): array + { + return ['recap']; + } + + /** + * Determine the time at which the job should timeout. + */ + public function retryUntil(): DateTime + { + return now()->addDay(); + } + + /** + * Calculate the number of seconds to wait before retrying the job. + * + * @return array + */ + public function backoff(): array + { + return [30, 60, 60 * 5]; + } + + /** + * Execute the job. + * + * @throws RuntimeException + */ + public function handle(RecapService $recapService): void + { + if (! RecapService::isConfigured() || empty($this->meeting->internal_meeting_id) || empty($this->owner->oidc_sub)) { + Log::warning('Meeting summary registration for meeting {meeting} skipped; service, record id or owner subject missing', ['meeting' => $this->meeting->id]); + $this->fail('Meeting summary registration not possible'); + + return; + } + + // Connection errors are thrown and the job is retried + $response = $recapService->register($this->meeting, $this->owner); + + if ($response->successful()) { + Log::info('Registered meeting {meeting} for a meeting summary', ['meeting' => $this->meeting->id]); + + return; + } + + if (RecapService::isRetryable($response)) { + throw new RuntimeException('Meeting summary registration failed with status '.$response->status()); + } + + Log::error('Meeting summary registration for meeting {meeting} rejected with status {status}', [ + 'meeting' => $this->meeting->id, + 'status' => $response->status(), + 'type' => $response->json('type'), + ]); + $this->fail('Meeting summary registration rejected with status '.$response->status()); + } +} diff --git a/app/Observers/RoomObserver.php b/app/Observers/RoomObserver.php index 9241636812..4f84227042 100644 --- a/app/Observers/RoomObserver.php +++ b/app/Observers/RoomObserver.php @@ -6,6 +6,7 @@ use App\Enums\RoomAuthTokenType; use App\Exceptions\RoomIdGenerationFailed; +use App\Jobs\CancelRecapRegistration; use App\Models\Room; use App\Models\RoomAuthToken; use Illuminate\Support\Facades\DB; @@ -59,6 +60,13 @@ public function updated(Room $room): void */ public function deleting(Room $room): void { + // Cancel meeting summary registrations, meetings are deleted by the database cascade + $room->meetings() + ->where('recap', true) + ->whereNotNull('internal_meeting_id') + ->pluck('internal_meeting_id') + ->each(fn (string $recordId) => CancelRecapRegistration::dispatch($recordId)); + $room->files->each->delete(); $room->recordings->each->delete(); Storage::deleteDirectory($room->id); diff --git a/app/Services/MeetingService.php b/app/Services/MeetingService.php index aa2fba1206..1f5df0b304 100644 --- a/app/Services/MeetingService.php +++ b/app/Services/MeetingService.php @@ -105,6 +105,15 @@ public function start(): ?CreateMeetingResponse $meetingParams->addMeta('bbb-origin', 'PILOS'); $meetingParams->addMeta('pilos-sub-spool-dir', config('recording.spool-sub-directory')); + // Opt in to a meeting summary (recap), keys defined by the recap metadata interface v1 + if ($this->meeting->recap) { + $recapPrefix = config('recap.meta_prefix'); + $meetingParams->addMeta($recapPrefix.'-v', '1'); + $meetingParams->addMeta($recapPrefix.'-enabled', 'true'); + $meetingParams->addMeta($recapPrefix.'-type', $this->meeting->room->roomType->recap_type); + $meetingParams->addMeta($recapPrefix.'-sink', $this->meeting->room->roomType->recap_sink); + } + // get files that should be used in this meeting and add links to the files $files = $this->meeting->room->files()->where('use_in_meeting', true)->orderBy('default', 'desc')->get(); foreach ($files as $file) { @@ -176,6 +185,10 @@ public function start(): ?CreateMeetingResponse return null; } + // Internal meeting id, used as record id of the recording + $this->meeting->internal_meeting_id = $result->getInternalMeetingId(); + $this->meeting->save(); + return $result; } diff --git a/app/Services/RecapService.php b/app/Services/RecapService.php new file mode 100644 index 0000000000..28bdaa4aad --- /dev/null +++ b/app/Services/RecapService.php @@ -0,0 +1,73 @@ +connectTimeout(config('recap.server_connect_timeout')) + ->baseUrl(config('recap.service_url')) + ->withToken(config('recap.frontend_token')) + ->acceptJson(); + } + + /** + * Register the owner of a meeting with the service + * + * @throws ConnectionException + */ + public function register(Meeting $meeting, User $owner): Response + { + return $this->getHttpClient()->put('api/v1/registrations/'.rawurlencode($meeting->internal_meeting_id), [ + 'schema_version' => self::SCHEMA_VERSION, + 'meeting_id' => $meeting->id, + 'record_id' => $meeting->internal_meeting_id, + 'owner' => [ + 'sub' => $owner->oidc_sub, + 'email' => $owner->email, + ], + ]); + } + + /** + * Cancel the registration of a meeting + * + * @throws ConnectionException + */ + public function cancel(string $recordId): Response + { + return $this->getHttpClient()->delete('api/v1/registrations/'.rawurlencode($recordId)); + } + + /** + * Indicates whether a failed request should be retried (rate limit or server error) + */ + public static function isRetryable(Response $response): bool + { + return $response->tooManyRequests() || $response->serverError(); + } +} diff --git a/app/Services/RoomService.php b/app/Services/RoomService.php index ac0b095fd4..5e9254c397 100644 --- a/app/Services/RoomService.php +++ b/app/Services/RoomService.php @@ -6,6 +6,7 @@ use App\Enums\CustomStatusCodes; use App\Events\RoomStarted; +use App\Jobs\RegisterRecapMeeting; use App\Models\Meeting; use App\Models\Room; use App\Prometheus\Counter; @@ -79,6 +80,7 @@ public function start(): MeetingService $meeting = new Meeting; $meeting->record_attendance = $this->room->getRoomSetting('record_attendance'); $meeting->record = $this->room->getRoomSetting('record'); + $meeting->recap = $this->isRecapActive(); $meeting->server()->associate($server); $meeting->room()->associate($this->room); $meeting->save(); @@ -105,6 +107,11 @@ public function start(): MeetingService $meeting->start = date('Y-m-d H:i:s'); $meeting->save(); + // Register the room owner with the meeting summary service + if ($meeting->recap) { + RegisterRecapMeeting::dispatch($meeting, $this->room->owner); + } + // Change latest meeting or the room to newly created meeting $this->room->latestMeeting()->associate($meeting); @@ -128,6 +135,21 @@ public function start(): MeetingService return $meetingService; } + /** + * Indicates whether a new meeting of this room should create a meeting summary (recap). + * + * Requires the feature, an owner with OIDC subject, the effective room settings recap and record, + * and a meeting type and sink on the room type. + */ + protected function isRecapActive(): bool + { + return $this->room->isRecapAvailable() + && $this->room->getRoomSetting('recap') + && $this->room->getRoomSetting('record') + && ! empty($this->room->roomType->recap_type) + && ! empty($this->room->roomType->recap_sink); + } + /** * Join a running meeting */ diff --git a/config/recap.php b/config/recap.php index 1fa1b503ef..e54cb52a39 100644 --- a/config/recap.php +++ b/config/recap.php @@ -2,7 +2,15 @@ declare(strict_types=1); +$serviceUrl = env('RECAP_SERVICE_URL'); +$frontendToken = env('RECAP_FRONTEND_TOKEN'); + return [ - 'enabled' => (bool) env('RECAP_ENABLED', false), + // The feature stays off unless the service URL and the token are set as well + 'enabled' => (bool) env('RECAP_ENABLED', false) && ! empty($serviceUrl) && ! empty($frontendToken), 'meta_prefix' => env('RECAP_META_PREFIX', 'recap'), + 'service_url' => $serviceUrl, + 'frontend_token' => $frontendToken, + 'server_timeout' => (int) env('RECAP_SERVER_TIMEOUT', 10), + 'server_connect_timeout' => (int) env('RECAP_SERVER_CONNECT_TIMEOUT', 20), ]; diff --git a/database/migrations/2026_10_30_000003_add_recap_to_meetings_table.php b/database/migrations/2026_10_30_000003_add_recap_to_meetings_table.php new file mode 100644 index 0000000000..a6372feb02 --- /dev/null +++ b/database/migrations/2026_10_30_000003_add_recap_to_meetings_table.php @@ -0,0 +1,31 @@ +boolean('recap')->default(false); + $table->string('internal_meeting_id')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('meetings', function (Blueprint $table) { + $table->dropColumn(['recap', 'internal_meeting_id']); + }); + } +}; diff --git a/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php b/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php new file mode 100644 index 0000000000..948a0d86df --- /dev/null +++ b/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php @@ -0,0 +1,237 @@ +seed(RolesAndPermissionsSeeder::class); + + config([ + 'recap.enabled' => true, + 'recap.meta_prefix' => 'recap', + 'recap.service_url' => self::SERVICE_URL, + 'recap.frontend_token' => self::FRONTEND_TOKEN, + ]); + + $roomType = RoomType::factory()->create([ + 'recap_type' => 'meeting-summary', + 'recap_sink' => 'docs-main', + ]); + $owner = User::factory()->create([ + 'authenticator' => 'oidc', + 'oidc_sub' => self::OWNER_SUB, + 'email' => self::OWNER_EMAIL, + ]); + $this->room = Room::factory()->create([ + 'room_type_id' => $roomType->id, + 'user_id' => $owner->id, + 'expert_mode' => true, + 'record' => true, + 'record_attendance' => false, + 'recap' => true, + ]); + + $server = Server::factory()->create(); + $roomType->serverPool->servers()->attach($server); + $this->bbbFaker = new BigBlueButtonServerFaker($server->base_url, $server->secret); + } + + /** + * Start the room as owner and return the query parameters of the BBB create call + */ + private function startRoom(): array + { + $this->bbbFaker->addCreateMeetingRequest(); + $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.start', ['room' => $this->room]), [ + 'consent_record_attendance' => false, + 'consent_record' => true, + 'consent_record_video' => false, + ])->assertSuccessful(); + + return $this->bbbFaker->getRequest(0)->data(); + } + + private function recapMetaKeys(array $createParameters): array + { + return array_values(array_filter(array_keys($createParameters), fn (string $key) => str_starts_with(strtolower($key), 'meta_recap'))); + } + + public function test_start_with_recap() + { + Queue::fake(); + + $createParameters = $this->startRoom(); + + $this->assertEqualsCanonicalizing(self::RECAP_META_KEYS, $this->recapMetaKeys($createParameters)); + $this->assertEquals('1', $createParameters['meta_recap-v']); + $this->assertEquals('true', $createParameters['meta_recap-enabled']); + $this->assertEquals('meeting-summary', $createParameters['meta_recap-type']); + $this->assertEquals('docs-main', $createParameters['meta_recap-sink']); + $this->assertEquals('PILOS', $createParameters['meta_bbb-origin']); + + $meeting = $this->room->refresh()->latestMeeting; + $this->assertTrue((bool) $meeting->recap); + $this->assertEquals(self::INTERNAL_MEETING_ID, $meeting->internal_meeting_id); + $this->assertEquals($meeting->id, $createParameters['meetingID']); + + Queue::assertPushed(RegisterRecapMeeting::class, 1); + Queue::assertPushed(RegisterRecapMeeting::class, fn (RegisterRecapMeeting $job) => $job->meeting->is($meeting) && $job->owner->is($this->room->owner)); + } + + public function test_start_with_configured_meta_prefix() + { + Queue::fake(); + config(['recap.meta_prefix' => 'summary']); + + $createParameters = $this->startRoom(); + + $this->assertEquals([], $this->recapMetaKeys($createParameters)); + $this->assertEquals('1', $createParameters['meta_summary-v']); + $this->assertEquals('true', $createParameters['meta_summary-enabled']); + $this->assertEquals('meeting-summary', $createParameters['meta_summary-type']); + $this->assertEquals('docs-main', $createParameters['meta_summary-sink']); + } + + public function test_start_registers_owner() + { + Http::fake([self::SERVICE_URL.'/*' => Http::response(['status' => 'registered'], 201)]); + + $this->startRoom(); + + $meeting = $this->room->refresh()->latestMeeting; + Http::assertSent(fn (Request $request) => $request->method() === 'PUT' + && $request->url() === self::SERVICE_URL.'/api/v1/registrations/'.self::INTERNAL_MEETING_ID + && $request->hasHeader('Authorization', 'Bearer '.self::FRONTEND_TOKEN) + && $request->data() === [ + 'schema_version' => '1.0.0', + 'meeting_id' => $meeting->id, + 'record_id' => self::INTERNAL_MEETING_ID, + 'owner' => [ + 'sub' => self::OWNER_SUB, + 'email' => self::OWNER_EMAIL, + ], + ]); + } + + public static function recapConditionProvider(): array + { + return [ + 'feature disabled' => ['feature_disabled'], + 'invalid meta prefix' => ['invalid_meta_prefix'], + 'room setting off' => ['room_setting_off'], + 'room setting enforced off by room type' => ['enforced_off'], + 'recording off' => ['record_off'], + 'owner without OIDC subject' => ['owner_without_sub'], + 'room type without meeting type' => ['no_recap_type'], + 'room type without sink' => ['no_recap_sink'], + ]; + } + + /** + * Each condition alone prevents the meeting summary. The stored room value stays true in all cases except + * 'room_setting_off', like a room type default copied into the room at creation. + */ + #[DataProvider('recapConditionProvider')] + public function test_start_without_recap(string $condition) + { + Queue::fake(); + + match ($condition) { + 'feature_disabled' => config(['recap.enabled' => false]), + 'invalid_meta_prefix' => config(['recap.meta_prefix' => 'Recap']), + 'room_setting_off' => $this->room->forceFill(['recap' => false])->save(), + 'enforced_off' => $this->room->roomType->forceFill(['recap_default' => false, 'recap_enforced' => true])->save(), + 'record_off' => $this->room->forceFill(['record' => false])->save(), + 'owner_without_sub' => $this->room->owner->forceFill(['oidc_sub' => null])->save(), + 'no_recap_type' => $this->room->roomType->forceFill(['recap_type' => null])->save(), + 'no_recap_sink' => $this->room->roomType->forceFill(['recap_sink' => null])->save(), + }; + + $createParameters = $this->startRoom(); + + $this->assertEquals([], $this->recapMetaKeys($createParameters)); + + $meeting = $this->room->refresh()->latestMeeting; + $this->assertFalse((bool) $meeting->recap); + $this->assertEquals(self::INTERNAL_MEETING_ID, $meeting->internal_meeting_id); + + Queue::assertNotPushed(RegisterRecapMeeting::class); + } + + public function test_room_deletion_cancels_registrations() + { + Queue::fake(); + + $eligible = Meeting::factory()->create(['room_id' => $this->room->id, 'recap' => true, 'internal_meeting_id' => 'record-id-a-1695892370102']); + Meeting::factory()->create(['room_id' => $this->room->id, 'recap' => true, 'internal_meeting_id' => 'record-id-b-1695892370103']); + Meeting::factory()->create(['room_id' => $this->room->id, 'recap' => false, 'internal_meeting_id' => 'record-id-c-1695892370104']); + Meeting::factory()->create(['room_id' => $this->room->id, 'recap' => true, 'internal_meeting_id' => null]); + Meeting::factory()->create(['recap' => true, 'internal_meeting_id' => 'record-id-other-room']); + + $this->actingAs($this->room->owner)->deleteJson(route('api.v1.rooms.destroy', ['room' => $this->room])) + ->assertNoContent(); + + $this->assertModelMissing($eligible); + + Queue::assertPushed(CancelRecapRegistration::class, 2); + Queue::assertPushed(CancelRecapRegistration::class, fn (CancelRecapRegistration $job) => $job->recordId === 'record-id-a-1695892370102'); + Queue::assertPushed(CancelRecapRegistration::class, fn (CancelRecapRegistration $job) => $job->recordId === 'record-id-b-1695892370103'); + } + + public function test_owner_deletion_cancels_registrations() + { + Queue::fake(); + + Meeting::factory()->create(['room_id' => $this->room->id, 'recap' => true, 'internal_meeting_id' => 'record-id-a-1695892370102']); + + $this->room->owner->delete(); + + Queue::assertPushed(CancelRecapRegistration::class, fn (CancelRecapRegistration $job) => $job->recordId === 'record-id-a-1695892370102'); + } +} diff --git a/tests/Backend/Unit/Jobs/CancelRecapRegistrationTest.php b/tests/Backend/Unit/Jobs/CancelRecapRegistrationTest.php new file mode 100644 index 0000000000..fbc866c7e4 --- /dev/null +++ b/tests/Backend/Unit/Jobs/CancelRecapRegistrationTest.php @@ -0,0 +1,121 @@ + self::SERVICE_URL, + 'recap.frontend_token' => self::FRONTEND_TOKEN, + ]); + } + + private function createJob(): CancelRecapRegistration + { + return (new CancelRecapRegistration(self::RECORD_ID))->withFakeQueueInteractions(); + } + + public static function successStatusProvider(): array + { + return [ + 'cancelled' => [204], + 'running job stopped' => [202], + 'not found' => [404], + ]; + } + + #[DataProvider('successStatusProvider')] + public function test_cancel(int $status) + { + Http::fake([self::SERVICE_URL.'/*' => Http::response(null, $status)]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertNotFailed(); + Http::assertSentCount(1); + Http::assertSent(fn (Request $request) => $request->method() === 'DELETE' + && $request->url() === self::SERVICE_URL.'/api/v1/registrations/'.self::RECORD_ID + && $request->hasHeader('Authorization', 'Bearer '.self::FRONTEND_TOKEN)); + Log::assertLogged(fn (LogEntry $log) => $log->level === 'info' && $log->context['record'] === self::RECORD_ID); + } + + public function test_already_delivered() + { + Http::fake([self::SERVICE_URL.'/*' => Http::response(['type' => 'urn:recap:problem:already-delivered'], 409)]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertNotFailed(); + Log::assertLogged(fn (LogEntry $log) => $log->level === 'notice' && $log->context['record'] === self::RECORD_ID); + } + + public static function retryableStatusProvider(): array + { + return [ + 'too many requests' => [429], + 'bad gateway' => [502], + ]; + } + + #[DataProvider('retryableStatusProvider')] + public function test_retry_on_status(int $status) + { + Http::fake([self::SERVICE_URL.'/*' => Http::response(null, $status)]); + + $job = $this->createJob(); + + $this->expectException(RuntimeException::class); + $job->handle(new RecapService); + } + + public function test_retry_on_connection_error() + { + Http::fake([self::SERVICE_URL.'/*' => Http::failedConnection()]); + + $job = $this->createJob(); + + $this->expectException(ConnectionException::class); + $job->handle(new RecapService); + } + + public function test_fail_on_client_error() + { + Http::fake([self::SERVICE_URL.'/*' => Http::response(['type' => 'urn:recap:problem:unauthorized'], 401)]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertFailed(); + Log::assertLogged(fn (LogEntry $log) => $log->level === 'error' + && $log->context['status'] === 401 + && ! str_contains($log->message.json_encode($log->context), self::FRONTEND_TOKEN)); + } +} diff --git a/tests/Backend/Unit/Jobs/RegisterRecapMeetingTest.php b/tests/Backend/Unit/Jobs/RegisterRecapMeetingTest.php new file mode 100644 index 0000000000..b7379236f9 --- /dev/null +++ b/tests/Backend/Unit/Jobs/RegisterRecapMeetingTest.php @@ -0,0 +1,213 @@ + self::SERVICE_URL, + 'recap.frontend_token' => self::FRONTEND_TOKEN, + ]); + + $this->owner = User::factory()->create([ + 'authenticator' => 'oidc', + 'oidc_sub' => self::OWNER_SUB, + 'email' => self::OWNER_EMAIL, + ]); + $this->meeting = Meeting::factory()->create([ + 'recap' => true, + 'internal_meeting_id' => self::RECORD_ID, + ]); + } + + private function createJob(): RegisterRecapMeeting + { + return (new RegisterRecapMeeting($this->meeting, $this->owner))->withFakeQueueInteractions(); + } + + /** + * Assert that no log entry contains the owner subject, email or the token + */ + private function assertNoPersonalDataLogged(): void + { + Log::assertNotLogged(function (LogEntry $log) { + $entry = $log->message.json_encode($log->context); + + return str_contains($entry, self::OWNER_SUB) + || str_contains($entry, self::OWNER_EMAIL) + || str_contains($entry, self::FRONTEND_TOKEN); + }); + } + + public function test_register() + { + Http::fake([self::SERVICE_URL.'/*' => Http::response(['status' => 'registered'], 201)]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertNotFailed(); + Http::assertSentCount(1); + Http::assertSent(fn (Request $request) => $request->method() === 'PUT' + && $request->url() === self::SERVICE_URL.'/api/v1/registrations/'.self::RECORD_ID + && $request->hasHeader('Authorization', 'Bearer '.self::FRONTEND_TOKEN) + && $request->isJson() + && $request->data() === [ + 'schema_version' => '1.0.0', + 'meeting_id' => $this->meeting->id, + 'record_id' => self::RECORD_ID, + 'owner' => [ + 'sub' => self::OWNER_SUB, + 'email' => self::OWNER_EMAIL, + ], + ]); + + Log::assertLogged(fn (LogEntry $log) => $log->level === 'info' && $log->context['meeting'] === $this->meeting->id); + $this->assertNoPersonalDataLogged(); + } + + public function test_queue_payload_has_no_personal_data() + { + $payload = serialize(new RegisterRecapMeeting($this->meeting, $this->owner)); + + $this->assertStringNotContainsString(self::OWNER_SUB, $payload); + $this->assertStringNotContainsString(self::OWNER_EMAIL, $payload); + } + + public static function retryableStatusProvider(): array + { + return [ + 'too many requests' => [429], + 'internal server error' => [500], + 'service unavailable' => [503], + ]; + } + + #[DataProvider('retryableStatusProvider')] + public function test_retry_on_status(int $status) + { + Http::fake([self::SERVICE_URL.'/*' => Http::response(['type' => 'urn:recap:problem:rate-limited'], $status)]); + + $job = $this->createJob(); + + try { + $job->handle(new RecapService); + $this->fail('Expected exception to retry the job'); + } catch (RuntimeException $exception) { + $this->assertStringNotContainsString(self::OWNER_SUB, $exception->getMessage()); + } + + $job->assertNotFailed(); + $this->assertNoPersonalDataLogged(); + } + + public function test_retry_on_connection_error() + { + Http::fake([self::SERVICE_URL.'/*' => Http::failedConnection()]); + + $job = $this->createJob(); + + $this->expectException(ConnectionException::class); + $job->handle(new RecapService); + } + + public function test_retry_settings() + { + $job = new RegisterRecapMeeting($this->meeting, $this->owner); + + $this->assertEquals(0, $job->tries); + $this->assertEquals([30, 60, 300], $job->backoff()); + $this->assertTrue($job->retryUntil() > now()->addHours(23)); + } + + public static function finalStatusProvider(): array + { + return [ + 'bad request' => [400, 'urn:recap:problem:invalid-request'], + 'unauthorized' => [401, 'urn:recap:problem:unauthorized'], + 'conflict' => [409, 'urn:recap:problem:registration-locked'], + 'unprocessable' => [422, 'urn:recap:problem:unsupported-schema-version'], + ]; + } + + #[DataProvider('finalStatusProvider')] + public function test_fail_on_client_error(int $status, string $type) + { + Http::fake([self::SERVICE_URL.'/*' => Http::response(['type' => $type, 'detail' => 'fixture detail'], $status)]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertFailed(); + Http::assertSentCount(1); + Log::assertLogged(fn (LogEntry $log) => $log->level === 'error' + && $log->context['status'] === $status + && $log->context['type'] === $type + && $log->context['meeting'] === $this->meeting->id); + $this->assertNoPersonalDataLogged(); + } + + public function test_fail_without_owner_subject() + { + Http::fake(); + $this->owner->forceFill(['oidc_sub' => null])->save(); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertFailed(); + Http::assertNothingSent(); + $this->assertNoPersonalDataLogged(); + } + + public function test_fail_without_service_configuration() + { + Http::fake(); + config(['recap.frontend_token' => null]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertFailed(); + Http::assertNothingSent(); + } +} diff --git a/tests/Backend/Unit/RecapConfigTest.php b/tests/Backend/Unit/RecapConfigTest.php new file mode 100644 index 0000000000..4172ca010f --- /dev/null +++ b/tests/Backend/Unit/RecapConfigTest.php @@ -0,0 +1,62 @@ +setEnv($key, null); + } + + parent::tearDown(); + } + + private function setEnv(string $key, ?string $value): void + { + if ($value === null) { + putenv($key); + unset($_ENV[$key], $_SERVER[$key]); + + return; + } + + putenv($key.'='.$value); + $_ENV[$key] = $value; + $_SERVER[$key] = $value; + } + + public static function environmentProvider(): array + { + return [ + 'all set' => ['true', 'https://service.recap.test', 'FIXTURE-NOT-A-SECRET-fe-0123456789abcdef0123456789abcdef', true], + 'switch off' => ['false', 'https://service.recap.test', 'FIXTURE-NOT-A-SECRET-fe-0123456789abcdef0123456789abcdef', false], + 'service url missing' => ['true', null, 'FIXTURE-NOT-A-SECRET-fe-0123456789abcdef0123456789abcdef', false], + 'token missing' => ['true', 'https://service.recap.test', null, false], + 'token empty' => ['true', 'https://service.recap.test', '', false], + ]; + } + + /** + * The feature is only enabled with the master switch, the service URL and the token + */ + #[DataProvider('environmentProvider')] + public function test_enabled_requires_service_url_and_token(string $enabled, ?string $serviceUrl, ?string $token, bool $expected) + { + $this->setEnv('RECAP_ENABLED', $enabled); + $this->setEnv('RECAP_SERVICE_URL', $serviceUrl); + $this->setEnv('RECAP_FRONTEND_TOKEN', $token); + + $config = require config_path('recap.php'); + + $this->assertSame($expected, $config['enabled']); + } +} From b139e8820e4ce7fd25fe82b6f465d47a3a4972dc Mon Sep 17 00:00:00 2001 From: timo Date: Fri, 30 Oct 2026 21:02:30 +0100 Subject: [PATCH 06/18] Hint that meeting summaries require the recording --- lang/ar/rooms.php | 1 + lang/de-gender/rooms.php | 1 + lang/de/rooms.php | 1 + lang/en/rooms.php | 1 + lang/fa/rooms.php | 1 + lang/fr/rooms.php | 1 + resources/js/components/RoomTabSettings.vue | 2 +- 7 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lang/ar/rooms.php b/lang/ar/rooms.php index 1b901aa4f2..87cf6c61e5 100644 --- a/lang/ar/rooms.php +++ b/lang/ar/rooms.php @@ -428,6 +428,7 @@ 'auto_start_recording' => 'بدء التسجيل تلقائيًا', 'recap' => 'إنشاء ملخص للاجتماع (ذكاء اصطناعي)', 'recap_unavailable' => 'متاح بعد تسجيل دخولك مرة واحدة عبر OpenID Connect.', + 'recap_requires_record' => 'يسري فقط عند تفعيل تسجيل مؤتمر الفيديو.', 'record_attendance' => 'تسجيل حضور المشاركين', 'record_video_conference' => 'تسجيل مؤتمر الفيديو', 'title' => 'التسجيلات', diff --git a/lang/de-gender/rooms.php b/lang/de-gender/rooms.php index 3cf90f782e..49147fdb25 100644 --- a/lang/de-gender/rooms.php +++ b/lang/de-gender/rooms.php @@ -434,6 +434,7 @@ 'auto_start_recording' => 'Automatischer Aufnahmestart', 'recap' => 'Zusammenfassung der Besprechung erstellen (KI)', 'recap_unavailable' => 'Verfügbar, nachdem Sie sich einmal per OpenID Connect angemeldet haben.', + 'recap_requires_record' => 'Wirkt nur, wenn die Aufzeichnung der Videokonferenz aktiviert ist.', 'record_attendance' => 'Anwesenheit der Teilnehmer protokollieren', 'record_video_conference' => 'Videokonferenz aufzeichnen', 'title' => 'Aufzeichnungen', diff --git a/lang/de/rooms.php b/lang/de/rooms.php index ac9d28466c..2e3b089065 100644 --- a/lang/de/rooms.php +++ b/lang/de/rooms.php @@ -489,6 +489,7 @@ 'auto_start_recording' => 'Automatischer Aufzeichnungsstart', 'recap' => 'Zusammenfassung der Besprechung erstellen (KI)', 'recap_unavailable' => 'Verfügbar, nachdem Sie sich einmal per OpenID Connect angemeldet haben.', + 'recap_requires_record' => 'Wirkt nur, wenn die Aufzeichnung der Videokonferenz aktiviert ist.', 'record_attendance' => 'Anwesenheit der Teilnehmer protokollieren', 'record_video_conference' => 'Videokonferenz aufzeichnen', 'title' => 'Aufzeichnungen', diff --git a/lang/en/rooms.php b/lang/en/rooms.php index 89631e8be1..1d51422d4e 100644 --- a/lang/en/rooms.php +++ b/lang/en/rooms.php @@ -489,6 +489,7 @@ 'auto_start_recording' => 'Automatic recording start', 'recap' => 'Create a meeting summary (AI)', 'recap_unavailable' => 'Available after you have logged in once via OpenID Connect.', + 'recap_requires_record' => 'Only takes effect when the recording of the video conference is enabled.', 'record_attendance' => 'Log attendance of participants', 'record_video_conference' => 'Record video conference', 'title' => 'Recordings', diff --git a/lang/fa/rooms.php b/lang/fa/rooms.php index a3e6c7b17f..bd1b740e1e 100644 --- a/lang/fa/rooms.php +++ b/lang/fa/rooms.php @@ -428,6 +428,7 @@ 'auto_start_recording' => 'شروع خودکار ضبط', 'recap' => 'ایجاد خلاصه جلسه (هوش مصنوعی)', 'recap_unavailable' => 'پس از یک بار ورود از طریق OpenID Connect در دسترس است.', + 'recap_requires_record' => 'فقط زمانی اعمال می‌شود که ضبط ویدئوکنفرانس فعال باشد.', 'record_attendance' => 'ثبت حضور شرکت‌کنندگان', 'record_video_conference' => 'ضبط کنفرانس ویدئویی', 'title' => 'ضبط‌ها', diff --git a/lang/fr/rooms.php b/lang/fr/rooms.php index 9e5cd2e87a..04bc3c9487 100644 --- a/lang/fr/rooms.php +++ b/lang/fr/rooms.php @@ -489,6 +489,7 @@ 'auto_start_recording' => 'Enregistrement automatique au démarrage', 'recap' => 'Créer un résumé de la réunion (IA)', 'recap_unavailable' => 'Disponible après votre première connexion via OpenID Connect.', + 'recap_requires_record' => 'Ne s\'applique que si l\'enregistrement de la visioconférence est activé.', 'record_attendance' => 'Enregistrer l\'historique des présences', 'record_video_conference' => 'Enregistrer la vidéo conférence', 'title' => 'Enregistrements', diff --git a/resources/js/components/RoomTabSettings.vue b/resources/js/components/RoomTabSettings.vue index c2b5fd390f..80087941aa 100644 --- a/resources/js/components/RoomTabSettings.vue +++ b/resources/js/components/RoomTabSettings.vue @@ -258,7 +258,7 @@ const form = computed(() => { component: RoomTabSettingsToggleSwitch, disabled: disabled.value || !settings.value.recap_available, warningMessage: settings.value.recap_available - ? null + ? t("rooms.settings.recordings.recap_requires_record") : t("rooms.settings.recordings.recap_unavailable"), }, ] From 883ce93c83ac4e91e561e9cfb4ebcf6590895c51 Mon Sep 17 00:00:00 2001 From: timo Date: Fri, 30 Oct 2026 21:02:30 +0100 Subject: [PATCH 07/18] Add admin documentation and changelog entry for meeting summaries --- CHANGELOG.md | 4 + .../08-advanced/10-meeting-summaries.md | 122 ++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 docs/docs/administration/08-advanced/10-meeting-summaries.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d09fd0da0..80fde943bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Experimental AI meeting summaries of recorded meetings via an external summary service: room setting for the room owner, meeting type and destination per room type, owner registration and cancellation on room deletion + ## [v4.20.1] - 2026-11-19 ### Security diff --git a/docs/docs/administration/08-advanced/10-meeting-summaries.md b/docs/docs/administration/08-advanced/10-meeting-summaries.md new file mode 100644 index 0000000000..112aa0304b --- /dev/null +++ b/docs/docs/administration/08-advanced/10-meeting-summaries.md @@ -0,0 +1,122 @@ +--- +title: Meeting summaries +description: Guide to setting up AI meeting summaries of recorded meetings with an external summary service +--- + +:::note + +This is a new experimental feature and therefore not enabled by default. + +::: + +## Introduction + +PILOS can ask an external meeting summary service to transcribe and summarize recorded meetings. +The summary is delivered to the room owner by the summary service, for example as a document in a document editor. +PILOS itself does not process the recording; it only marks the meeting at BigBlueButton and tells the summary service who the owner is. + +When a meeting starts in a room with meeting summaries enabled, PILOS: + +1. adds the meta parameters `meta_-v=1`, `meta_-enabled=true`, `meta_-type` and `meta_-sink` to the BigBlueButton `create` call, +2. stores the internal meeting ID returned by BigBlueButton (the ID of the later recording), +3. registers the room owner with the summary service in a queued job (`PUT /api/v1/registrations/{internal meeting id}`). + +The BigBlueButton server needs a recording exporter that sends the raw recordings of these meetings to the summary service. +Only meetings with both the meta parameters and a registration are summarized. + +When a room is deleted, PILOS cancels the registrations of its meetings in a queued job (`DELETE /api/v1/registrations/{internal meeting id}`). +A summary that has already been delivered is not withdrawn; it belongs to the owner. +Transferring the room ownership does not change existing registrations: the summary goes to the owner at the time the meeting was started. + +## Requirements + +- The summary service is reachable from PILOS, and a bearer token for this PILOS instance is set up there. +- Users log in via [OpenID Connect](./01-external-authentication.md). The summary service identifies the owner by the OpenID Connect subject (`sub`), which PILOS stores at each OpenID Connect login. + The meeting summary setting is unavailable to a room owner until they have logged in via OpenID Connect once. +- The queue workers (Horizon) are running, as registrations are sent by queued jobs. + +## Setup + +### 1. Configure PILOS + +Enable meeting summaries by adding the following environment variables to the `.env` file: + +```shell +RECAP_ENABLED=true +RECAP_SERVICE_URL=https://recap.domain.tld +RECAP_FRONTEND_TOKEN="token-of-this-pilos-instance" +``` + +- `RECAP_SERVICE_URL` is the base URL of the summary service; if the API is in a subdirectory, include the full path. +- The feature stays disabled unless `RECAP_ENABLED`, `RECAP_SERVICE_URL` and `RECAP_FRONTEND_TOKEN` are all set. +- `RECAP_META_PREFIX` must be the same prefix as configured in the recording exporter on the BigBlueButton servers. + It must be a lowercase letter followed by 1-15 lowercase letters or digits; an invalid prefix disables the feature and logs a warning. + +### 2. Configure room types + +Meeting summaries are configured per room type in the admin UI: + +- **Create a meeting summary (AI)**: Default value of the room setting, and whether it is enforced. A room type can enforce meeting summaries off, but it cannot enforce them on. +- **Meeting type**: Name of the meeting type at the summary service, which selects the summary template (e.g. `meeting-summary`). +- **Summary destination**: Name of the sink profile at the summary service the summaries are delivered to (e.g. `docs-main`). + +Both names consist of lowercase letters, digits and hyphens and must be configured at the summary service. +Meetings in rooms of a room type without meeting type or destination are never summarized. + +Custom create parameters of a room type must not contain `meta_-*` parameters, so a room type cannot opt rooms in. + +### 3. Room setting + +The room owner, and only the room owner, can enable **Create a meeting summary (AI)** in the recording section of the room settings. +Co-owners and administrators cannot change it. + +A meeting is summarized only if, when it starts: + +- the feature is enabled, +- the room owner has an OpenID Connect subject, +- the room setting is enabled (and not enforced off by the room type), +- the recording of the video conference is enabled for the room, +- the room type has a meeting type and a summary destination. + +The recording must then actually be started in the meeting (or start automatically); without recording marks, BigBlueButton does not export the meeting. + +## Consent + +There is no separate consent for meeting summaries. The existing recording consent applies to all participants. +As the recording may be transcribed and summarized by an AI, the recording consent text should mention this. +Customize the texts `rooms.recording_info` and `rooms.recording_accept` as described in [Locales](../09-customisation/02-locales.md), for example: + +```php +'recording_info' => 'This room may be recorded. The recording may be transcribed and summarized by an AI.', +``` + +## Data flow and privacy + +| Data | Sent to | Personal data | +| ------------------------------------------------------------------------- | --------------------------------------------- | ---------------------------------------------- | +| `meta_-*` parameters (version, opt-in, meeting type, destination) | BigBlueButton, part of the recording metadata | none; may be visible to meeting participants | +| Registration: meeting ID, internal meeting ID, owner `sub` and email | summary service | owner OpenID Connect subject and email address | +| Cancellation on room deletion: internal meeting ID | summary service | none | + +- PILOS stores the OpenID Connect subject in the users table, and the meeting summary flag and the internal meeting ID in the meetings table. They are deleted with the user or the meeting. +- The queued jobs contain only model IDs or the internal meeting ID, no subject or email. +- Logs contain only meeting and internal meeting IDs, HTTP status codes and problem types, never the subject, email or token. +- How long the summary service keeps the registration, recording and summary is configured there. + +## Retries + +Registrations and cancellations are retried for up to one day (after 30 seconds, 60 seconds and then every 5 minutes) on network errors, HTTP 429 and HTTP 5xx. +Other client errors (e.g. 400, 401, 409) are logged with status and problem type, and the job fails without retry. +A late registration is accepted by the summary service. +A cancellation answered with 404 or with 409 `already-delivered` is final. + +## Configuration Options + +| Option | Default Value | Description | +| ------------------------------ | ------------- | ------------------------------------------------------------------------------------------------------ | +| `RECAP_ENABLED` | `false` | Enable meeting summaries (also requires `RECAP_SERVICE_URL` and `RECAP_FRONTEND_TOKEN`) | +| `RECAP_META_PREFIX` | `recap` | Prefix of the BigBlueButton meta parameters, must equal the prefix of the recording exporter | +| `RECAP_SERVICE_URL` | `null` | Base URL of the meeting summary service | +| `RECAP_FRONTEND_TOKEN` | `null` | Bearer token of this PILOS instance at the meeting summary service | +| `RECAP_SERVER_CONNECT_TIMEOUT` | `20` | Maximum time to wait to establish a connection to the meeting summary service | +| `RECAP_SERVER_TIMEOUT` | `10` | Maximum time to wait for a response of the meeting summary service, once the connection is established | From bd6c5caedeb8a68f3ba14aa32bae724e7fbb80be Mon Sep 17 00:00:00 2001 From: timo Date: Fri, 30 Oct 2026 21:13:31 +0100 Subject: [PATCH 08/18] Cast meeting summary flag and skip cancellation without service configuration --- app/Models/Meeting.php | 1 + app/Observers/RoomObserver.php | 14 +++++++--- .../api/v1/Room/RoomRecapStartTest.php | 27 +++++++++++++++++-- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/app/Models/Meeting.php b/app/Models/Meeting.php index 4a61d681e6..cc290551a4 100644 --- a/app/Models/Meeting.php +++ b/app/Models/Meeting.php @@ -41,6 +41,7 @@ class Meeting extends Model 'end' => 'datetime', 'record_attendance' => 'boolean', 'record' => 'boolean', + 'recap' => 'boolean', 'detached' => 'datetime', ]; diff --git a/app/Observers/RoomObserver.php b/app/Observers/RoomObserver.php index 4f84227042..9e97fb490b 100644 --- a/app/Observers/RoomObserver.php +++ b/app/Observers/RoomObserver.php @@ -9,7 +9,9 @@ use App\Jobs\CancelRecapRegistration; use App\Models\Room; use App\Models\RoomAuthToken; +use App\Services\RecapService; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; @@ -61,11 +63,17 @@ public function updated(Room $room): void public function deleting(Room $room): void { // Cancel meeting summary registrations, meetings are deleted by the database cascade - $room->meetings() + $recapRecordIds = $room->meetings() ->where('recap', true) ->whereNotNull('internal_meeting_id') - ->pluck('internal_meeting_id') - ->each(fn (string $recordId) => CancelRecapRegistration::dispatch($recordId)); + ->pluck('internal_meeting_id'); + if ($recapRecordIds->isNotEmpty()) { + if (RecapService::isConfigured()) { + $recapRecordIds->each(fn (string $recordId) => CancelRecapRegistration::dispatch($recordId)); + } else { + Log::warning('Meeting summary registrations of room {room} not cancelled; service not configured', ['room' => $room->id, 'count' => $recapRecordIds->count()]); + } + } $room->files->each->delete(); $room->recordings->each->delete(); diff --git a/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php b/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php index 948a0d86df..19dade3ba9 100644 --- a/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php +++ b/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php @@ -15,10 +15,13 @@ use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Http\Client\Request; use Illuminate\Support\Facades\Http; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Queue; use PHPUnit\Framework\Attributes\DataProvider; use Tests\Backend\TestCase; use Tests\Backend\Utils\BigBlueButtonServerFaker; +use TiMacDonald\Log\LogEntry; +use TiMacDonald\Log\LogFake; /** * Tests for the meeting summary (recap) parameters on meeting start and the cancellation on room deletion @@ -116,7 +119,7 @@ public function test_start_with_recap() $this->assertEquals('PILOS', $createParameters['meta_bbb-origin']); $meeting = $this->room->refresh()->latestMeeting; - $this->assertTrue((bool) $meeting->recap); + $this->assertTrue($meeting->recap); $this->assertEquals(self::INTERNAL_MEETING_ID, $meeting->internal_meeting_id); $this->assertEquals($meeting->id, $createParameters['meetingID']); @@ -198,7 +201,7 @@ public function test_start_without_recap(string $condition) $this->assertEquals([], $this->recapMetaKeys($createParameters)); $meeting = $this->room->refresh()->latestMeeting; - $this->assertFalse((bool) $meeting->recap); + $this->assertFalse($meeting->recap); $this->assertEquals(self::INTERNAL_MEETING_ID, $meeting->internal_meeting_id); Queue::assertNotPushed(RegisterRecapMeeting::class); @@ -224,6 +227,26 @@ public function test_room_deletion_cancels_registrations() Queue::assertPushed(CancelRecapRegistration::class, fn (CancelRecapRegistration $job) => $job->recordId === 'record-id-b-1695892370103'); } + public function test_room_deletion_without_service_configuration() + { + Queue::fake(); + Log::swap(new LogFake); + config(['recap.frontend_token' => null]); + + Meeting::factory()->create(['room_id' => $this->room->id, 'recap' => true, 'internal_meeting_id' => 'record-id-a-1695892370102']); + Meeting::factory()->create(['room_id' => $this->room->id, 'recap' => true, 'internal_meeting_id' => 'record-id-b-1695892370103']); + + $this->actingAs($this->room->owner)->deleteJson(route('api.v1.rooms.destroy', ['room' => $this->room])) + ->assertNoContent(); + + Queue::assertNotPushed(CancelRecapRegistration::class); + Log::assertLogged(fn (LogEntry $log) => $log->level === 'warning' + && $log->context['room'] === $this->room->id + && $log->context['count'] === 2); + Log::assertNotLogged(fn (LogEntry $log) => str_contains($log->message.json_encode($log->context), self::OWNER_SUB) + || str_contains($log->message.json_encode($log->context), self::OWNER_EMAIL)); + } + public function test_owner_deletion_cancels_registrations() { Queue::fake(); From 1189887e889ea54e89214bb79cc53b6d13367779 Mon Sep 17 00:00:00 2001 From: timo Date: Fri, 6 Nov 2026 15:38:06 +0100 Subject: [PATCH 09/18] Offer meeting summaries without recording and skip import of summary-only recordings --- .../Controllers/api/v1/RoomController.php | 2 + app/Http/Requests/JoinMeetingRequest.php | 7 + app/Http/Requests/StartMeetingRequest.php | 8 + app/Jobs/ProcessRecording.php | 16 ++ app/Services/MeetingService.php | 6 +- app/Services/RoomService.php | 7 +- lang/ar/rooms.php | 8 +- lang/de-gender/rooms.php | 8 +- lang/de/rooms.php | 8 +- lang/en/rooms.php | 8 +- lang/fa/rooms.php | 8 +- lang/fr/rooms.php | 8 +- resources/js/components/RoomJoinButton.vue | 32 +++- resources/js/components/RoomTabSettings.vue | 21 ++- .../api/v1/Room/RoomRecapStartTest.php | 155 +++++++++++++++++- .../Unit/Jobs/ProcessRecordingTest.php | 72 ++++++++ 16 files changed, 347 insertions(+), 27 deletions(-) diff --git a/app/Http/Controllers/api/v1/RoomController.php b/app/Http/Controllers/api/v1/RoomController.php index 0ec7db6354..e7bb2fda25 100644 --- a/app/Http/Controllers/api/v1/RoomController.php +++ b/app/Http/Controllers/api/v1/RoomController.php @@ -241,6 +241,7 @@ public function getStartRequirements(Room $room) { $features = [ 'recording' => $room->getRoomSetting('record'), + 'recap' => (new RoomService($room))->isRecapActive(), 'attendance_recording' => $room->getRoomSetting('record_attendance'), 'streaming' => $room->streaming->enabled, ]; @@ -254,6 +255,7 @@ public function getJoinRequirements(Room $room) $features = [ 'recording' => $meeting?->record ?? false, + 'recap' => $meeting?->recap ?? false, 'attendance_recording' => $meeting?->record_attendance ?? false, 'streaming' => $meeting ? $room->streaming->enabled_for_current_meeting : false, ]; diff --git a/app/Http/Requests/JoinMeetingRequest.php b/app/Http/Requests/JoinMeetingRequest.php index 44f053cc3a..9f45d311c1 100644 --- a/app/Http/Requests/JoinMeetingRequest.php +++ b/app/Http/Requests/JoinMeetingRequest.php @@ -47,6 +47,13 @@ private function getRecordingRules(): array ]; } + // Meeting summary without recording, the camera video is not recorded + if ($meeting?->recap) { + return [ + 'consent_record' => ['required', 'boolean', 'accepted'], // Consent to join meeting with meeting summary enabled + ]; + } + return []; } diff --git a/app/Http/Requests/StartMeetingRequest.php b/app/Http/Requests/StartMeetingRequest.php index 8fa084fcab..2cb7eb17a2 100644 --- a/app/Http/Requests/StartMeetingRequest.php +++ b/app/Http/Requests/StartMeetingRequest.php @@ -4,6 +4,7 @@ namespace App\Http\Requests; +use App\Services\RoomService; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Context; @@ -46,6 +47,13 @@ private function getRecordingRules(): array ]; } + // Meeting summary without recording, the camera video is not recorded + if ((new RoomService($this->room))->isRecapActive()) { + return [ + 'consent_record' => ['required', 'boolean', 'accepted'], // Consent to join meeting with meeting summary enabled + ]; + } + return []; } diff --git a/app/Jobs/ProcessRecording.php b/app/Jobs/ProcessRecording.php index 77bd73258d..1efe0e105e 100644 --- a/app/Jobs/ProcessRecording.php +++ b/app/Jobs/ProcessRecording.php @@ -7,6 +7,7 @@ use App\Enums\RecordingAccess; use App\Exceptions\RecordingExtractionFailed; use App\Exceptions\UnsafeArchiveEntryException; +use App\Models\Meeting; use App\Models\RecordingFormat; use DateTime; use Exception; @@ -179,6 +180,9 @@ public function handle(): void return str_ends_with($file, 'metadata.xml'); }); + // Meetings with a meeting summary but without recording, their recordings are discarded + $summaryOnlyMeetingIds = []; + foreach ($metadataFiles as $metadataFile) { // Each directory with a metadata file inside is a recording format // the metadata file is describing the recording @@ -187,6 +191,14 @@ public function handle(): void $xmlContent = Storage::disk('recordings')->get($metadataFile); $xml = simplexml_load_string($xmlContent); + // BBB only records the meeting for the meeting summary, nobody asked for a recording + $meeting = Meeting::find((string) $xml->meta->meetingId); + if ($meeting?->recap && ! $meeting->record) { + $summaryOnlyMeetingIds[$meeting->id] = true; + + continue; + } + // Create or update the recording format in the database $recordingFormat = RecordingFormat::createFromRecordingXML($xml); @@ -209,6 +221,10 @@ public function handle(): void return; } } + + foreach (array_keys($summaryOnlyMeetingIds) as $meetingId) { + Log::info('Discarded recording of meeting {meeting}; the meeting only has a meeting summary, not a recording', ['meeting' => $meetingId]); + } } catch (Exception $e) { // Extraction failed, retry the job later (.tar file might be incomplete yet) Log::error('Extracting recording file '.$this->file.' failed: '.$e->getMessage()); diff --git a/app/Services/MeetingService.php b/app/Services/MeetingService.php index 1f5df0b304..63810d6906 100644 --- a/app/Services/MeetingService.php +++ b/app/Services/MeetingService.php @@ -84,8 +84,9 @@ public function start(): ?CreateMeetingResponse } // Room settings take precedence + // A meeting summary needs the recording marks of BBB, so the meeting is recorded even if the room setting is off $meetingParams - ->setRecord($this->meeting->record) + ->setRecord($this->meeting->recap ? true : $this->meeting->record) ->setAutoStartRecording($this->meeting->room->auto_start_recording) ->setLogoutURL(url('rooms/'.$this->meeting->room->id)) ->setMeetingEndedURL($this->getCallbackUrl()) @@ -696,6 +697,9 @@ public function getJoinUrl(JoinMeetingRequest|StartMeetingRequest $request): str // If meeting has recording enabled, add parameter to allow recording of own video if ($this->meeting->record) { $joinMeetingParams->addUserData('bbb_record_video', $request->consent_record_video); + } elseif ($this->meeting->recap) { + // Meeting summary without recording, camera video is never recorded + $joinMeetingParams->addUserData('bbb_record_video', false); } // If a custom style file is set, pass url to bbb html5 client diff --git a/app/Services/RoomService.php b/app/Services/RoomService.php index 5e9254c397..7c2ca42299 100644 --- a/app/Services/RoomService.php +++ b/app/Services/RoomService.php @@ -138,14 +138,13 @@ public function start(): MeetingService /** * Indicates whether a new meeting of this room should create a meeting summary (recap). * - * Requires the feature, an owner with OIDC subject, the effective room settings recap and record, - * and a meeting type and sink on the room type. + * Requires the feature, an owner with OIDC subject, the effective room setting recap, + * and a meeting type and sink on the room type. The recording setting of the room is not required. */ - protected function isRecapActive(): bool + public function isRecapActive(): bool { return $this->room->isRecapAvailable() && $this->room->getRoomSetting('recap') - && $this->room->getRoomSetting('record') && ! empty($this->room->roomType->recap_type) && ! empty($this->room->roomType->recap_sink); } diff --git a/lang/ar/rooms.php b/lang/ar/rooms.php index 87cf6c61e5..4e88e6e9d4 100644 --- a/lang/ar/rooms.php +++ b/lang/ar/rooms.php @@ -300,11 +300,15 @@ 'title' => 'روابط الغرف المخصصة', ], 'placeholder_name' => 'محمد أحمد', + 'recap_accept' => 'أوافق على تفريغ الصوت وتلخيصه بواسطة الذكاء الاصطناعي.', + 'recap_info' => 'قد يقوم ذكاء اصطناعي بتفريغ صوت هذا الاجتماع وتلخيصه. لا يتم نشر أي تسجيل.', 'recording_accept' => 'أوافق على التسجيل.', 'recording_attendance_accept' => 'أوافق على تسجيل الحضور.', 'recording_attendance_info' => 'يتم تسجيل الحضور في هذه الغرفة.', 'recording_hint' => 'إذا كنت لا تريد تسجيل صوتك، تأكد من كتم الميكروفون. استخدم الدردشة للمشاركة بدلاً من ذلك.', 'recording_info' => 'قد يتم تسجيل هذه الغرفة.', + 'recording_recap_accept' => 'أوافق على التسجيل وعلى تفريغ الصوت وتلخيصه بواسطة الذكاء الاصطناعي.', + 'recording_recap_info' => 'قد يتم تسجيل هذه الغرفة، وقد يقوم ذكاء اصطناعي بتفريغ الصوت وتلخيصه.', 'recording_video_accept' => '(اختياري) يمكن تسجيل صورة الفيديو الخاصة بي.', 'recordings' => [ 'access' => 'الوصول', @@ -424,11 +428,13 @@ ], 'title' => 'المشاركون', ], + 'recap' => [ + 'title' => 'ملخص الاجتماع (ذكاء اصطناعي)', + ], 'recordings' => [ 'auto_start_recording' => 'بدء التسجيل تلقائيًا', 'recap' => 'إنشاء ملخص للاجتماع (ذكاء اصطناعي)', 'recap_unavailable' => 'متاح بعد تسجيل دخولك مرة واحدة عبر OpenID Connect.', - 'recap_requires_record' => 'يسري فقط عند تفعيل تسجيل مؤتمر الفيديو.', 'record_attendance' => 'تسجيل حضور المشاركين', 'record_video_conference' => 'تسجيل مؤتمر الفيديو', 'title' => 'التسجيلات', diff --git a/lang/de-gender/rooms.php b/lang/de-gender/rooms.php index 49147fdb25..36f93e2360 100644 --- a/lang/de-gender/rooms.php +++ b/lang/de-gender/rooms.php @@ -306,11 +306,15 @@ 'title' => 'Personalisierte Raumlinks', ], 'placeholder_name' => 'Max Mustermann', + 'recap_accept' => 'Ich bin mit der Transkription und der KI-Zusammenfassung des Tons einverstanden.', + 'recap_info' => 'Der Ton dieser Besprechung wird möglicherweise von einer KI transkribiert und zusammengefasst. Es wird keine Aufzeichnung veröffentlicht.', 'recording_accept' => 'Ich bin mit der Aufzeichnung einverstanden.', 'recording_attendance_accept' => 'Ich bin mit der Protokollierung der Anwesenheit einverstanden.', 'recording_attendance_info' => 'Die Anwesenheit in diesem Raum wird protokolliert.', 'recording_hint' => 'Wenn Sie nicht möchten, dass Ihre Stimme aufgezeichnet wird, stellen Sie sicher, dass Ihr Mikrofon stumm geschaltet ist. Verwenden Sie stattdessen den Chat, um sich zu beteiligen.', 'recording_info' => 'Dieser Raum wird möglicherweise aufgezeichnet.', + 'recording_recap_accept' => 'Ich bin mit der Aufzeichnung sowie der Transkription und KI-Zusammenfassung des Tons einverstanden.', + 'recording_recap_info' => 'Dieser Raum wird möglicherweise aufgezeichnet, und der Ton wird möglicherweise von einer KI transkribiert und zusammengefasst.', 'recording_video_accept' => 'Mein Videobild darf aufgezeichnet werden.', 'recordings' => [ 'access' => 'Zugriffsrecht', @@ -430,11 +434,13 @@ ], 'title' => 'Teilnehmer', ], + 'recap' => [ + 'title' => 'Besprechungszusammenfassung (KI)', + ], 'recordings' => [ 'auto_start_recording' => 'Automatischer Aufnahmestart', 'recap' => 'Zusammenfassung der Besprechung erstellen (KI)', 'recap_unavailable' => 'Verfügbar, nachdem Sie sich einmal per OpenID Connect angemeldet haben.', - 'recap_requires_record' => 'Wirkt nur, wenn die Aufzeichnung der Videokonferenz aktiviert ist.', 'record_attendance' => 'Anwesenheit der Teilnehmer protokollieren', 'record_video_conference' => 'Videokonferenz aufzeichnen', 'title' => 'Aufzeichnungen', diff --git a/lang/de/rooms.php b/lang/de/rooms.php index 2e3b089065..d84ef69b5f 100644 --- a/lang/de/rooms.php +++ b/lang/de/rooms.php @@ -348,11 +348,15 @@ 'title' => 'Personalisierte Raumlinks', ], 'placeholder_name' => 'Max Mustermann', + 'recap_accept' => 'Ich bin mit der Transkription und der KI-Zusammenfassung des Tons einverstanden.', + 'recap_info' => 'Der Ton dieser Besprechung wird möglicherweise von einer KI transkribiert und zusammengefasst. Es wird keine Aufzeichnung veröffentlicht.', 'recording_accept' => 'Ich bin mit der Aufzeichnung einverstanden.', 'recording_attendance_accept' => 'Ich bin mit der Protokollierung der Anwesenheit einverstanden.', 'recording_attendance_info' => 'Die Anwesenheit in diesem Raum wird protokolliert.', 'recording_hint' => 'Wenn Sie nicht möchten, dass Ihre Stimme aufgezeichnet wird, stellen Sie sicher, dass Ihr Mikrofon stumm geschaltet ist. Verwenden Sie stattdessen den Chat, um sich zu beteiligen.', 'recording_info' => 'Dieser Raum wird möglicherweise aufgezeichnet.', + 'recording_recap_accept' => 'Ich bin mit der Aufzeichnung sowie der Transkription und KI-Zusammenfassung des Tons einverstanden.', + 'recording_recap_info' => 'Dieser Raum wird möglicherweise aufgezeichnet, und der Ton wird möglicherweise von einer KI transkribiert und zusammengefasst.', 'recording_video_accept' => '(Optional) Mein Videobild darf aufgezeichnet werden.', 'recordings' => [ 'access' => 'Zugriffsrecht', @@ -485,11 +489,13 @@ ], 'title' => 'Teilnehmer', ], + 'recap' => [ + 'title' => 'Besprechungszusammenfassung (KI)', + ], 'recordings' => [ 'auto_start_recording' => 'Automatischer Aufzeichnungsstart', 'recap' => 'Zusammenfassung der Besprechung erstellen (KI)', 'recap_unavailable' => 'Verfügbar, nachdem Sie sich einmal per OpenID Connect angemeldet haben.', - 'recap_requires_record' => 'Wirkt nur, wenn die Aufzeichnung der Videokonferenz aktiviert ist.', 'record_attendance' => 'Anwesenheit der Teilnehmer protokollieren', 'record_video_conference' => 'Videokonferenz aufzeichnen', 'title' => 'Aufzeichnungen', diff --git a/lang/en/rooms.php b/lang/en/rooms.php index 1d51422d4e..f51d7fedb6 100644 --- a/lang/en/rooms.php +++ b/lang/en/rooms.php @@ -348,11 +348,15 @@ 'title' => 'Personalized room links', ], 'placeholder_name' => 'John Doe', + 'recap_accept' => 'I consent to the transcription and AI summary of the audio.', + 'recap_info' => 'An AI may transcribe and summarize the audio of this meeting. No recording is published.', 'recording_accept' => 'I consent to the recording.', 'recording_attendance_accept' => 'I consent to the attendance logging.', 'recording_attendance_info' => 'The attendance in this room is logged.', 'recording_hint' => 'If you don\'t want your voice recorded, make sure your microphone is muted. Use the chat to participate instead.', 'recording_info' => 'This room may be recorded.', + 'recording_recap_accept' => 'I consent to the recording and to the transcription and AI summary of the audio.', + 'recording_recap_info' => 'This room may be recorded, and an AI may transcribe and summarize the audio.', 'recording_video_accept' => '(Optional) My video image may be recorded.', 'recordings' => [ 'access' => 'Access', @@ -485,11 +489,13 @@ ], 'title' => 'Participants', ], + 'recap' => [ + 'title' => 'Meeting summary (AI)', + ], 'recordings' => [ 'auto_start_recording' => 'Automatic recording start', 'recap' => 'Create a meeting summary (AI)', 'recap_unavailable' => 'Available after you have logged in once via OpenID Connect.', - 'recap_requires_record' => 'Only takes effect when the recording of the video conference is enabled.', 'record_attendance' => 'Log attendance of participants', 'record_video_conference' => 'Record video conference', 'title' => 'Recordings', diff --git a/lang/fa/rooms.php b/lang/fa/rooms.php index bd1b740e1e..f38c66eb62 100644 --- a/lang/fa/rooms.php +++ b/lang/fa/rooms.php @@ -300,11 +300,15 @@ 'title' => 'لینک‌های شخصی‌سازی شده اتاق', ], 'placeholder_name' => 'نام و نام خانوادگی', + 'recap_accept' => 'من به رونویسی و خلاصه‌سازی صدا توسط هوش مصنوعی رضایت می‌دهم.', + 'recap_info' => 'صدای این جلسه ممکن است توسط هوش مصنوعی رونویسی و خلاصه شود. هیچ ضبطی منتشر نمی‌شود.', 'recording_accept' => 'من به ضبط رضایت می‌دهم.', 'recording_attendance_accept' => 'من به ثبت حضور رضایت می‌دهم.', 'recording_attendance_info' => 'حضور در این اتاق ثبت می‌شود.', 'recording_hint' => 'اگر نمی‌خواهید صدای شما ضبط شود، مطمئن شوید میکروفون شما قطع است. از چت برای مشارکت استفاده کنید.', 'recording_info' => 'این اتاق ممکن است ضبط شود.', + 'recording_recap_accept' => 'من به ضبط و به رونویسی و خلاصه‌سازی صدا توسط هوش مصنوعی رضایت می‌دهم.', + 'recording_recap_info' => 'این اتاق ممکن است ضبط شود و صدای آن ممکن است توسط هوش مصنوعی رونویسی و خلاصه شود.', 'recording_video_accept' => '(اختیاری) تصویر ویدئویی من ممکن است ضبط شود.', 'recordings' => [ 'access' => 'دسترسی', @@ -424,11 +428,13 @@ ], 'title' => 'شرکت‌کنندگان', ], + 'recap' => [ + 'title' => 'خلاصه جلسه (هوش مصنوعی)', + ], 'recordings' => [ 'auto_start_recording' => 'شروع خودکار ضبط', 'recap' => 'ایجاد خلاصه جلسه (هوش مصنوعی)', 'recap_unavailable' => 'پس از یک بار ورود از طریق OpenID Connect در دسترس است.', - 'recap_requires_record' => 'فقط زمانی اعمال می‌شود که ضبط ویدئوکنفرانس فعال باشد.', 'record_attendance' => 'ثبت حضور شرکت‌کنندگان', 'record_video_conference' => 'ضبط کنفرانس ویدئویی', 'title' => 'ضبط‌ها', diff --git a/lang/fr/rooms.php b/lang/fr/rooms.php index 04bc3c9487..da3ba1723b 100644 --- a/lang/fr/rooms.php +++ b/lang/fr/rooms.php @@ -348,11 +348,15 @@ 'title' => 'Liens de salles personnalisés', ], 'placeholder_name' => 'John Doe', + 'recap_accept' => 'J\'accepte la transcription et le résumé du son par une IA.', + 'recap_info' => 'Le son de cette réunion peut être transcrit et résumé par une IA. Aucun enregistrement n\'est publié.', 'recording_accept' => 'J\'accepte l\'enregistrement.', 'recording_attendance_accept' => 'Je donne mon autorisation à l\'enregistrement de ma présence.', 'recording_attendance_info' => 'La présence dans cette salle est enregistrée.', 'recording_hint' => 'Si vous refusez que votre voix soit enregistrée, éteignez votre microphone. Utilisez à la place le chat pour participer.', 'recording_info' => 'Cette salle peut être enregistrée.', + 'recording_recap_accept' => 'J\'accepte l\'enregistrement ainsi que la transcription et le résumé du son par une IA.', + 'recording_recap_info' => 'Cette salle peut être enregistrée, et le son peut être transcrit et résumé par une IA.', 'recording_video_accept' => '(Optionnel) Mon image vidéo peut être enregistrée.', 'recordings' => [ 'access' => 'Accès', @@ -485,11 +489,13 @@ ], 'title' => 'Participants', ], + 'recap' => [ + 'title' => 'Résumé de la réunion (IA)', + ], 'recordings' => [ 'auto_start_recording' => 'Enregistrement automatique au démarrage', 'recap' => 'Créer un résumé de la réunion (IA)', 'recap_unavailable' => 'Disponible après votre première connexion via OpenID Connect.', - 'recap_requires_record' => 'Ne s\'applique que si l\'enregistrement de la visioconférence est activé.', 'record_attendance' => 'Enregistrer l\'historique des présences', 'record_video_conference' => 'Enregistrer la vidéo conférence', 'title' => 'Enregistrements', diff --git a/resources/js/components/RoomJoinButton.vue b/resources/js/components/RoomJoinButton.vue index 3e7a435c78..637f53ebb7 100644 --- a/resources/js/components/RoomJoinButton.vue +++ b/resources/js/components/RoomJoinButton.vue @@ -89,10 +89,10 @@
- {{ $t("rooms.recording_info") }} + {{ $t(recordingConsentInfo) }} {{ $t("rooms.recording_hint") }}
-
+
@@ -315,7 +316,7 @@ const autoJoin = computed(() => { return false; } - if (features.value.recording) { + if (features.value.recording || features.value.recap) { return false; } @@ -326,6 +327,27 @@ const autoJoin = computed(() => { return true; }); +/** + * Consent texts for the recording and the meeting summary (recap) + */ +const recordingConsentInfo = computed(() => { + if (!features.value.recap) { + return "rooms.recording_info"; + } + return features.value.recording + ? "rooms.recording_recap_info" + : "rooms.recap_info"; +}); + +const recordingConsentAccept = computed(() => { + if (!features.value.recap) { + return "rooms.recording_accept"; + } + return features.value.recording + ? "rooms.recording_recap_accept" + : "rooms.recap_accept"; +}); + /** * Handle the page is restored from the back/forward cache after redirecting to BBB * The modal is still shown and loaded, close and reload the page diff --git a/resources/js/components/RoomTabSettings.vue b/resources/js/components/RoomTabSettings.vue index 80087941aa..24a0734b9f 100644 --- a/resources/js/components/RoomTabSettings.vue +++ b/resources/js/components/RoomTabSettings.vue @@ -249,22 +249,27 @@ const form = computed(() => { label: t("rooms.settings.recordings.auto_start_recording"), component: RoomTabSettingsToggleSwitch, }, - ...(settingsStore.getSetting("recap.enabled") && - userPermissions.can("manageRecap", props.room) - ? [ + ], + }, + ...(settingsStore.getSetting("recap.enabled") && + userPermissions.can("manageRecap", props.room) + ? [ + { + title: t("rooms.settings.recap.title"), + items: [ { setting: "recap", label: t("rooms.settings.recordings.recap"), component: RoomTabSettingsToggleSwitch, disabled: disabled.value || !settings.value.recap_available, warningMessage: settings.value.recap_available - ? t("rooms.settings.recordings.recap_requires_record") + ? null : t("rooms.settings.recordings.recap_unavailable"), }, - ] - : []), - ], - }, + ], + }, + ] + : []), { title: t("rooms.settings.restrictions.title"), items: [ diff --git a/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php b/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php index 19dade3ba9..5c0708ac62 100644 --- a/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php +++ b/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php @@ -24,7 +24,7 @@ use TiMacDonald\Log\LogFake; /** - * Tests for the meeting summary (recap) parameters on meeting start and the cancellation on room deletion + * Tests for the meeting summary (recap) parameters on meeting start and join, and the cancellation on room deletion */ class RoomRecapStartTest extends TestCase { @@ -169,7 +169,6 @@ public static function recapConditionProvider(): array 'invalid meta prefix' => ['invalid_meta_prefix'], 'room setting off' => ['room_setting_off'], 'room setting enforced off by room type' => ['enforced_off'], - 'recording off' => ['record_off'], 'owner without OIDC subject' => ['owner_without_sub'], 'room type without meeting type' => ['no_recap_type'], 'room type without sink' => ['no_recap_sink'], @@ -190,7 +189,6 @@ public function test_start_without_recap(string $condition) 'invalid_meta_prefix' => config(['recap.meta_prefix' => 'Recap']), 'room_setting_off' => $this->room->forceFill(['recap' => false])->save(), 'enforced_off' => $this->room->roomType->forceFill(['recap_default' => false, 'recap_enforced' => true])->save(), - 'record_off' => $this->room->forceFill(['record' => false])->save(), 'owner_without_sub' => $this->room->owner->forceFill(['oidc_sub' => null])->save(), 'no_recap_type' => $this->room->roomType->forceFill(['recap_type' => null])->save(), 'no_recap_sink' => $this->room->roomType->forceFill(['recap_sink' => null])->save(), @@ -207,6 +205,157 @@ public function test_start_without_recap(string $condition) Queue::assertNotPushed(RegisterRecapMeeting::class); } + public static function createParameterProvider(): array + { + $cases = []; + foreach ([true, false] as $recap) { + foreach ([true, false] as $record) { + foreach ([true, false] as $autoStart) { + $label = ($recap ? 'summary on' : 'summary off').', '.($record ? 'recording on' : 'recording off').', '.($autoStart ? 'auto start on' : 'auto start off'); + $cases[$label] = [$recap, $record, $autoStart]; + } + } + } + + return $cases; + } + + /** + * BBB records the meeting if the room asks for a recording or a meeting summary, + * the automatic recording start always follows the room + */ + #[DataProvider('createParameterProvider')] + public function test_start_record_parameters(bool $recap, bool $record, bool $autoStart) + { + Queue::fake(); + $this->room->forceFill(['recap' => $recap, 'record' => $record, 'auto_start_recording' => $autoStart])->save(); + + $createParameters = $this->startRoom(); + + $this->assertEquals($recap || $record ? 'true' : 'false', $createParameters['record']); + $this->assertEquals($autoStart ? 'true' : 'false', $createParameters['autoStartRecording']); + $this->assertEqualsCanonicalizing($recap ? self::RECAP_META_KEYS : [], $this->recapMetaKeys($createParameters)); + + // The meeting keeps the recording setting of the room + $meeting = $this->room->refresh()->latestMeeting; + $this->assertSame($record, $meeting->record); + $this->assertSame($recap, $meeting->recap); + } + + /** + * Fake response of the BBB getMeetingInfo call for a running meeting + */ + private function addRunningMeetingInfoRequest(): void + { + $this->bbbFaker->addRequest(fn (Request $request) => Http::response(' + + SUCCESS + test + '.$this->room->latestMeeting->id.' + '.self::INTERNAL_MEETING_ID.' + true + true + false + false + 0 + 0 + 0 + 0 + 0 + false + ')); + } + + /** + * Summary-only meeting: consent is required on start and join, camera video is never recorded + */ + public function test_start_and_join_summary_only() + { + Queue::fake(); + $this->room->forceFill(['record' => false])->save(); + + // Start requirements and consent + $this->actingAs($this->room->owner)->optionsJson(route('api.v1.rooms.start-requirements', ['room' => $this->room])) + ->assertSuccessful() + ->assertJsonPath('data.features.recording', false) + ->assertJsonPath('data.features.recap', true); + + $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.start', ['room' => $this->room]), ['consent_record' => false]) + ->assertStatus(422) + ->assertJsonValidationErrors(['consent_record']) + ->assertJsonMissingValidationErrors(['consent_record_video']); + + $this->bbbFaker->addCreateMeetingRequest(); + $joinUrl = $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.start', ['room' => $this->room]), ['consent_record' => true, 'consent_record_video' => true]) + ->assertSuccessful() + ->json('url'); + $this->assertStringContainsString('userdata-bbb_record_video=false', $joinUrl); + + // Join requirements and consent + $this->room->refresh(); + $this->actingAs($this->room->owner)->optionsJson(route('api.v1.rooms.join-requirements', ['room' => $this->room])) + ->assertSuccessful() + ->assertJsonPath('data.features.recording', false) + ->assertJsonPath('data.features.recap', true); + + $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.join', ['room' => $this->room])) + ->assertStatus(422) + ->assertJsonValidationErrors(['consent_record']) + ->assertJsonMissingValidationErrors(['consent_record_video']); + + $this->addRunningMeetingInfoRequest(); + $joinUrl = $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.join', ['room' => $this->room]), ['consent_record' => true, 'consent_record_video' => true]) + ->assertSuccessful() + ->json('url'); + $this->assertStringContainsString('userdata-bbb_record_video=false', $joinUrl); + } + + /** + * Meeting with recording and summary: the consent to record the own video is asked as for a recording + */ + public function test_join_recording_and_summary() + { + Queue::fake(); + + $this->startRoom(); + $this->room->refresh(); + + $this->actingAs($this->room->owner)->optionsJson(route('api.v1.rooms.join-requirements', ['room' => $this->room])) + ->assertSuccessful() + ->assertJsonPath('data.features.recording', true) + ->assertJsonPath('data.features.recap', true); + + $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.join', ['room' => $this->room])) + ->assertStatus(422) + ->assertJsonValidationErrors(['consent_record', 'consent_record_video']); + + $this->addRunningMeetingInfoRequest(); + $joinUrl = $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.join', ['room' => $this->room]), ['consent_record' => true, 'consent_record_video' => true]) + ->assertSuccessful() + ->json('url'); + $this->assertStringContainsString('userdata-bbb_record_video=true', $joinUrl); + } + + /** + * Without recording and summary no consent is needed and the video parameter is not passed + */ + public function test_start_without_recording_and_summary() + { + Queue::fake(); + $this->room->forceFill(['record' => false, 'recap' => false])->save(); + + $this->actingAs($this->room->owner)->optionsJson(route('api.v1.rooms.start-requirements', ['room' => $this->room])) + ->assertSuccessful() + ->assertJsonPath('data.features.recording', false) + ->assertJsonPath('data.features.recap', false); + + $this->bbbFaker->addCreateMeetingRequest(); + $joinUrl = $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.start', ['room' => $this->room])) + ->assertSuccessful() + ->json('url'); + $this->assertStringNotContainsString('userdata-bbb_record_video', $joinUrl); + } + public function test_room_deletion_cancels_registrations() { Queue::fake(); diff --git a/tests/Backend/Unit/Jobs/ProcessRecordingTest.php b/tests/Backend/Unit/Jobs/ProcessRecordingTest.php index e4c33ede54..901e16b3eb 100644 --- a/tests/Backend/Unit/Jobs/ProcessRecordingTest.php +++ b/tests/Backend/Unit/Jobs/ProcessRecordingTest.php @@ -322,4 +322,76 @@ public function test_public() $this->assertTrue(Storage::disk('recordings')->directoryExists(self::INTERNAL_MEETING_ID)); $this->assertFileExists(Storage::disk('recordings')->path(self::INTERNAL_MEETING_ID.'/notes/notes.pdf')); } + + /** + * The recording of a meeting with a meeting summary but without recording is discarded + */ + public function test_summary_only_meeting_is_discarded() + { + Storage::fake('recordings'); + Storage::fake('recordings-spool'); + + Meeting::factory()->create([ + 'id' => self::EXTERNAL_MEETING_ID, + 'record' => false, + 'recap' => true, + ]); + + Log::swap(new LogFake); + Queue::fake(); + + copy(base_path('tests/Backend/Fixtures/Recordings/multiple.tar'), Storage::disk('recordings-spool')->path('multiple.tar')); + + $job = (new ProcessRecording('multiple.tar'))->withFakeQueueInteractions(); + + $job->handle(); + + $job->assertNotFailed(); + + // Nothing stored or shown + $this->assertDatabaseCount('recordings', 0); + $this->assertDatabaseCount('recording_formats', 0); + $this->assertCount(0, Storage::disk('recordings')->allFiles()); + $this->assertFalse(Storage::disk('recordings')->directoryExists(self::INTERNAL_MEETING_ID)); + + // Spool file removed as after a successful import + $this->assertCount(0, Storage::disk('recordings-spool')->allFiles()); + + // One log line with the meeting ID only + Log::assertLoggedTimes(fn (LogEntry $log) => str_starts_with($log->message, 'Discarded recording of meeting'), 1); + Log::assertLogged(fn (LogEntry $log) => str_starts_with($log->message, 'Discarded recording of meeting') + && $log->level === 'info' + && $log->context === ['meeting' => self::EXTERNAL_MEETING_ID]); + Log::assertNotLogged(fn (LogEntry $log) => str_contains($log->message.json_encode($log->context), self::TITLE)); + } + + /** + * The recording of a meeting with recording and meeting summary is imported as before + */ + public function test_recording_with_summary_is_imported() + { + Storage::fake('recordings'); + Storage::fake('recordings-spool'); + + $meeting = Meeting::factory()->create([ + 'id' => self::EXTERNAL_MEETING_ID, + 'record' => true, + 'recap' => true, + ]); + + Log::swap(new LogFake); + Queue::fake(); + + copy(base_path('tests/Backend/Fixtures/Recordings/multiple.tar'), Storage::disk('recordings-spool')->path('multiple.tar')); + + $job = (new ProcessRecording('multiple.tar'))->withFakeQueueInteractions(); + + $job->handle(); + + $this->assertCount(0, Storage::disk('recordings-spool')->allFiles()); + $this->assertCount(1, $meeting->room->recordings); + $this->assertCount(5, $meeting->room->recordings->first()->formats); + $this->assertFileExists(Storage::disk('recordings')->path(self::INTERNAL_MEETING_ID.'/notes/notes.pdf')); + Log::assertNotLogged(fn (LogEntry $log) => str_starts_with($log->message, 'Discarded recording of meeting')); + } } From dc31cc5c7a0bb2ae7817f66a340130fbc5874e05 Mon Sep 17 00:00:00 2001 From: timo Date: Fri, 6 Nov 2026 15:38:06 +0100 Subject: [PATCH 10/18] Document meeting summaries without recording and the consent texts --- CHANGELOG.md | 2 +- .../08-advanced/10-meeting-summaries.md | 51 ++++++++++++++----- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80fde943bc..32bfc6e012 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Experimental AI meeting summaries of recorded meetings via an external summary service: room setting for the room owner, meeting type and destination per room type, owner registration and cancellation on room deletion +- Experimental AI meeting summaries via an external summary service, independent of the recording setting of the room: room setting for the room owner in its own section, meeting type and destination per room type, owner registration and cancellation on room deletion, consent texts for meetings with summary only and with recording and summary; playback recordings of meetings with summary only are not imported ## [v4.20.1] - 2026-11-19 diff --git a/docs/docs/administration/08-advanced/10-meeting-summaries.md b/docs/docs/administration/08-advanced/10-meeting-summaries.md index 112aa0304b..343f72d45f 100644 --- a/docs/docs/administration/08-advanced/10-meeting-summaries.md +++ b/docs/docs/administration/08-advanced/10-meeting-summaries.md @@ -1,6 +1,6 @@ --- title: Meeting summaries -description: Guide to setting up AI meeting summaries of recorded meetings with an external summary service +description: Guide to setting up AI meeting summaries with an external summary service --- :::note @@ -11,15 +11,17 @@ This is a new experimental feature and therefore not enabled by default. ## Introduction -PILOS can ask an external meeting summary service to transcribe and summarize recorded meetings. +PILOS can ask an external meeting summary service to transcribe and summarize meetings. The summary is delivered to the room owner by the summary service, for example as a document in a document editor. PILOS itself does not process the recording; it only marks the meeting at BigBlueButton and tells the summary service who the owner is. +Meeting summaries do not require the recording setting of the room. When a meeting starts in a room with meeting summaries enabled, PILOS: -1. adds the meta parameters `meta_-v=1`, `meta_-enabled=true`, `meta_-type` and `meta_-sink` to the BigBlueButton `create` call, -2. stores the internal meeting ID returned by BigBlueButton (the ID of the later recording), -3. registers the room owner with the summary service in a queued job (`PUT /api/v1/registrations/{internal meeting id}`). +1. sends `record=true` to BigBlueButton, even if the recording of the video conference is disabled for the room (BigBlueButton only exports meetings with recording marks), +2. adds the meta parameters `meta_-v=1`, `meta_-enabled=true`, `meta_-type` and `meta_-sink` to the BigBlueButton `create` call, +3. stores the internal meeting ID returned by BigBlueButton (the ID of the later recording), +4. registers the room owner with the summary service in a queued job (`PUT /api/v1/registrations/{internal meeting id}`). The BigBlueButton server needs a recording exporter that sends the raw recordings of these meetings to the summary service. Only meetings with both the meta parameters and a registration are summarized. @@ -67,7 +69,7 @@ Custom create parameters of a room type must not contain `meta_-*` param ### 3. Room setting -The room owner, and only the room owner, can enable **Create a meeting summary (AI)** in the recording section of the room settings. +The room owner, and only the room owner, can enable **Create a meeting summary (AI)** in the **Meeting summary (AI)** section of the room settings. Co-owners and administrators cannot change it. A meeting is summarized only if, when it starts: @@ -75,19 +77,43 @@ A meeting is summarized only if, when it starts: - the feature is enabled, - the room owner has an OpenID Connect subject, - the room setting is enabled (and not enforced off by the room type), -- the recording of the video conference is enabled for the room, - the room type has a meeting type and a summary destination. -The recording must then actually be started in the meeting (or start automatically); without recording marks, BigBlueButton does not export the meeting. +The recording setting of the room is not one of these conditions. + +Moderators decide which parts of the meeting are summarized: they start and stop the capture with the record button of BigBlueButton. +**Automatic recording start** keeps the value of the room setting, also in meetings with a summary only. +Without recording marks, BigBlueButton does not export the meeting and no summary is created. + +### Meetings with a summary but without recording + +If the room has meeting summaries enabled but the recording of the video conference disabled: + +- The camera video of the participants is never recorded; PILOS does not ask for the consent to record the own video. +- PILOS does not import the playback recording of the meeting. BigBlueButton still creates it, as the meeting is recorded for the summary service, + but when the recording is imported, PILOS deletes it from the spool directory without storing it and logs one info line with the meeting ID. + Participants never see a recording nobody asked for. + +Meetings with both recording and meeting summary enabled are recorded and imported as before. ## Consent -There is no separate consent for meeting summaries. The existing recording consent applies to all participants. -As the recording may be transcribed and summarized by an AI, the recording consent text should mention this. -Customize the texts `rooms.recording_info` and `rooms.recording_accept` as described in [Locales](../09-customisation/02-locales.md), for example: +Participants give one consent before starting or joining a meeting with recording or meeting summary; PILOS refuses the request without it. +The text depends on the meeting: + +| Meeting | Texts | Default (English) | +| -------------------------- | ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Summary only | `rooms.recap_info`, `rooms.recap_accept` | An AI may transcribe and summarize the audio of this meeting. No recording is published. / I consent to the transcription and AI summary of the audio. | +| Recording and summary | `rooms.recording_recap_info`, `rooms.recording_recap_accept` | This room may be recorded, and an AI may transcribe and summarize the audio. / I consent to the recording and to the transcription and AI summary of the audio. | +| Recording only (unchanged) | `rooms.recording_info`, `rooms.recording_accept` | This room may be recorded. / I consent to the recording. | + +The hint `rooms.recording_hint` (mute the microphone to avoid being recorded) is shown in all three cases. +The optional consent to record the own video (`rooms.recording_video_accept`) is only asked in meetings with recording. + +Customize the texts as described in [Locales](../09-customisation/02-locales.md), for example to name the summary service or the data protection notice: ```php -'recording_info' => 'This room may be recorded. The recording may be transcribed and summarized by an AI.', +'recap_info' => 'The audio of this meeting may be transcribed and summarized by an AI service of the university. No recording is published.', ``` ## Data flow and privacy @@ -99,6 +125,7 @@ Customize the texts `rooms.recording_info` and `rooms.recording_accept` as descr | Cancellation on room deletion: internal meeting ID | summary service | none | - PILOS stores the OpenID Connect subject in the users table, and the meeting summary flag and the internal meeting ID in the meetings table. They are deleted with the user or the meeting. +- PILOS does not store the playback recording of a meeting with a summary but without recording; it deletes the spool file on import. - The queued jobs contain only model IDs or the internal meeting ID, no subject or email. - Logs contain only meeting and internal meeting IDs, HTTP status codes and problem types, never the subject, email or token. - How long the summary service keeps the registration, recording and summary is configured there. From b1fada5a86d3c4bd9502cd05da6e3fc4836439cc Mon Sep 17 00:00:00 2001 From: timo Date: Wed, 11 Nov 2026 00:56:19 +0100 Subject: [PATCH 11/18] Poll meeting summary results and store them per meeting with recording access rules --- .../Commands/CleanupRecordingsCommand.php | 7 +- .../api/v1/MeetingSummaryController.php | 98 ++++ .../Requests/MeetingSummaryIndexRequest.php | 25 + .../Requests/UpdateMeetingSummaryRequest.php | 25 + app/Http/Resources/MeetingSummaryResource.php | 48 ++ app/Http/Resources/RoomResource.php | 1 + app/Jobs/PollMeetingSummary.php | 347 ++++++++++++ app/Models/MeetingSummary.php | 73 +++ app/Models/Room.php | 10 + app/Policies/RoomPolicy.php | 34 ++ app/Services/MeetingService.php | 6 + app/Services/RecapService.php | 32 ++ database/factories/MeetingSummaryFactory.php | 43 ++ ..._000000_create_meeting_summaries_table.php | 40 ++ routes/api.php | 9 + .../Feature/api/v1/MeetingSummaryTest.php | 315 +++++++++++ .../Console/CleanupRecordingsCommandTest.php | 25 + .../Unit/Jobs/PollMeetingSummaryTest.php | 518 ++++++++++++++++++ 18 files changed, 1655 insertions(+), 1 deletion(-) create mode 100644 app/Http/Controllers/api/v1/MeetingSummaryController.php create mode 100644 app/Http/Requests/MeetingSummaryIndexRequest.php create mode 100644 app/Http/Requests/UpdateMeetingSummaryRequest.php create mode 100644 app/Http/Resources/MeetingSummaryResource.php create mode 100644 app/Jobs/PollMeetingSummary.php create mode 100644 app/Models/MeetingSummary.php create mode 100644 database/factories/MeetingSummaryFactory.php create mode 100644 database/migrations/2026_11_11_000000_create_meeting_summaries_table.php create mode 100644 tests/Backend/Feature/api/v1/MeetingSummaryTest.php create mode 100644 tests/Backend/Unit/Jobs/PollMeetingSummaryTest.php diff --git a/app/Console/Commands/CleanupRecordingsCommand.php b/app/Console/Commands/CleanupRecordingsCommand.php index 13c2ae4fd6..0459cf0ecd 100644 --- a/app/Console/Commands/CleanupRecordingsCommand.php +++ b/app/Console/Commands/CleanupRecordingsCommand.php @@ -5,6 +5,7 @@ namespace App\Console\Commands; use App\Enums\TimePeriod; +use App\Models\MeetingSummary; use App\Models\Recording; use App\Settings\RecordingSettings; use Illuminate\Console\Command; @@ -24,7 +25,7 @@ class CleanupRecordingsCommand extends Command * * @var string */ - protected $description = 'Remove recordings after retention period'; + protected $description = 'Remove recordings and meeting summaries after retention period'; /** * Execute the console command. @@ -42,6 +43,10 @@ public function handle() Recording::where('start', '<', $day)->get()->each(function ($recording) { $recording->delete(); }); + + // Meeting summaries follow the retention period of the recordings + Log::info('Removing meeting summaries older than '.$day); + MeetingSummary::where('start', '<', $day)->delete(); } } } diff --git a/app/Http/Controllers/api/v1/MeetingSummaryController.php b/app/Http/Controllers/api/v1/MeetingSummaryController.php new file mode 100644 index 0000000000..d80603952c --- /dev/null +++ b/app/Http/Controllers/api/v1/MeetingSummaryController.php @@ -0,0 +1,98 @@ + + */ + private const LIST_COLUMNS = ['id', 'room_id', 'meeting_id', 'access', 'start', 'end', 'document_url', 'delivered_at']; + + public function index(Room $room, MeetingSummaryIndexRequest $request, GeneralSettings $generalSettings): AnonymousResourceCollection + { + $additional = []; + + // Sort direction, fallback/default is newest first + $sortOrder = match ($request->query('sort_direction')) { + 'asc' => 'ASC', + default => 'DESC', + }; + + // Filter, default is no filter + $filter = match ($request->query('filter')) { + 'everyone_access' => RecordingAccess::EVERYONE, + 'participant_access' => RecordingAccess::PARTICIPANT, + 'moderator_access' => RecordingAccess::MODERATOR, + 'owner_access' => RecordingAccess::OWNER, + default => null, + }; + + $resource = $room->meetingSummaries()->select(self::LIST_COLUMNS)->orderBy('start', $sortOrder)->orderBy('id'); + + // If user is not allowed to view all summaries, only query summaries that should be visible to the user + if (! Gate::allows('viewAllMeetingSummaries', $room)) { + $allowedAccess = [RecordingAccess::EVERYONE]; + + if ($room->isModerator(Auth::user())) { + $allowedAccess[] = RecordingAccess::MODERATOR; + $allowedAccess[] = RecordingAccess::PARTICIPANT; + } elseif ($room->isMember(Auth::user())) { + $allowedAccess[] = RecordingAccess::PARTICIPANT; + } + + $resource = $resource->whereIn('access', $allowedAccess); + } + + // count all before applying filters + $additional['meta']['total_no_filter'] = $resource->count(); + + if ($filter) { + $resource = $resource->where('access', $filter); + } + + return MeetingSummaryResource::collection($resource->paginate($generalSettings->pagination_page_size))->additional($additional); + } + + public function show(Room $room, MeetingSummary $meetingSummary): MeetingSummaryResource + { + $this->authorize('viewMeetingSummary', [$room, $meetingSummary]); + + return (new MeetingSummaryResource($meetingSummary))->withContent(); + } + + public function update(UpdateMeetingSummaryRequest $request, Room $room, MeetingSummary $meetingSummary): MeetingSummaryResource + { + $meetingSummary->access = $request->enum('access', RecordingAccess::class); + $meetingSummary->save(); + + return new MeetingSummaryResource($meetingSummary); + } + + public function destroy(Room $room, MeetingSummary $meetingSummary): Response + { + Log::info('Deleted meeting summary {summary} in room {room}', ['room' => $room->getLogLabel(), 'summary' => $meetingSummary->getLogLabel()]); + + $meetingSummary->delete(); + + return response()->noContent(); + } +} diff --git a/app/Http/Requests/MeetingSummaryIndexRequest.php b/app/Http/Requests/MeetingSummaryIndexRequest.php new file mode 100644 index 0000000000..afc40d36ea --- /dev/null +++ b/app/Http/Requests/MeetingSummaryIndexRequest.php @@ -0,0 +1,25 @@ +|string> + */ + public function rules(): array + { + return [ + 'filter' => [Rule::in(['everyone_access', 'participant_access', 'moderator_access', 'owner_access'])], + 'sort_direction' => [Rule::in(['asc', 'desc'])], + ]; + } +} diff --git a/app/Http/Requests/UpdateMeetingSummaryRequest.php b/app/Http/Requests/UpdateMeetingSummaryRequest.php new file mode 100644 index 0000000000..25084d3ba2 --- /dev/null +++ b/app/Http/Requests/UpdateMeetingSummaryRequest.php @@ -0,0 +1,25 @@ +|string> + */ + public function rules(): array + { + return [ + 'access' => ['required', Rule::enum(RecordingAccess::class)], + ]; + } +} diff --git a/app/Http/Resources/MeetingSummaryResource.php b/app/Http/Resources/MeetingSummaryResource.php new file mode 100644 index 0000000000..9a0187ec3b --- /dev/null +++ b/app/Http/Resources/MeetingSummaryResource.php @@ -0,0 +1,48 @@ +withContent = true; + + return $this; + } + + /** + * Transform the resource into an array. + * + * @return array + */ + public function toArray(Request $request): array + { + return [ + 'id' => $this->id, + 'model_name' => $this->model_name, + 'start' => $this->start, + 'end' => $this->end, + 'delivered_at' => $this->delivered_at, + 'access' => $this->access, + 'type' => $this->document_url !== null ? 'document' : 'content', + 'document_url' => $this->document_url, + 'content' => $this->when($this->withContent, fn () => $this->content), + ]; + } +} diff --git a/app/Http/Resources/RoomResource.php b/app/Http/Resources/RoomResource.php index cc784db201..fa2f133f4b 100644 --- a/app/Http/Resources/RoomResource.php +++ b/app/Http/Resources/RoomResource.php @@ -66,6 +66,7 @@ public function getDetails($latestMeeting) 'can_start' => Gate::inspect('start', [$this->resource])->allowed(), 'access_code' => $this->when(Gate::inspect('viewAccessCode', [$this->resource])->allowed(), $this->access_code), 'room_type_invalid' => $this->roomTypeInvalid, + 'has_meeting_summaries' => $this->resource->meetingSummaries()->exists(), 'current_user' => new UserResource(Auth::user())->withPermissions()->withoutRoles(), ]; } diff --git a/app/Jobs/PollMeetingSummary.php b/app/Jobs/PollMeetingSummary.php new file mode 100644 index 0000000000..02d670571f --- /dev/null +++ b/app/Jobs/PollMeetingSummary.php @@ -0,0 +1,347 @@ + + */ + public const POLL_DELAYS = [2, 5, 10, 30]; + + /** + * Minutes between polls after POLL_DELAYS + */ + public const POLL_INTERVAL = 60; + + /** + * Hours after the meeting end after which polling stops + */ + public const POLL_HOURS = 24; + + /** + * Maximum accepted size of a summary text in bytes (2 MiB) + */ + public const MAX_SUMMARY_BYTES = 2 * 1024 * 1024; + + /** + * Delete the job if the meeting no longer exists (e.g. room deleted). + * + * @var bool + */ + public $deleteWhenMissingModels = true; + + /** + * The number of times the job may be attempted, limited by retryUntil(). + * + * @var int + */ + public $tries = 0; + + /** + * The number of seconds after which the job's unique lock will be released. + * + * @var int + */ + public $uniqueFor = (self::POLL_HOURS + 1) * 3600; + + /** + * Create a new job instance. + * + * @param Meeting $meeting Ended meeting with a meeting summary + */ + public function __construct(public Meeting $meeting) {} + + /** + * Dispatch the first poll for an ended meeting + */ + public static function dispatchAfterEnd(Meeting $meeting): void + { + self::dispatch($meeting)->delay(now()->addMinutes(self::pollDelay(1))); + } + + /** + * Minutes to wait before the given poll (1 = first poll after the meeting end) + */ + public static function pollDelay(int $poll): int + { + return self::POLL_DELAYS[$poll - 1] ?? self::POLL_INTERVAL; + } + + /** + * Get the unique ID for the job. + */ + public function uniqueId(): string + { + return $this->meeting->id; + } + + /** + * Get the tags that should be assigned to the job. + * + * @return array + */ + public function tags(): array + { + return ['recap']; + } + + /** + * Safety limit, polling normally stops earlier (see pollAgain()). + */ + public function retryUntil(): DateTime + { + return now()->addHours(self::POLL_HOURS + 1); + } + + /** + * Execute the job. + */ + public function handle(RecapService $recapService): void + { + $recordId = $this->meeting->internal_meeting_id; + + if (! RecapService::isConfigured() || empty($recordId)) { + Log::warning('Meeting summary result of meeting {meeting} not polled; service or record id missing', ['meeting' => $this->meeting->id]); + + return; + } + + try { + $response = $recapService->getRegistration($recordId); + } catch (ConnectionException) { + $this->pollAgain('connection error'); + + return; + } + + if ($response->notFound()) { + Log::info('Meeting summary result of meeting {meeting} not available; registration not found', ['meeting' => $this->meeting->id]); + + return; + } + + if (! $response->successful()) { + $this->handleErrorResponse($response, 'registration'); + + return; + } + + $status = $response->json('status'); + $job = $response->json('job'); + + if ($status === 'cancelled' || ($job['state'] ?? null) === 'failed' || in_array($job['outcome'] ?? null, ['cancelled', 'purged'], true)) { + Log::info('Meeting summary of meeting {meeting} not delivered; registration {status}, job {state}, outcome {outcome}', [ + 'meeting' => $this->meeting->id, + 'status' => $status, + 'state' => $job['state'] ?? null, + 'outcome' => $job['outcome'] ?? null, + ]); + + return; + } + + if (($job['outcome'] ?? null) !== 'delivered') { + $this->pollAgain(); + + return; + } + + $this->storeResult($recapService, $recordId, $job); + } + + /** + * Store the delivered result and confirm the pickup of a summary text + * + * @param array{document_url?: string|null, summary_available?: bool, delivered_at?: string|null} $job + */ + private function storeResult(RecapService $recapService, string $recordId, array $job): void + { + $summaryAvailable = ($job['summary_available'] ?? false) === true; + $meetingSummary = MeetingSummary::where('meeting_id', $this->meeting->id)->first(); + + if ($meetingSummary === null) { + $content = null; + if ($summaryAvailable) { + try { + $summaryResponse = $recapService->getSummary($recordId); + } catch (ConnectionException) { + $this->pollAgain('connection error'); + + return; + } + + if ($summaryResponse->successful()) { + $content = $this->acceptedContent($summaryResponse->body()); + } elseif (! $summaryResponse->notFound()) { + $this->handleErrorResponse($summaryResponse, 'summary'); + + return; + } + } + + $documentUrl = $this->acceptedDocumentUrl($job['document_url'] ?? null); + + if ($documentUrl === null && $content === null) { + Log::notice('Meeting summary of meeting {meeting} delivered without a document link or summary text', ['meeting' => $this->meeting->id]); + } else { + $meetingSummary = new MeetingSummary; + $meetingSummary->room_id = $this->meeting->room_id; + $meetingSummary->meeting_id = $this->meeting->id; + $meetingSummary->access = RecordingAccess::OWNER; + $meetingSummary->start = $this->meeting->start; + $meetingSummary->end = $this->meeting->end; + $meetingSummary->document_url = $documentUrl; + $meetingSummary->content = $content; + $meetingSummary->delivered_at = $job['delivered_at'] ?? now(); + $meetingSummary->save(); + + Log::info('Stored meeting summary {summary} of meeting {meeting} in room {room}', [ + 'summary' => $meetingSummary->id, + 'meeting' => $this->meeting->id, + 'room' => $this->meeting->room_id, + 'type' => $content !== null ? 'content' : 'document', + ]); + } + } + + if ($summaryAvailable) { + $this->confirmSummary($recapService, $recordId); + } + } + + /** + * Confirm the pickup, so the service deletes the summary text + */ + private function confirmSummary(RecapService $recapService, string $recordId): void + { + try { + $response = $recapService->confirmSummary($recordId); + } catch (ConnectionException) { + $this->pollAgain('connection error'); + + return; + } + + if ($response->successful() || $response->notFound()) { + Log::info('Confirmed the pickup of the meeting summary of meeting {meeting}', ['meeting' => $this->meeting->id]); + + return; + } + + $this->handleErrorResponse($response, 'summary confirmation'); + } + + /** + * Returns the summary text if it is valid UTF-8 and within the size limit + */ + private function acceptedContent(string $content): ?string + { + if (strlen($content) > self::MAX_SUMMARY_BYTES || ! mb_check_encoding($content, 'UTF-8')) { + Log::warning('Meeting summary text of meeting {meeting} rejected; {bytes} bytes, limit {limit} bytes, UTF-8 required', [ + 'meeting' => $this->meeting->id, + 'bytes' => strlen($content), + 'limit' => self::MAX_SUMMARY_BYTES, + ]); + + return null; + } + + return $content; + } + + /** + * Returns the document link if it is an absolute http(s) URL, as it is shown as a link to users + */ + private function acceptedDocumentUrl(mixed $url): ?string + { + if ($url === null) { + return null; + } + + $scheme = is_string($url) ? strtolower((string) parse_url($url, PHP_URL_SCHEME)) : ''; + if (filter_var($url, FILTER_VALIDATE_URL) === false || ! in_array($scheme, ['http', 'https'], true)) { + Log::warning('Meeting summary document link of meeting {meeting} rejected; not an http(s) URL', ['meeting' => $this->meeting->id]); + + return null; + } + + return $url; + } + + /** + * Retry later on rate limits and server errors, stop on other errors + */ + private function handleErrorResponse(Response $response, string $request): void + { + if (RecapService::isRetryable($response)) { + $this->pollAgain('status '.$response->status()); + + return; + } + + Log::error('Meeting summary {request} request for meeting {meeting} rejected with status {status}', [ + 'request' => $request, + 'meeting' => $this->meeting->id, + 'status' => $response->status(), + 'type' => $response->json('type'), + ]); + $this->fail('Meeting summary '.$request.' request rejected with status '.$response->status()); + } + + /** + * Release the job for the next poll, or give up if the next poll would be too late + * + * @param string|null $error Reason if the poll failed + */ + private function pollAgain(?string $error = null): void + { + if ($error !== null) { + Log::warning('Polling the meeting summary result of meeting {meeting} failed: {error}', ['meeting' => $this->meeting->id, 'error' => $error]); + } + + $delay = self::pollDelay($this->attempts() + 1); + $deadline = ($this->meeting->end ?? $this->meeting->start)->copy()->addHours(self::POLL_HOURS); + + if (now()->addMinutes($delay)->greaterThan($deadline)) { + Log::notice('Stopped polling the meeting summary result of meeting {meeting}; no result {hours} hours after the meeting end', [ + 'meeting' => $this->meeting->id, + 'hours' => self::POLL_HOURS, + ]); + + return; + } + + $this->release($delay * 60); + } +} diff --git a/app/Models/MeetingSummary.php b/app/Models/MeetingSummary.php new file mode 100644 index 0000000000..ad754aa2ae --- /dev/null +++ b/app/Models/MeetingSummary.php @@ -0,0 +1,73 @@ + + */ + protected $fillable = [ + 'room_id', + 'meeting_id', + 'access', + 'start', + 'end', + 'document_url', + 'content', + 'delivered_at', + ]; + + /** + * The summary text is only sent to the frontend by the show endpoint. + * + * @var list + */ + protected $hidden = [ + 'content', + ]; + + protected $casts = [ + 'start' => 'datetime', + 'end' => 'datetime', + 'delivered_at' => 'datetime', + 'access' => RecordingAccess::class, + ]; + + public function getLogLabel(): string + { + return $this->id.' (meeting '.$this->meeting_id.')'; + } + + /** + * Room the summary belongs to + */ + public function room(): BelongsTo + { + return $this->belongsTo(Room::class); + } + + /** + * Meeting the summary belongs to + */ + public function meeting(): BelongsTo + { + return $this->belongsTo(Meeting::class); + } +} diff --git a/app/Models/Room.php b/app/Models/Room.php index 41eef82f90..1857684ba2 100644 --- a/app/Models/Room.php +++ b/app/Models/Room.php @@ -181,6 +181,16 @@ public function recordings() return $this->hasMany(Recording::class)->chaperone(); } + /** + * Meeting summaries (results of the meeting summary service) + * + * @return HasMany + */ + public function meetingSummaries() + { + return $this->hasMany(MeetingSummary::class)->chaperone(); + } + /** * Room owner * diff --git a/app/Policies/RoomPolicy.php b/app/Policies/RoomPolicy.php index 15598f356b..1c0d2a5498 100644 --- a/app/Policies/RoomPolicy.php +++ b/app/Policies/RoomPolicy.php @@ -5,6 +5,7 @@ namespace App\Policies; use App\Enums\RecordingAccess; +use App\Models\MeetingSummary; use App\Models\RecordingFormat; use App\Models\Room; use App\Models\RoomFile; @@ -272,6 +273,39 @@ public function viewRecordingFormat(?User $user, Room $room, RecordingFormat $re return false; } + /** + * Determine whether the user can see all meeting summaries of the room, regardless of their access setting + */ + public function viewAllMeetingSummaries(User $user, Room $room): bool + { + return $user->can('manageMeetingSummaries', $room) || $user->can('rooms.viewAll'); + } + + /** + * Determine whether the user can change the access of and delete meeting summaries + */ + public function manageMeetingSummaries(User $user, Room $room): bool + { + return $room->owner->is($user) || $room->isCoOwner($user) || $user->can('rooms.manage'); + } + + /** + * Determine whether the user can view a meeting summary, based on its access setting + */ + public function viewMeetingSummary(?User $user, Room $room, MeetingSummary $meetingSummary): bool + { + if ($user && $user->can('viewAllMeetingSummaries', $room)) { + return true; + } + + return match ($meetingSummary->access) { + RecordingAccess::EVERYONE => true, + RecordingAccess::PARTICIPANT => $room->isMember($user), + RecordingAccess::MODERATOR => $room->isModerator($user), + default => false, + }; + } + public function viewStreaming(User $user, Room $room) { return $user->can('manageStreaming', $room) || $user->can('rooms.viewAll'); diff --git a/app/Services/MeetingService.php b/app/Services/MeetingService.php index 63810d6906..11f41bec84 100644 --- a/app/Services/MeetingService.php +++ b/app/Services/MeetingService.php @@ -9,6 +9,7 @@ use App\Events\RoomEnded; use App\Http\Requests\JoinMeetingRequest; use App\Http\Requests\StartMeetingRequest; +use App\Jobs\PollMeetingSummary; use App\Models\Meeting; use App\Models\MeetingAttendee; use App\Models\User; @@ -518,6 +519,11 @@ public function setEnd(): void RoomEnded::dispatch($this->meeting->room); + // Poll the meeting summary service for the result of this meeting + if ($this->meeting->recap && ! empty($this->meeting->internal_meeting_id) && RecapService::isConfigured()) { + PollMeetingSummary::dispatchAfterEnd($this->meeting); + } + // set end time of the attendance to the end time of the meeting // for all users that have been present to the end foreach ($this->meeting->attendees()->whereNull('leave')->get() as $attendee) { diff --git a/app/Services/RecapService.php b/app/Services/RecapService.php index 28bdaa4aad..21afa4de4a 100644 --- a/app/Services/RecapService.php +++ b/app/Services/RecapService.php @@ -63,6 +63,38 @@ public function cancel(string $recordId): Response return $this->getHttpClient()->delete('api/v1/registrations/'.rawurlencode($recordId)); } + /** + * Get the registration of a meeting, including the result of its job + * + * @throws ConnectionException + */ + public function getRegistration(string $recordId): Response + { + return $this->getHttpClient()->get('api/v1/registrations/'.rawurlencode($recordId)); + } + + /** + * Get the summary text (Markdown) that the service holds for pickup + * + * @throws ConnectionException + */ + public function getSummary(string $recordId): Response + { + return $this->getHttpClient() + ->accept('text/markdown') + ->get('api/v1/registrations/'.rawurlencode($recordId).'/summary'); + } + + /** + * Confirm the pickup of the summary text, the service then deletes it + * + * @throws ConnectionException + */ + public function confirmSummary(string $recordId): Response + { + return $this->getHttpClient()->delete('api/v1/registrations/'.rawurlencode($recordId).'/summary'); + } + /** * Indicates whether a failed request should be retried (rate limit or server error) */ diff --git a/database/factories/MeetingSummaryFactory.php b/database/factories/MeetingSummaryFactory.php new file mode 100644 index 0000000000..52186545c6 --- /dev/null +++ b/database/factories/MeetingSummaryFactory.php @@ -0,0 +1,43 @@ + + */ +class MeetingSummaryFactory extends Factory +{ + protected $model = MeetingSummary::class; + + public function definition(): array + { + return [ + 'meeting_id' => Meeting::factory(), + 'room_id' => fn (array $attributes) => Meeting::find($attributes['meeting_id'])->room_id, + 'access' => RecordingAccess::OWNER, + 'start' => fn (array $attributes) => Meeting::find($attributes['meeting_id'])->start, + 'end' => fn (array $attributes) => Meeting::find($attributes['meeting_id'])->end, + 'document_url' => null, + 'content' => "# Meeting summary\n\nFixture summary text.\n", + 'delivered_at' => now(), + ]; + } + + /** + * Summary delivered as a link to a document in the sink + */ + public function document(): static + { + return $this->state(fn () => [ + 'document_url' => 'https://docs.recap.test/docs/'.$this->faker->uuid().'/', + 'content' => null, + ]); + } +} diff --git a/database/migrations/2026_11_11_000000_create_meeting_summaries_table.php b/database/migrations/2026_11_11_000000_create_meeting_summaries_table.php new file mode 100644 index 0000000000..8c2b4fc3ab --- /dev/null +++ b/database/migrations/2026_11_11_000000_create_meeting_summaries_table.php @@ -0,0 +1,40 @@ +id(); + $table->string('room_id'); + $table->foreign('room_id')->references('id')->on('rooms')->onDelete('cascade'); + $table->string('meeting_id')->unique(); + $table->foreign('meeting_id')->references('id')->on('meetings')->onDelete('cascade'); + $table->tinyInteger('access')->default(RecordingAccess::OWNER); + $table->dateTime('start'); + $table->dateTime('end')->nullable(); + $table->text('document_url')->nullable(); + $table->mediumText('content')->nullable(); + $table->dateTime('delivered_at')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('meeting_summaries'); + } +}; diff --git a/routes/api.php b/routes/api.php index 818e515084..bfc8ca56d2 100644 --- a/routes/api.php +++ b/routes/api.php @@ -10,6 +10,7 @@ use App\Http\Controllers\api\v1\auth\VerificationController; use App\Http\Controllers\api\v1\LocaleController; use App\Http\Controllers\api\v1\MeetingController; +use App\Http\Controllers\api\v1\MeetingSummaryController; use App\Http\Controllers\api\v1\PermissionController; use App\Http\Controllers\api\v1\RecordingController; use App\Http\Controllers\api\v1\RoleController; @@ -112,6 +113,12 @@ Route::delete('rooms/{room}/recordings/{recording}', [RecordingController::class, 'destroy'])->name('rooms.recordings.destroy'); }); + // Meeting summary operations + Route::middleware('can:manageMeetingSummaries,room')->group(function () { + Route::put('rooms/{room}/meetingSummaries/{meetingSummary}', [MeetingSummaryController::class, 'update'])->name('rooms.meetingSummaries.update'); + Route::delete('rooms/{room}/meetingSummaries/{meetingSummary}', [MeetingSummaryController::class, 'destroy'])->name('rooms.meetingSummaries.destroy'); + }); + // Streaming operations Route::middleware('can:viewStreaming,room')->group(function () { Route::get('rooms/{room}/streaming/config', [RoomStreamingController::class, 'getConfig'])->name('rooms.streaming.config.get'); @@ -192,6 +199,8 @@ Route::post('rooms/{room}/join', [RoomController::class, 'join'])->name('rooms.join'); Route::get('rooms/{room}/files', [RoomFileController::class, 'index'])->name('rooms.files.get'); Route::get('rooms/{room}/recordings', [RecordingController::class, 'index'])->name('rooms.recordings.index'); + Route::get('rooms/{room}/meetingSummaries', [MeetingSummaryController::class, 'index'])->name('rooms.meetingSummaries.index'); + Route::get('rooms/{room}/meetingSummaries/{meetingSummary}', [MeetingSummaryController::class, 'show'])->name('rooms.meetingSummaries.show'); }); diff --git a/tests/Backend/Feature/api/v1/MeetingSummaryTest.php b/tests/Backend/Feature/api/v1/MeetingSummaryTest.php new file mode 100644 index 0000000000..1e3223fd5e --- /dev/null +++ b/tests/Backend/Feature/api/v1/MeetingSummaryTest.php @@ -0,0 +1,315 @@ + + */ + protected array $summaries; + + protected User $participant; + + protected User $moderator; + + protected User $coOwner; + + protected User $otherUser; + + protected function setUp(): void + { + parent::setUp(); + + $this->seed(RolesAndPermissionsSeeder::class); + + $this->room = Room::factory()->create(['allow_guests' => true, 'access_code' => null]); + + $this->participant = User::factory()->create(); + $this->moderator = User::factory()->create(); + $this->coOwner = User::factory()->create(); + $this->otherUser = User::factory()->create(); + $this->room->members()->attach($this->participant, ['role' => RoomUserRole::USER]); + $this->room->members()->attach($this->moderator, ['role' => RoomUserRole::MODERATOR]); + $this->room->members()->attach($this->coOwner, ['role' => RoomUserRole::CO_OWNER]); + + $this->summaries = []; + foreach (['everyone' => RecordingAccess::EVERYONE, 'participant' => RecordingAccess::PARTICIPANT, 'moderator' => RecordingAccess::MODERATOR, 'owner' => RecordingAccess::OWNER] as $name => $access) { + $this->summaries[$name] = MeetingSummary::factory()->create([ + 'meeting_id' => Meeting::factory()->create(['room_id' => $this->room->id])->id, + 'access' => $access, + ]); + } + } + + /** + * Visible summaries per user, keyed by the access names of setUp() + * + * @return array}> + */ + public static function visibilityProvider(): array + { + return [ + 'guest' => ['guest', ['everyone']], + 'other user' => ['otherUser', ['everyone']], + 'participant' => ['participant', ['everyone', 'participant']], + 'moderator' => ['moderator', ['everyone', 'participant', 'moderator']], + 'co-owner' => ['coOwner', ['everyone', 'participant', 'moderator', 'owner']], + 'owner' => ['owner', ['everyone', 'participant', 'moderator', 'owner']], + ]; + } + + private function actAs(string $user): void + { + match ($user) { + 'guest' => Auth::logout(), + 'owner' => $this->actingAs($this->room->owner), + default => $this->actingAs($this->{$user}), + }; + } + + /** + * @param list $visible + */ + #[DataProvider('visibilityProvider')] + public function test_index_access(string $user, array $visible) + { + $this->actAs($user); + + $response = $this->getJson(route('api.v1.rooms.meetingSummaries.index', ['room' => $this->room])) + ->assertOk() + ->assertJsonPath('meta.total_no_filter', count($visible)); + + $expectedIds = collect($visible)->map(fn ($name) => $this->summaries[$name]->id)->sort()->values()->all(); + $this->assertSame($expectedIds, collect($response->json('data'))->pluck('id')->sort()->values()->all()); + + // The list never contains the summary text + foreach ($response->json('data') as $item) { + $this->assertArrayNotHasKey('content', $item); + $this->assertSame('content', $item['type']); + $this->assertSame('MeetingSummary', $item['model_name']); + } + } + + /** + * @param list $visible + */ + #[DataProvider('visibilityProvider')] + public function test_show_access(string $user, array $visible) + { + $this->actAs($user); + + foreach ($this->summaries as $name => $summary) { + $response = $this->getJson(route('api.v1.rooms.meetingSummaries.show', ['room' => $this->room, 'meetingSummary' => $summary])); + if (in_array($name, $visible)) { + $response->assertOk() + ->assertJsonPath('data.id', $summary->id) + ->assertJsonPath('data.content', $summary->content) + ->assertJsonPath('data.type', 'content'); + } else { + $response->assertForbidden(); + } + } + } + + public function test_view_all_permission() + { + $role = Role::factory()->create(); + $role->permissions()->attach(Permission::where('name', 'rooms.viewAll')->first()); + $this->otherUser->roles()->attach($role); + + $this->actingAs($this->otherUser) + ->getJson(route('api.v1.rooms.meetingSummaries.index', ['room' => $this->room])) + ->assertOk() + ->assertJsonCount(4, 'data'); + + $this->getJson(route('api.v1.rooms.meetingSummaries.show', ['room' => $this->room, 'meetingSummary' => $this->summaries['owner']])) + ->assertOk(); + } + + public function test_index_filter_and_sort() + { + $this->summaries['everyone']->update(['start' => now()->subDays(3)]); + $this->summaries['participant']->update(['start' => now()->subDays(2)]); + $this->summaries['moderator']->update(['start' => now()->subDays(1)]); + $this->summaries['owner']->update(['start' => now()]); + + $this->actingAs($this->room->owner); + + // Newest first by default + $this->getJson(route('api.v1.rooms.meetingSummaries.index', ['room' => $this->room])) + ->assertOk() + ->assertJsonPath('data.0.id', $this->summaries['owner']->id) + ->assertJsonPath('data.3.id', $this->summaries['everyone']->id); + + $this->getJson(route('api.v1.rooms.meetingSummaries.index', ['room' => $this->room, 'sort_direction' => 'asc'])) + ->assertOk() + ->assertJsonPath('data.0.id', $this->summaries['everyone']->id); + + $this->getJson(route('api.v1.rooms.meetingSummaries.index', ['room' => $this->room, 'filter' => 'moderator_access'])) + ->assertOk() + ->assertJsonCount(1, 'data') + ->assertJsonPath('data.0.id', $this->summaries['moderator']->id) + ->assertJsonPath('meta.total_no_filter', 4); + + $this->getJson(route('api.v1.rooms.meetingSummaries.index', ['room' => $this->room, 'filter' => 'invalid'])) + ->assertUnprocessable(); + } + + public function test_document_summary() + { + $summary = MeetingSummary::factory()->document()->create([ + 'meeting_id' => Meeting::factory()->create(['room_id' => $this->room->id])->id, + 'access' => RecordingAccess::EVERYONE, + ]); + + $this->getJson(route('api.v1.rooms.meetingSummaries.show', ['room' => $this->room, 'meetingSummary' => $summary])) + ->assertOk() + ->assertJsonPath('data.type', 'document') + ->assertJsonPath('data.document_url', $summary->document_url) + ->assertJsonPath('data.content', null); + } + + public function test_show_summary_of_other_room() + { + $otherSummary = MeetingSummary::factory()->create(['access' => RecordingAccess::EVERYONE]); + + $this->actingAs($this->room->owner) + ->getJson(route('api.v1.rooms.meetingSummaries.show', ['room' => $this->room, 'meetingSummary' => $otherSummary])) + ->assertNotFound(); + } + + /** + * @return array + */ + public static function manageProvider(): array + { + return [ + 'guest' => ['guest', 401], + 'other user' => ['otherUser', 403], + 'participant' => ['participant', 403], + 'moderator' => ['moderator', 403], + 'co-owner' => ['coOwner', 200], + 'owner' => ['owner', 200], + ]; + } + + #[DataProvider('manageProvider')] + public function test_update_access(string $user, int $status) + { + $summary = $this->summaries['owner']; + $this->actAs($user); + + $response = $this->putJson(route('api.v1.rooms.meetingSummaries.update', ['room' => $this->room, 'meetingSummary' => $summary]), ['access' => RecordingAccess::PARTICIPANT->value]) + ->assertStatus($status); + + $summary->refresh(); + if ($status === 200) { + $response->assertJsonPath('data.access', RecordingAccess::PARTICIPANT->value); + $this->assertSame(RecordingAccess::PARTICIPANT, $summary->access); + } else { + $this->assertSame(RecordingAccess::OWNER, $summary->access); + } + } + + public function test_update_invalid_data() + { + $summary = $this->summaries['owner']; + $this->actingAs($this->room->owner); + + $this->putJson(route('api.v1.rooms.meetingSummaries.update', ['room' => $this->room, 'meetingSummary' => $summary]), ['access' => 7]) + ->assertJsonValidationErrors(['access']); + $this->putJson(route('api.v1.rooms.meetingSummaries.update', ['room' => $this->room, 'meetingSummary' => $summary]), []) + ->assertJsonValidationErrors(['access']); + + // Summary of another room + $otherSummary = MeetingSummary::factory()->create(); + $this->putJson(route('api.v1.rooms.meetingSummaries.update', ['room' => $this->room, 'meetingSummary' => $otherSummary]), ['access' => RecordingAccess::EVERYONE->value]) + ->assertNotFound(); + } + + #[DataProvider('manageProvider')] + public function test_delete(string $user, int $status) + { + $summary = $this->summaries['everyone']; + $this->actAs($user); + + $this->deleteJson(route('api.v1.rooms.meetingSummaries.destroy', ['room' => $this->room, 'meetingSummary' => $summary])) + ->assertStatus($status === 200 ? 204 : $status); + + if ($status === 200) { + $this->assertModelMissing($summary); + + $this->deleteJson(route('api.v1.rooms.meetingSummaries.destroy', ['room' => $this->room, 'meetingSummary' => $summary])) + ->assertNotFound() + ->assertJson(['message' => 'model_not_found', 'model' => 'meeting_summary']); + } else { + $this->assertModelExists($summary); + } + } + + public function test_manage_permission() + { + $role = Role::factory()->create(); + $role->permissions()->attach(Permission::where('name', 'rooms.manage')->first()); + $this->otherUser->roles()->attach($role); + + $this->actingAs($this->otherUser) + ->putJson(route('api.v1.rooms.meetingSummaries.update', ['room' => $this->room, 'meetingSummary' => $this->summaries['owner']]), ['access' => RecordingAccess::EVERYONE->value]) + ->assertOk(); + $this->deleteJson(route('api.v1.rooms.meetingSummaries.destroy', ['room' => $this->room, 'meetingSummary' => $this->summaries['owner']])) + ->assertNoContent(); + } + + public function test_delete_with_room() + { + $otherSummary = MeetingSummary::factory()->create(); + + $this->actingAs($this->room->owner) + ->deleteJson(route('api.v1.rooms.destroy', ['room' => $this->room])) + ->assertNoContent(); + + foreach ($this->summaries as $summary) { + $this->assertModelMissing($summary); + } + $this->assertModelExists($otherSummary); + } + + public function test_room_shows_whether_it_has_summaries() + { + $this->getJson(route('api.v1.rooms.show', ['room' => $this->room])) + ->assertOk() + ->assertJsonPath('data.has_meeting_summaries', true); + + $this->room->meetingSummaries()->delete(); + + $this->getJson(route('api.v1.rooms.show', ['room' => $this->room])) + ->assertOk() + ->assertJsonPath('data.has_meeting_summaries', false); + } +} diff --git a/tests/Backend/Unit/Console/CleanupRecordingsCommandTest.php b/tests/Backend/Unit/Console/CleanupRecordingsCommandTest.php index 16ef5c9b20..1d65c09a55 100644 --- a/tests/Backend/Unit/Console/CleanupRecordingsCommandTest.php +++ b/tests/Backend/Unit/Console/CleanupRecordingsCommandTest.php @@ -5,6 +5,7 @@ namespace Tests\Backend\Unit\Console; use App\Enums\TimePeriod; +use App\Models\MeetingSummary; use App\Models\Recording; use App\Models\RecordingFormat; use Illuminate\Foundation\Testing\RefreshDatabase; @@ -71,4 +72,28 @@ public function test_retention_period_enabled() $this->assertDirectoryDoesNotExist(Storage::disk('recordings')->path($recording1->id)); $this->assertDirectoryExists(Storage::disk('recordings')->path($recording2->id)); } + + public function test_meeting_summaries_follow_retention_period() + { + $summary1 = MeetingSummary::factory()->create(['start' => now()->subDays(10)]); + $summary2 = MeetingSummary::factory()->document()->create(['start' => now()->subDays(7)]); + + // Unlimited retention period keeps all summaries + $this->recordingSettings->recording_retention_period = TimePeriod::UNLIMITED; + $this->recordingSettings->save(); + + $this->artisan('cleanup:recordings'); + + $this->assertModelExists($summary1); + $this->assertModelExists($summary2); + + // Set the retention period to a week + $this->recordingSettings->recording_retention_period = TimePeriod::ONE_WEEK; + $this->recordingSettings->save(); + + $this->artisan('cleanup:recordings'); + + $this->assertModelMissing($summary1); + $this->assertModelExists($summary2); + } } diff --git a/tests/Backend/Unit/Jobs/PollMeetingSummaryTest.php b/tests/Backend/Unit/Jobs/PollMeetingSummaryTest.php new file mode 100644 index 0000000000..a148701dde --- /dev/null +++ b/tests/Backend/Unit/Jobs/PollMeetingSummaryTest.php @@ -0,0 +1,518 @@ + self::SERVICE_URL, + 'recap.frontend_token' => self::FRONTEND_TOKEN, + ]); + + $this->meeting = Meeting::factory()->create([ + 'recap' => true, + 'internal_meeting_id' => self::RECORD_ID, + 'start' => now()->subHour(), + 'end' => now()->subMinutes(2), + ]); + } + + private function createJob(int $attempts = 1): PollMeetingSummary + { + $job = (new PollMeetingSummary($this->meeting))->withFakeQueueInteractions(); + $job->job->attempts = $attempts; + + return $job; + } + + /** + * Registration response (metadata-interface.md section 2.3 and 2.7) + * + * @param array|null $job + * @return array + */ + private function registration(string $status = 'matched', ?array $job = []): array + { + return [ + 'schema_version' => '1.1.0', + 'record_id' => self::RECORD_ID, + 'meeting_id' => $this->meeting->id, + 'frontend_id' => 'pilos-fixture', + 'status' => $status, + 'created_at' => '2026-10-29T10:00:00Z', + 'updated_at' => '2026-10-29T10:00:00Z', + 'expires_at' => null, + 'job' => $job === null ? null : array_merge([ + 'job_id' => '7f0c2d4e-1b2a-4c3d-8e9f-0a1b2c3d4e5f', + 'state' => 'running', + 'held_reason' => null, + 'outcome' => null, + 'delivered_at' => null, + 'document_url' => null, + 'summary_available' => false, + ], $job), + ]; + } + + /** + * @return array + */ + private function deliveredFrontend(): array + { + return $this->registration('matched', [ + 'state' => 'delivered', + 'outcome' => 'delivered', + 'delivered_at' => '2026-10-29T11:00:00Z', + 'summary_available' => true, + ]); + } + + private function assertSummaryNotLogged(): void + { + Log::assertNotLogged(function (LogEntry $log) { + $entry = $log->message.json_encode($log->context); + + return str_contains($entry, 'FIXTURE-SUMMARY-SECRET-TEXT') || str_contains($entry, 'Fixture meeting summary'); + }); + } + + public function test_meeting_end_dispatches_first_poll() + { + Queue::fake(); + $this->freezeSecond(); + + $meeting = Meeting::factory()->create(['recap' => true, 'internal_meeting_id' => self::RECORD_ID, 'end' => null]); + (new MeetingService($meeting))->setEnd(); + + Queue::assertPushed(PollMeetingSummary::class, function (PollMeetingSummary $job) use ($meeting) { + return $job->meeting->is($meeting) && $job->delay->equalTo(now()->addMinutes(2)); + }); + } + + public function test_meeting_end_without_summary_dispatches_nothing() + { + Queue::fake(); + + $meeting = Meeting::factory()->create(['recap' => false, 'internal_meeting_id' => self::RECORD_ID, 'end' => null]); + (new MeetingService($meeting))->setEnd(); + + config(['recap.service_url' => null]); + $meeting = Meeting::factory()->create(['recap' => true, 'internal_meeting_id' => self::RECORD_ID, 'end' => null]); + (new MeetingService($meeting))->setEnd(); + + Queue::assertNotPushed(PollMeetingSummary::class); + } + + public function test_document_result_is_stored() + { + Http::fake([ + self::REGISTRATION_URL => Http::response($this->registration('matched', [ + 'state' => 'cleaned', + 'outcome' => 'delivered', + 'delivered_at' => '2026-10-29T11:00:00Z', + 'document_url' => self::DOCUMENT_URL, + ])), + ]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertNotFailed(); + $job->assertNotReleased(); + + $summary = MeetingSummary::sole(); + $this->assertSame(self::DOCUMENT_URL, $summary->document_url); + $this->assertNull($summary->content); + $this->assertSame(RecordingAccess::OWNER, $summary->access); + $this->assertTrue($summary->room->is($this->meeting->room)); + $this->assertEquals($this->meeting->start, $summary->start); + $this->assertEquals($this->meeting->end, $summary->end); + $this->assertSame('2026-10-29 11:00:00', $summary->delivered_at->format('Y-m-d H:i:s')); + + // Only the registration is requested, no summary text + Http::assertSentCount(1); + Http::assertSent(function (Request $request) { + return $request->method() === 'GET' + && $request->url() === self::REGISTRATION_URL + && $request->hasHeader('Authorization', 'Bearer '.self::FRONTEND_TOKEN); + }); + } + + public function test_frontend_result_is_stored_and_confirmed() + { + Http::fake([ + self::SUMMARY_URL => Http::sequence() + ->push(self::SUMMARY_MARKDOWN, 200, ['Content-Type' => 'text/markdown; charset=utf-8']) + ->push(null, 204), + self::REGISTRATION_URL => Http::response($this->deliveredFrontend()), + ]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertNotFailed(); + $job->assertNotReleased(); + + $summary = MeetingSummary::sole(); + $this->assertNull($summary->document_url); + $this->assertSame(self::SUMMARY_MARKDOWN, $summary->content); + $this->assertSame(RecordingAccess::OWNER, $summary->access); + + // Registration, summary text, then the confirmation + $recorded = Http::recorded()->map(fn ($pair) => $pair[0]->method().' '.$pair[0]->url())->all(); + $this->assertSame([ + 'GET '.self::REGISTRATION_URL, + 'GET '.self::SUMMARY_URL, + 'DELETE '.self::SUMMARY_URL, + ], $recorded); + + $this->assertSummaryNotLogged(); + } + + public function test_frontend_result_confirmation_is_retried() + { + Http::fake([ + self::SUMMARY_URL => Http::sequence() + ->push(self::SUMMARY_MARKDOWN, 200, ['Content-Type' => 'text/markdown; charset=utf-8']) + ->push(null, 503) + ->push(null, 204), + self::REGISTRATION_URL => Http::response($this->deliveredFrontend()), + ]); + + // Confirmation fails, the summary is stored and the job polls again + $job = $this->createJob(); + $job->handle(new RecapService); + $job->assertReleased(5 * 60); + $this->assertSame(self::SUMMARY_MARKDOWN, MeetingSummary::sole()->content); + + // The next poll only confirms the pickup, the text is not fetched again + $job = $this->createJob(2); + $job->handle(new RecapService); + $job->assertNotReleased(); + $job->assertNotFailed(); + + $this->assertSame(1, MeetingSummary::count()); + $recorded = Http::recorded()->map(fn ($pair) => $pair[0]->method().' '.$pair[0]->url())->all(); + $this->assertSame([ + 'GET '.self::REGISTRATION_URL, + 'GET '.self::SUMMARY_URL, + 'DELETE '.self::SUMMARY_URL, + 'GET '.self::REGISTRATION_URL, + 'DELETE '.self::SUMMARY_URL, + ], $recorded); + + $this->assertSummaryNotLogged(); + } + + public function test_too_large_summary_is_rejected() + { + Http::fake([ + self::SUMMARY_URL => Http::sequence() + ->push(str_repeat('a', PollMeetingSummary::MAX_SUMMARY_BYTES + 1), 200, ['Content-Type' => 'text/markdown; charset=utf-8']) + ->push(null, 204), + self::REGISTRATION_URL => Http::response($this->deliveredFrontend()), + ]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertNotFailed(); + $job->assertNotReleased(); + $this->assertSame(0, MeetingSummary::count()); + // The pickup is still confirmed, so the service deletes the text + Http::assertSent(fn (Request $request) => $request->method() === 'DELETE' && $request->url() === self::SUMMARY_URL); + Log::assertLogged(fn (LogEntry $log) => $log->level === 'warning' && $log->context['bytes'] === PollMeetingSummary::MAX_SUMMARY_BYTES + 1); + } + + public function test_summary_at_size_limit_is_stored() + { + $content = str_repeat('a', PollMeetingSummary::MAX_SUMMARY_BYTES); + Http::fake([ + self::SUMMARY_URL => Http::sequence() + ->push($content, 200, ['Content-Type' => 'text/markdown; charset=utf-8']) + ->push(null, 204), + self::REGISTRATION_URL => Http::response($this->deliveredFrontend()), + ]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $this->assertSame($content, MeetingSummary::sole()->content); + } + + public function test_invalid_document_url_is_rejected() + { + Http::fake([ + self::REGISTRATION_URL => Http::response($this->registration('matched', [ + 'state' => 'cleaned', + 'outcome' => 'delivered', + 'delivered_at' => '2026-10-29T11:00:00Z', + 'document_url' => 'javascript:alert(1)', + ])), + ]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertNotFailed(); + $job->assertNotReleased(); + $this->assertSame(0, MeetingSummary::count()); + } + + public function test_stored_result_is_not_duplicated() + { + MeetingSummary::factory()->document()->create(['meeting_id' => $this->meeting->id]); + + Http::fake([ + self::REGISTRATION_URL => Http::response($this->registration('matched', [ + 'state' => 'cleaned', + 'outcome' => 'delivered', + 'delivered_at' => '2026-10-29T11:00:00Z', + 'document_url' => self::DOCUMENT_URL, + ])), + ]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $this->assertSame(1, MeetingSummary::count()); + $this->assertNotSame(self::DOCUMENT_URL, MeetingSummary::sole()->document_url); + } + + public static function pendingProvider(): array + { + return [ + 'registered' => ['registered', null], + 'received' => ['matched', ['state' => 'received']], + 'running' => ['matched', ['state' => 'running']], + 'held' => ['matched', ['state' => 'held', 'held_reason' => 'owner_unresolved']], + ]; + } + + /** + * @param array|null $job + */ + #[DataProvider('pendingProvider')] + public function test_pending_result_is_polled_again(string $status, ?array $job) + { + Http::fake([self::REGISTRATION_URL => Http::response($this->registration($status, $job))]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertReleased(5 * 60); + $job->assertNotFailed(); + $this->assertSame(0, MeetingSummary::count()); + } + + public static function backoffProvider(): array + { + // attempt that just ran => minutes until the next poll + return [ + 'after first poll' => [1, 5], + 'after second poll' => [2, 10], + 'after third poll' => [3, 30], + 'after fourth poll' => [4, 60], + 'after tenth poll' => [10, 60], + ]; + } + + #[DataProvider('backoffProvider')] + public function test_backoff(int $attempt, int $minutes) + { + Http::fake([self::REGISTRATION_URL => Http::response($this->registration('registered', null))]); + + $job = $this->createJob($attempt); + $job->handle(new RecapService); + + $job->assertReleased($minutes * 60); + } + + public function test_first_poll_delay() + { + $this->assertSame(2, PollMeetingSummary::pollDelay(1)); + } + + public function test_give_up_after_24_hours() + { + Http::fake([self::REGISTRATION_URL => Http::response($this->registration('matched', ['state' => 'held', 'held_reason' => 'owner_unresolved']))]); + + // Next poll in one hour would still be within 24 hours after the meeting end + $this->meeting->end = now()->subHours(22)->subMinutes(59); + $this->meeting->save(); + $job = $this->createJob(20); + $job->handle(new RecapService); + $job->assertReleased(60 * 60); + + // Next poll would be later than 24 hours after the meeting end + $this->meeting->end = now()->subHours(23)->subMinutes(1); + $this->meeting->save(); + $job = $this->createJob(21); + $job->handle(new RecapService); + $job->assertNotReleased(); + $job->assertNotFailed(); + Log::assertLogged(fn (LogEntry $log) => $log->level === 'notice' && str_contains($log->message, 'Stopped polling')); + } + + public static function finalResultProvider(): array + { + return [ + 'registration cancelled' => ['cancelled', null], + 'job failed' => ['matched', ['state' => 'failed']], + 'outcome cancelled' => ['matched', ['state' => 'cleaned', 'outcome' => 'cancelled']], + 'outcome purged' => ['matched', ['state' => 'cleaned', 'outcome' => 'purged']], + ]; + } + + /** + * @param array|null $job + */ + #[DataProvider('finalResultProvider')] + public function test_stop_on_final_result(string $status, ?array $job) + { + Http::fake([self::REGISTRATION_URL => Http::response($this->registration($status, $job))]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertNotReleased(); + $job->assertNotFailed(); + $this->assertSame(0, MeetingSummary::count()); + Http::assertSentCount(1); + } + + public function test_stop_on_not_found() + { + Http::fake([self::REGISTRATION_URL => Http::response([ + 'type' => 'urn:recap:problem:not-found', + 'title' => 'Not found', + 'status' => 404, + ], 404, ['Content-Type' => 'application/problem+json'])]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertNotReleased(); + $job->assertNotFailed(); + $this->assertSame(0, MeetingSummary::count()); + } + + public static function retryableStatusProvider(): array + { + return [ + '429' => [429], + '500' => [500], + '503' => [503], + ]; + } + + #[DataProvider('retryableStatusProvider')] + public function test_poll_again_on_status(int $status) + { + Http::fake([self::REGISTRATION_URL => Http::response(null, $status)]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertReleased(5 * 60); + $job->assertNotFailed(); + } + + public function test_poll_again_on_connection_error() + { + Http::fake([self::REGISTRATION_URL => fn () => throw new ConnectionException('Connection refused')]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertReleased(5 * 60); + $job->assertNotFailed(); + } + + public function test_fail_on_client_error() + { + Http::fake([self::REGISTRATION_URL => Http::response([ + 'type' => 'urn:recap:problem:unauthorized', + 'title' => 'Unauthorized', + 'status' => 401, + ], 401, ['Content-Type' => 'application/problem+json'])]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertFailed(); + $job->assertNotReleased(); + } + + public function test_summary_not_available_is_not_stored() + { + Http::fake([ + self::SUMMARY_URL => Http::sequence() + ->push(['type' => 'urn:recap:problem:summary-not-available', 'status' => 404], 404, ['Content-Type' => 'application/problem+json']) + ->push(null, 204), + self::REGISTRATION_URL => Http::response($this->deliveredFrontend()), + ]); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertNotFailed(); + $job->assertNotReleased(); + $this->assertSame(0, MeetingSummary::count()); + } + + public function test_skip_without_service_configuration() + { + config(['recap.frontend_token' => null]); + Http::fake(); + + $job = $this->createJob(); + $job->handle(new RecapService); + + $job->assertNotReleased(); + Http::assertNothingSent(); + } +} From 09d239ae24fd5d0a73b1a46d45e55035a16c1ea9 Mon Sep 17 00:00:00 2001 From: timo Date: Wed, 11 Nov 2026 00:56:19 +0100 Subject: [PATCH 12/18] Show meeting summaries in their own room tab and document them --- CHANGELOG.md | 1 + .../08-advanced/10-meeting-summaries.md | 25 ++ lang/ar/rooms.php | 33 ++ lang/de-gender/rooms.php | 33 ++ lang/de/rooms.php | 33 ++ lang/en/rooms.php | 33 ++ lang/fa/rooms.php | 33 ++ lang/fr/rooms.php | 33 ++ .../components/RoomMeetingSummaryViewer.vue | 20 + .../js/components/RoomTabMeetingSummaries.vue | 359 ++++++++++++++++++ .../RoomTabMeetingSummariesDeleteButton.vue | 115 ++++++ .../RoomTabMeetingSummariesEditButton.vue | 168 ++++++++ .../RoomTabMeetingSummariesViewButton.vue | 135 +++++++ resources/js/components/RoomTabSection.vue | 14 + resources/js/constants/modelNames.js | 1 + 15 files changed, 1036 insertions(+) create mode 100644 resources/js/components/RoomMeetingSummaryViewer.vue create mode 100644 resources/js/components/RoomTabMeetingSummaries.vue create mode 100644 resources/js/components/RoomTabMeetingSummariesDeleteButton.vue create mode 100644 resources/js/components/RoomTabMeetingSummariesEditButton.vue create mode 100644 resources/js/components/RoomTabMeetingSummariesViewButton.vue diff --git a/CHANGELOG.md b/CHANGELOG.md index 32bfc6e012..407932e56d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Experimental AI meeting summaries via an external summary service, independent of the recording setting of the room: room setting for the room owner in its own section, meeting type and destination per room type, owner registration and cancellation on room deletion, consent texts for meetings with summary only and with recording and summary; playback recordings of meetings with summary only are not imported +- Meeting summaries tab in the room: PILOS polls the summary service after a meeting with summary ends and lists the result per meeting, either as a link to the document in the owner's account (opens only for people the owner shares it with) or as the summary text shown read-only; access per summary like recordings (default owner and co-owners, changed or deleted by owner and co-owners), deleted after the recording retention period and with the room ## [v4.20.1] - 2026-11-19 diff --git a/docs/docs/administration/08-advanced/10-meeting-summaries.md b/docs/docs/administration/08-advanced/10-meeting-summaries.md index 343f72d45f..f5612cbf4b 100644 --- a/docs/docs/administration/08-advanced/10-meeting-summaries.md +++ b/docs/docs/administration/08-advanced/10-meeting-summaries.md @@ -116,6 +116,27 @@ Customize the texts as described in [Locales](../09-customisation/02-locales.md) 'recap_info' => 'The audio of this meeting may be transcribed and summarized by an AI service of the university. No recording is published.', ``` +## Meeting summaries tab + +After a meeting with a meeting summary ends, PILOS asks the summary service for the result in a queued job (`GET /api/v1/registrations/{internal meeting id}`). +It polls 2, 5, 10 and 30 minutes apart, then hourly, and stops when the result is stored, the registration is not found (404) or cancelled, the job failed or was not delivered, or 24 hours after the meeting end. +Network errors, HTTP 429 and HTTP 5xx count as "not yet" and are polled again on the same schedule; other client errors fail the job. + +The result is stored as one meeting summary per meeting and listed in the room tab **Meeting summaries**, newest first. +The tab is shown when meeting summaries are enabled or the room already has summaries. +Depending on the destination configured at the summary service, an entry is one of: + +- **Link to a document**, for example in La Suite Docs. The document is created in the Docs account of the room owner at meeting start, and only people the owner shares it with in Docs can open it. + Other room members see the entry, but the link only works for them after the owner has shared the document. The tab shows this hint next to the link. +- **Summary text** (destination type `frontend` at the summary service). PILOS fetches the text (`GET …/summary`), stores it, and then confirms the pickup (`DELETE …/summary`), so the summary service deletes its copy. + The text is shown read-only in the room, as plain text that is never interpreted as HTML. Texts larger than 2 MiB or not encoded in UTF-8 are not stored; the pickup is still confirmed. + +Access works like for recordings: + +- Each summary has an access setting (everyone with access to the room, participants, moderators, or owner and co-owners). New summaries start with owner and co-owners only. +- The room owner, co-owners and users with the permission to manage all rooms can change the access and delete a summary. Users with the permission to view all rooms see all summaries. +- Summaries are deleted after the [recording retention period](./03-recording.md#max-retention-period) (application settings) by the `cleanup:recordings` command, with the room, or by the owner or a co-owner. + ## Data flow and privacy | Data | Sent to | Personal data | @@ -123,11 +144,15 @@ Customize the texts as described in [Locales](../09-customisation/02-locales.md) | `meta_-*` parameters (version, opt-in, meeting type, destination) | BigBlueButton, part of the recording metadata | none; may be visible to meeting participants | | Registration: meeting ID, internal meeting ID, owner `sub` and email | summary service | owner OpenID Connect subject and email address | | Cancellation on room deletion: internal meeting ID | summary service | none | +| Result polling: internal meeting ID | summary service | none | +| Result: document link or summary text | from the summary service to PILOS | summary text: names and meeting content | - PILOS stores the OpenID Connect subject in the users table, and the meeting summary flag and the internal meeting ID in the meetings table. They are deleted with the user or the meeting. - PILOS does not store the playback recording of a meeting with a summary but without recording; it deletes the spool file on import. - The queued jobs contain only model IDs or the internal meeting ID, no subject or email. - Logs contain only meeting and internal meeting IDs, HTTP status codes and problem types, never the subject, email or token. +- The summary text is stored in the PILOS database (`meeting_summaries` table), visible according to its access setting, and deleted after the recording retention period, with the room, or by the owner or a co-owner. The document link points to the owner's document; deleting the entry in PILOS does not delete the document. +- The summary text is never written to the logs; logs contain the meeting and summary IDs and the text size only. - How long the summary service keeps the registration, recording and summary is configured there. ## Retries diff --git a/lang/ar/rooms.php b/lang/ar/rooms.php index 4e88e6e9d4..38a88f8424 100644 --- a/lang/ar/rooms.php +++ b/lang/ar/rooms.php @@ -197,6 +197,39 @@ 'meeting_history' => [ 'title' => 'السجل', ], + 'meeting_summaries' => [ + 'delete' => 'حذف ملخص الاجتماع', + 'delete_aria' => 'حذف ملخص اجتماع :date', + 'document_hint' => 'المستند محفوظ في حساب Docs الخاص بمالك الغرفة. لا يمكنك فتحه إلا إذا شاركه المالك معك في Docs.', + 'edit' => 'تغيير صلاحية الوصول', + 'edit_aria' => 'تغيير صلاحية الوصول إلى ملخص اجتماع :date', + 'filter_aria' => 'تصفية ملخصات الاجتماعات', + 'gone' => 'ملخص الاجتماع لم يعد متاحًا.', + 'modals' => [ + 'delete' => [ + 'confirm' => 'هل يجب حذف ملخص الاجتماع نهائيًا؟', + 'title' => 'حذف ملخص الاجتماع', + ], + 'edit' => [ + 'title' => 'تغيير صلاحية الوصول إلى ملخص الاجتماع', + ], + ], + 'nodata' => 'لا توجد ملخصات اجتماعات', + 'open_document' => 'فتح المستند', + 'open_document_aria' => 'فتح مستند ملخص اجتماع :date في علامة تبويب جديدة', + 'reload_aria' => 'إعادة تحميل ملخصات الاجتماعات', + 'retention_period' => [ + 'days' => 'يتم الاحتفاظ بملخصات الاجتماعات لمدة :days يومًا.', + 'title' => 'فترة الاحتفاظ', + 'unlimited' => 'يتم الاحتفاظ بملخصات الاجتماعات بشكل دائم.', + ], + 'sort_ascending' => 'فرز ملخصات الاجتماعات تصاعديًا', + 'sort_descending' => 'فرز ملخصات الاجتماعات تنازليًا', + 'title' => 'ملخصات الاجتماعات', + 'view' => 'عرض ملخص الاجتماع', + 'view_aria' => 'عرض ملخص اجتماع :date', + 'view_title' => 'ملخص اجتماع :date', + ], 'members' => [ 'add_single_user' => 'إضافة مستخدم واحد', 'add_user' => 'إضافة مستخدم', diff --git a/lang/de-gender/rooms.php b/lang/de-gender/rooms.php index 36f93e2360..6b4adb286b 100644 --- a/lang/de-gender/rooms.php +++ b/lang/de-gender/rooms.php @@ -203,6 +203,39 @@ 'meeting_history' => [ 'title' => 'Historie', ], + 'meeting_summaries' => [ + 'delete' => 'Besprechungszusammenfassung löschen', + 'delete_aria' => 'Besprechungszusammenfassung vom :date löschen', + 'document_hint' => 'Das Dokument liegt im Docs-Konto der Person, der der Raum gehört. Sie können es nur öffnen, wenn diese Person es in Docs für Sie freigegeben hat.', + 'edit' => 'Zugriffsrecht ändern', + 'edit_aria' => 'Zugriffsrecht der Besprechungszusammenfassung vom :date ändern', + 'filter_aria' => 'Besprechungszusammenfassungen filtern', + 'gone' => 'Die Besprechungszusammenfassung ist nicht mehr verfügbar.', + 'modals' => [ + 'delete' => [ + 'confirm' => 'Soll die Besprechungszusammenfassung unwiderruflich gelöscht werden?', + 'title' => 'Besprechungszusammenfassung löschen', + ], + 'edit' => [ + 'title' => 'Zugriffsrecht der Besprechungszusammenfassung ändern', + ], + ], + 'nodata' => 'Keine Besprechungszusammenfassungen vorhanden', + 'open_document' => 'Dokument öffnen', + 'open_document_aria' => 'Dokument der Besprechungszusammenfassung vom :date in einem neuen Tab öffnen', + 'reload_aria' => 'Besprechungszusammenfassungen neu laden', + 'retention_period' => [ + 'days' => 'Die Besprechungszusammenfassungen werden für :days Tage gespeichert.', + 'title' => 'Aufbewahrungsdauer', + 'unlimited' => 'Die Besprechungszusammenfassungen werden unbegrenzt gespeichert.', + ], + 'sort_ascending' => 'Besprechungszusammenfassungen aufsteigend sortieren', + 'sort_descending' => 'Besprechungszusammenfassungen absteigend sortieren', + 'title' => 'Besprechungszusammenfassungen', + 'view' => 'Besprechungszusammenfassung anzeigen', + 'view_aria' => 'Besprechungszusammenfassung vom :date anzeigen', + 'view_title' => 'Besprechungszusammenfassung vom :date', + ], 'members' => [ 'add_single_user' => 'Einen Benutzer hinzufügen', 'add_user' => 'Benutzer hinzufügen', diff --git a/lang/de/rooms.php b/lang/de/rooms.php index d84ef69b5f..698aeff6ce 100644 --- a/lang/de/rooms.php +++ b/lang/de/rooms.php @@ -222,6 +222,39 @@ 'sort_descending' => 'Historie absteigend sortieren', 'title' => 'Historie', ], + 'meeting_summaries' => [ + 'delete' => 'Besprechungszusammenfassung löschen', + 'delete_aria' => 'Besprechungszusammenfassung vom :date löschen', + 'document_hint' => 'Das Dokument liegt im Docs-Konto des Raumbesitzers. Sie können es nur öffnen, wenn der Raumbesitzer es in Docs für Sie freigegeben hat.', + 'edit' => 'Zugriffsrecht ändern', + 'edit_aria' => 'Zugriffsrecht der Besprechungszusammenfassung vom :date ändern', + 'filter_aria' => 'Besprechungszusammenfassungen filtern', + 'gone' => 'Die Besprechungszusammenfassung ist nicht mehr verfügbar.', + 'modals' => [ + 'delete' => [ + 'confirm' => 'Soll die Besprechungszusammenfassung unwiderruflich gelöscht werden?', + 'title' => 'Besprechungszusammenfassung löschen', + ], + 'edit' => [ + 'title' => 'Zugriffsrecht der Besprechungszusammenfassung ändern', + ], + ], + 'nodata' => 'Keine Besprechungszusammenfassungen vorhanden', + 'open_document' => 'Dokument öffnen', + 'open_document_aria' => 'Dokument der Besprechungszusammenfassung vom :date in einem neuen Tab öffnen', + 'reload_aria' => 'Besprechungszusammenfassungen neu laden', + 'retention_period' => [ + 'days' => 'Die Besprechungszusammenfassungen werden für :days Tage gespeichert.', + 'title' => 'Aufbewahrungsdauer', + 'unlimited' => 'Die Besprechungszusammenfassungen werden unbegrenzt gespeichert.', + ], + 'sort_ascending' => 'Besprechungszusammenfassungen aufsteigend sortieren', + 'sort_descending' => 'Besprechungszusammenfassungen absteigend sortieren', + 'title' => 'Besprechungszusammenfassungen', + 'view' => 'Besprechungszusammenfassung anzeigen', + 'view_aria' => 'Besprechungszusammenfassung vom :date anzeigen', + 'view_title' => 'Besprechungszusammenfassung vom :date', + ], 'members' => [ 'add_single_user' => 'Einen Benutzer hinzufügen', 'add_user' => 'Benutzer hinzufügen', diff --git a/lang/en/rooms.php b/lang/en/rooms.php index f51d7fedb6..95f576fa03 100644 --- a/lang/en/rooms.php +++ b/lang/en/rooms.php @@ -222,6 +222,39 @@ 'sort_descending' => 'Sort history descending', 'title' => 'History', ], + 'meeting_summaries' => [ + 'delete' => 'Delete meeting summary', + 'delete_aria' => 'Delete meeting summary of :date', + 'document_hint' => 'The document is stored in the Docs account of the room owner. You can only open it if the owner has shared it with you in Docs.', + 'edit' => 'Change access', + 'edit_aria' => 'Change access to the meeting summary of :date', + 'filter_aria' => 'Filter meeting summaries', + 'gone' => 'The meeting summary is no longer available.', + 'modals' => [ + 'delete' => [ + 'confirm' => 'Should the meeting summary be irrevocably deleted?', + 'title' => 'Delete meeting summary', + ], + 'edit' => [ + 'title' => 'Change access to the meeting summary', + ], + ], + 'nodata' => 'No meeting summaries available', + 'open_document' => 'Open document', + 'open_document_aria' => 'Open the meeting summary document of :date in a new tab', + 'reload_aria' => 'Reload meeting summaries', + 'retention_period' => [ + 'days' => 'The meeting summaries are stored for :days days.', + 'title' => 'Retention period', + 'unlimited' => 'The meeting summaries are stored indefinitely.', + ], + 'sort_ascending' => 'Sort meeting summaries ascending', + 'sort_descending' => 'Sort meeting summaries descending', + 'title' => 'Meeting summaries', + 'view' => 'Show meeting summary', + 'view_aria' => 'Show the meeting summary of :date', + 'view_title' => 'Meeting summary of :date', + ], 'members' => [ 'add_single_user' => 'Add single user', 'add_user' => 'Add user', diff --git a/lang/fa/rooms.php b/lang/fa/rooms.php index f38c66eb62..e51c251a32 100644 --- a/lang/fa/rooms.php +++ b/lang/fa/rooms.php @@ -197,6 +197,39 @@ 'meeting_history' => [ 'title' => 'تاریخچه', ], + 'meeting_summaries' => [ + 'delete' => 'حذف خلاصه جلسه', + 'delete_aria' => 'حذف خلاصه جلسه :date', + 'document_hint' => 'این سند در حساب Docs مالک اتاق ذخیره شده است. فقط در صورتی می‌توانید آن را باز کنید که مالک آن را در Docs با شما به اشتراک گذاشته باشد.', + 'edit' => 'تغییر دسترسی', + 'edit_aria' => 'تغییر دسترسی به خلاصه جلسه :date', + 'filter_aria' => 'فیلتر خلاصه‌های جلسه', + 'gone' => 'خلاصه جلسه دیگر در دسترس نیست.', + 'modals' => [ + 'delete' => [ + 'confirm' => 'آیا خلاصه جلسه برای همیشه حذف شود؟', + 'title' => 'حذف خلاصه جلسه', + ], + 'edit' => [ + 'title' => 'تغییر دسترسی به خلاصه جلسه', + ], + ], + 'nodata' => 'هیچ خلاصه جلسه‌ای موجود نیست', + 'open_document' => 'باز کردن سند', + 'open_document_aria' => 'باز کردن سند خلاصه جلسه :date در یک برگه جدید', + 'reload_aria' => 'بارگذاری مجدد خلاصه‌های جلسه', + 'retention_period' => [ + 'days' => 'خلاصه‌های جلسه برای :days روز ذخیره می‌شوند.', + 'title' => 'دوره نگهداری', + 'unlimited' => 'خلاصه‌های جلسه به صورت نامحدود ذخیره می‌شوند.', + ], + 'sort_ascending' => 'مرتب‌سازی صعودی خلاصه‌های جلسه', + 'sort_descending' => 'مرتب‌سازی نزولی خلاصه‌های جلسه', + 'title' => 'خلاصه‌های جلسه', + 'view' => 'نمایش خلاصه جلسه', + 'view_aria' => 'نمایش خلاصه جلسه :date', + 'view_title' => 'خلاصه جلسه :date', + ], 'members' => [ 'add_single_user' => 'افزودن کاربر تکی', 'add_user' => 'افزودن کاربر', diff --git a/lang/fr/rooms.php b/lang/fr/rooms.php index da3ba1723b..70de384fce 100644 --- a/lang/fr/rooms.php +++ b/lang/fr/rooms.php @@ -222,6 +222,39 @@ 'sort_descending' => 'Trier l\'historique par ordre décroissant', 'title' => 'Historique', ], + 'meeting_summaries' => [ + 'delete' => 'Supprimer le résumé de réunion', + 'delete_aria' => 'Supprimer le résumé de la réunion du :date', + 'document_hint' => 'Le document se trouve dans le compte Docs du propriétaire de la salle. Vous ne pouvez l\'ouvrir que si le propriétaire l\'a partagé avec vous dans Docs.', + 'edit' => 'Modifier l\'accès', + 'edit_aria' => 'Modifier l\'accès au résumé de la réunion du :date', + 'filter_aria' => 'Filtrer les résumés de réunion', + 'gone' => 'Le résumé de réunion n\'est plus disponible.', + 'modals' => [ + 'delete' => [ + 'confirm' => 'Le résumé de réunion doit-il être supprimé définitivement ?', + 'title' => 'Supprimer le résumé de réunion', + ], + 'edit' => [ + 'title' => 'Modifier l\'accès au résumé de réunion', + ], + ], + 'nodata' => 'Aucun résumé de réunion disponible', + 'open_document' => 'Ouvrir le document', + 'open_document_aria' => 'Ouvrir le document du résumé de la réunion du :date dans un nouvel onglet', + 'reload_aria' => 'Recharger les résumés de réunion', + 'retention_period' => [ + 'days' => 'Les résumés de réunion sont sauvegardés pour :days jours.', + 'title' => 'Période de rétention', + 'unlimited' => 'Les résumés de réunion sont sauvegardés indéfiniment.', + ], + 'sort_ascending' => 'Trier les résumés de réunion par ordre croissant', + 'sort_descending' => 'Trier les résumés de réunion par ordre décroissant', + 'title' => 'Résumés de réunion', + 'view' => 'Afficher le résumé de réunion', + 'view_aria' => 'Afficher le résumé de la réunion du :date', + 'view_title' => 'Résumé de la réunion du :date', + ], 'members' => [ 'add_single_user' => 'Ajouter un utilisateur unique', 'add_user' => 'Ajouter un utilisateur', diff --git a/resources/js/components/RoomMeetingSummaryViewer.vue b/resources/js/components/RoomMeetingSummaryViewer.vue new file mode 100644 index 0000000000..c4484eca4f --- /dev/null +++ b/resources/js/components/RoomMeetingSummaryViewer.vue @@ -0,0 +1,20 @@ + + diff --git a/resources/js/components/RoomTabMeetingSummaries.vue b/resources/js/components/RoomTabMeetingSummaries.vue new file mode 100644 index 0000000000..dd1ee2fef1 --- /dev/null +++ b/resources/js/components/RoomTabMeetingSummaries.vue @@ -0,0 +1,359 @@ + + diff --git a/resources/js/components/RoomTabMeetingSummariesDeleteButton.vue b/resources/js/components/RoomTabMeetingSummariesDeleteButton.vue new file mode 100644 index 0000000000..0114ff654d --- /dev/null +++ b/resources/js/components/RoomTabMeetingSummariesDeleteButton.vue @@ -0,0 +1,115 @@ + + diff --git a/resources/js/components/RoomTabMeetingSummariesEditButton.vue b/resources/js/components/RoomTabMeetingSummariesEditButton.vue new file mode 100644 index 0000000000..86d03b220d --- /dev/null +++ b/resources/js/components/RoomTabMeetingSummariesEditButton.vue @@ -0,0 +1,168 @@ + + diff --git a/resources/js/components/RoomTabMeetingSummariesViewButton.vue b/resources/js/components/RoomTabMeetingSummariesViewButton.vue new file mode 100644 index 0000000000..2328895711 --- /dev/null +++ b/resources/js/components/RoomTabMeetingSummariesViewButton.vue @@ -0,0 +1,135 @@ + + diff --git a/resources/js/components/RoomTabSection.vue b/resources/js/components/RoomTabSection.vue index c4c18a6b12..c2b020b215 100644 --- a/resources/js/components/RoomTabSection.vue +++ b/resources/js/components/RoomTabSection.vue @@ -143,6 +143,7 @@ import RoomTabFiles from "./RoomTabFiles.vue"; import RoomTabHistory from "./RoomTabHistory.vue"; import RoomTabSettings from "./RoomTabSettings.vue"; import RoomTabRecordings from "./RoomTabRecordings.vue"; +import RoomTabMeetingSummaries from "./RoomTabMeetingSummaries.vue"; import { onRoomHasChanged } from "../composables/useRoomHelpers.js"; import { useUrlSearchParams } from "@vueuse/core"; import { useSettingsStore } from "../stores/settings.js"; @@ -265,6 +266,19 @@ const availableTabs = computed(() => { component: RoomTabRecordings, }); + // Meeting summaries: shown if the room has summaries or the feature is enabled + if ( + props.room.has_meeting_summaries || + settingsStore.getSetting("recap.enabled") + ) { + tabs.push({ + key: "meeting_summaries", + label: t("rooms.meeting_summaries.title"), + icon: "fa-solid fa-file-pen", + component: RoomTabMeetingSummaries, + }); + } + if (userPermissions.can("viewSettings", props.room)) { tabs.push({ key: "streaming", diff --git a/resources/js/constants/modelNames.js b/resources/js/constants/modelNames.js index 60d9f8a1e5..322ef68890 100644 --- a/resources/js/constants/modelNames.js +++ b/resources/js/constants/modelNames.js @@ -3,3 +3,4 @@ export const ROOM_FILE = "room_file"; export const ROOM_PERSONALIZED_LINK = "room_personalized_link"; export const RECORDING = "recording"; export const USER = "user"; +export const MEETING_SUMMARY = "meeting_summary"; From bd97fe513f2477c0366ead66f7869dce9db232e6 Mon Sep 17 00:00:00 2001 From: timo Date: Wed, 11 Nov 2026 08:20:19 +0100 Subject: [PATCH 13/18] Render meeting summaries as sanitized Markdown --- .../08-advanced/10-meeting-summaries.md | 2 +- package-lock.json | 13 ++++ package.json | 1 + .../components/RoomMeetingSummaryViewer.vue | 73 +++++++++++++++++-- 4 files changed, 80 insertions(+), 9 deletions(-) diff --git a/docs/docs/administration/08-advanced/10-meeting-summaries.md b/docs/docs/administration/08-advanced/10-meeting-summaries.md index f5612cbf4b..67e8c1cb2b 100644 --- a/docs/docs/administration/08-advanced/10-meeting-summaries.md +++ b/docs/docs/administration/08-advanced/10-meeting-summaries.md @@ -129,7 +129,7 @@ Depending on the destination configured at the summary service, an entry is one - **Link to a document**, for example in La Suite Docs. The document is created in the Docs account of the room owner at meeting start, and only people the owner shares it with in Docs can open it. Other room members see the entry, but the link only works for them after the owner has shared the document. The tab shows this hint next to the link. - **Summary text** (destination type `frontend` at the summary service). PILOS fetches the text (`GET …/summary`), stores it, and then confirms the pickup (`DELETE …/summary`), so the summary service deletes its copy. - The text is shown read-only in the room, as plain text that is never interpreted as HTML. Texts larger than 2 MiB or not encoded in UTF-8 are not stored; the pickup is still confirmed. + The text is shown read-only in the room, with the Markdown rendered and sanitized: headings, lists, emphasis, code, quotes, tables and links are kept; images, embedded HTML, styles and scripts are removed, and links open in a new tab. Texts larger than 2 MiB or not encoded in UTF-8 are not stored; the pickup is still confirmed. Access works like for recordings: diff --git a/package-lock.json b/package-lock.json index 0d9f1ca4bf..952a92b1d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "dotenv": "^18.0.9", "laravel-vite-plugin": "^3.2.0", "lodash-es": "^4.18.1", + "marked": "18.2.0", "mitt": "^3.0.1", "pinia": "^4.1.0", "primeicons": "^7.0.0", @@ -8937,6 +8938,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/marked": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-18.2.0.tgz", + "integrity": "sha512-KaeL+tAbtvI930q7HE2PN5lYXYdT8EiSmxHlN6F3rsfb57wd5mp5W5TLazpdj4inTQBJdgjYwbs40W/0VUGU+Q==", + "license": "MIT", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 20" + } + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", diff --git a/package.json b/package.json index 41f78c57c5..02672ff4eb 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "dotenv": "^18.0.9", "laravel-vite-plugin": "^3.2.0", "lodash-es": "^4.18.1", + "marked": "18.2.0", "mitt": "^3.0.1", "pinia": "^4.1.0", "primeicons": "^7.0.0", diff --git a/resources/js/components/RoomMeetingSummaryViewer.vue b/resources/js/components/RoomMeetingSummaryViewer.vue index c4484eca4f..ecc5c1fb76 100644 --- a/resources/js/components/RoomMeetingSummaryViewer.vue +++ b/resources/js/components/RoomMeetingSummaryViewer.vue @@ -1,20 +1,77 @@ From 26a97548505b796d4e7daa5699dcd9c74a7e6ef0 Mon Sep 17 00:00:00 2001 From: timo Date: Wed, 11 Nov 2026 12:32:25 +0100 Subject: [PATCH 14/18] Name the meeting summary in the consent error of summary-only meetings --- app/Http/Requests/JoinMeetingRequest.php | 44 +++++++++++++++++- app/Http/Requests/StartMeetingRequest.php | 46 ++++++++++++++++++- lang/ar/validation.php | 4 ++ lang/de-gender/validation.php | 4 ++ lang/de/validation.php | 4 ++ lang/en/validation.php | 4 ++ lang/fa/validation.php | 4 ++ lang/fr/validation.php | 4 ++ .../api/v1/Room/RoomRecapStartTest.php | 17 +++++-- 9 files changed, 126 insertions(+), 5 deletions(-) diff --git a/app/Http/Requests/JoinMeetingRequest.php b/app/Http/Requests/JoinMeetingRequest.php index 9f45d311c1..bfc68d41cf 100644 --- a/app/Http/Requests/JoinMeetingRequest.php +++ b/app/Http/Requests/JoinMeetingRequest.php @@ -48,7 +48,7 @@ private function getRecordingRules(): array } // Meeting summary without recording, the camera video is not recorded - if ($meeting?->recap) { + if ($this->isSummaryOnly()) { return [ 'consent_record' => ['required', 'boolean', 'accepted'], // Consent to join meeting with meeting summary enabled ]; @@ -57,6 +57,48 @@ private function getRecordingRules(): array return []; } + /** + * Custom messages for the meeting summary consent, which shares the field with the recording consent + * + * @return array + */ + public function messages(): array + { + if ($this->isSummaryOnly()) { + return [ + 'consent_record.accepted' => __('validation.custom.consent_recap.accepted'), + ]; + } + + return []; + } + + /** + * Custom attribute names for the meeting summary consent, which shares the field with the recording consent + * + * @return array + */ + public function attributes(): array + { + if ($this->isSummaryOnly()) { + return [ + 'consent_record' => __('validation.attributes.consent_recap'), + ]; + } + + return []; + } + + /** + * Whether the meeting creates a meeting summary without a recording + */ + private function isSummaryOnly(): bool + { + $meeting = $this->room->latestMeeting; + + return ! $meeting?->record && (bool) $meeting?->recap; + } + private function getStreamingRules(): array { $streaming = $this->room->streaming; diff --git a/app/Http/Requests/StartMeetingRequest.php b/app/Http/Requests/StartMeetingRequest.php index 2cb7eb17a2..33143c31c8 100644 --- a/app/Http/Requests/StartMeetingRequest.php +++ b/app/Http/Requests/StartMeetingRequest.php @@ -48,7 +48,7 @@ private function getRecordingRules(): array } // Meeting summary without recording, the camera video is not recorded - if ((new RoomService($this->room))->isRecapActive()) { + if ($this->isSummaryOnly()) { return [ 'consent_record' => ['required', 'boolean', 'accepted'], // Consent to join meeting with meeting summary enabled ]; @@ -57,6 +57,50 @@ private function getRecordingRules(): array return []; } + /** + * Custom messages for the meeting summary consent, which shares the field with the recording consent + * + * @return array + */ + public function messages(): array + { + if ($this->isSummaryOnly()) { + return [ + 'consent_record.accepted' => __('validation.custom.consent_recap.accepted'), + ]; + } + + return []; + } + + /** + * Custom attribute names for the meeting summary consent, which shares the field with the recording consent + * + * @return array + */ + public function attributes(): array + { + if ($this->isSummaryOnly()) { + return [ + 'consent_record' => __('validation.attributes.consent_recap'), + ]; + } + + return []; + } + + /** + * Whether the meeting creates a meeting summary without a recording + */ + private function isSummaryOnly(): bool + { + if ($this->room->getRoomSetting('record')) { + return false; + } + + return (new RoomService($this->room))->isRecapActive(); + } + private function getStreamingRules(): array { $streaming = $this->room->streaming; diff --git a/lang/ar/validation.php b/lang/ar/validation.php index c361e5d50e..2df568c5f6 100644 --- a/lang/ar/validation.php +++ b/lang/ar/validation.php @@ -48,6 +48,7 @@ 'bbb_style' => 'ملف تنسيق CSS', 'city' => 'المدينة', 'color' => 'اللون', + 'consent_recap' => 'الموافقة على تفريغ الصوت وتلخيصه بواسطة الذكاء الاصطناعي', 'consent_record' => 'الموافقة على تسجيل مؤتمر الفيديو', 'consent_record_attendance' => 'الموافقة على تسجيل الحضور', 'consent_record_video' => 'الموافقة على تسجيل الفيديو الشخصي', @@ -204,6 +205,9 @@ ], 'required' => 'إعدادات شريط الرسائل مفقودة!', ], + 'consent_recap' => [ + 'accepted' => 'يجب الموافقة على تفريغ الصوت وتلخيصه بواسطة الذكاء الاصطناعي.', + ], 'consent_record' => [ 'accepted' => 'يجب الموافقة على تسجيل مؤتمر الفيديو.', ], diff --git a/lang/de-gender/validation.php b/lang/de-gender/validation.php index 98efddf1e8..7aedf26952 100644 --- a/lang/de-gender/validation.php +++ b/lang/de-gender/validation.php @@ -48,6 +48,7 @@ 'bbb_style' => 'CSS Style Datei', 'city' => 'Stadt', 'color' => 'Farbe', + 'consent_recap' => 'Zustimmung zur Transkription und KI-Zusammenfassung des Tons', 'consent_record' => 'Zustimmung zur Aufzeichnung der Videokonferenz', 'consent_record_attendance' => 'Zustimmung zur Anwesenheitserfassung', 'consent_record_video' => 'Zustimmung zur Aufnahme eigener Videos', @@ -204,6 +205,9 @@ ], 'required' => 'Die Einstellungen für den Banner für Mitteilungen fehlen!', ], + 'consent_recap' => [ + 'accepted' => 'Die Zustimmung zur Transkription und KI-Zusammenfassung des Tons muss erteilt werden.', + ], 'consent_record' => [ 'accepted' => 'Die Zustimmung zur Aufzeichnung der Videokonferenz muss erteilt werden.', ], diff --git a/lang/de/validation.php b/lang/de/validation.php index 65c23bbbbf..4a0dcc4643 100644 --- a/lang/de/validation.php +++ b/lang/de/validation.php @@ -48,6 +48,7 @@ 'bbb_style' => 'CSS Style Datei', 'city' => 'Stadt', 'color' => 'Farbe', + 'consent_recap' => 'Zustimmung zur Transkription und KI-Zusammenfassung des Tons', 'consent_record' => 'Zustimmung zur Aufzeichnung der Videokonferenz', 'consent_record_attendance' => 'Zustimmung zur Anwesenheitserfassung', 'consent_record_video' => 'Zustimmung zur Aufzeichnung eigener Videos', @@ -204,6 +205,9 @@ ], 'required' => 'Die Einstellungen für den Banner für Mitteilungen fehlen!', ], + 'consent_recap' => [ + 'accepted' => 'Die Zustimmung zur Transkription und KI-Zusammenfassung des Tons muss erteilt werden.', + ], 'consent_record' => [ 'accepted' => 'Die Zustimmung zur Aufzeichnung der Videokonferenz muss erteilt werden.', ], diff --git a/lang/en/validation.php b/lang/en/validation.php index a90d0552be..a341a9a6eb 100644 --- a/lang/en/validation.php +++ b/lang/en/validation.php @@ -48,6 +48,7 @@ 'bbb_style' => 'CSS style file', 'city' => 'City', 'color' => 'Color', + 'consent_recap' => 'Consent to the transcription and AI summary of the audio', 'consent_record' => 'Consent to the recording of the video conference', 'consent_record_attendance' => 'Consent to attendance logging', 'consent_record_video' => 'Consent to record own video', @@ -204,6 +205,9 @@ ], 'required' => 'The message banner settings are missing!', ], + 'consent_recap' => [ + 'accepted' => 'Consent to the transcription and AI summary of the audio must be given.', + ], 'consent_record' => [ 'accepted' => 'Consent to the recording of the video conference must be given.', ], diff --git a/lang/fa/validation.php b/lang/fa/validation.php index 719db8a931..4193b9e2a4 100644 --- a/lang/fa/validation.php +++ b/lang/fa/validation.php @@ -48,6 +48,7 @@ 'bbb_style' => 'فایل سبک CSS', 'city' => 'شهر', 'color' => 'رنگ', + 'consent_recap' => 'رضایت به رونویسی و خلاصه‌سازی صدا توسط هوش مصنوعی', 'consent_record' => 'رضایت به ضبط کنفرانس ویدیویی', 'consent_record_attendance' => 'رضایت به ثبت حضور', 'consent_record_video' => 'رضایت به ضبط ویدیوی شخصی', @@ -204,6 +205,9 @@ ], 'required' => 'تنظیمات بنر پیام وجود ندارد!', ], + 'consent_recap' => [ + 'accepted' => 'رضایت به رونویسی و خلاصه‌سازی صدا توسط هوش مصنوعی الزامی است.', + ], 'consent_record' => [ 'accepted' => 'رضایت به ضبط کنفرانس ویدیویی الزامی است.', ], diff --git a/lang/fr/validation.php b/lang/fr/validation.php index d4d0dd7c8e..6c041ee97f 100644 --- a/lang/fr/validation.php +++ b/lang/fr/validation.php @@ -48,6 +48,7 @@ 'bbb_style' => 'Fichier de styles CSS', 'city' => 'Ville', 'color' => 'Couleur', + 'consent_recap' => 'Consentement à la transcription et au résumé du son par une IA', 'consent_record' => 'Consentement à l\'enregistrement de la vidéo conférence', 'consent_record_attendance' => 'Consentement à la sauvegarde des présences', 'consent_record_video' => 'Consentement à enregistrer sa propre vidéo', @@ -204,6 +205,9 @@ ], 'required' => 'Les paramètres de la bannière de message sont manquants!', ], + 'consent_recap' => [ + 'accepted' => 'Le consentement à la transcription et au résumé du son par une IA est requis pour continuer.', + ], 'consent_record' => [ 'accepted' => 'Le consentement d\'enregistrement de la vidéo conférence est requis pour continuer.', ], diff --git a/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php b/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php index 5c0708ac62..aeea3d63dc 100644 --- a/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php +++ b/tests/Backend/Feature/api/v1/Room/RoomRecapStartTest.php @@ -282,7 +282,7 @@ public function test_start_and_join_summary_only() $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.start', ['room' => $this->room]), ['consent_record' => false]) ->assertStatus(422) - ->assertJsonValidationErrors(['consent_record']) + ->assertJsonValidationErrors(['consent_record' => __('validation.custom.consent_recap.accepted')]) ->assertJsonMissingValidationErrors(['consent_record_video']); $this->bbbFaker->addCreateMeetingRequest(); @@ -300,9 +300,13 @@ public function test_start_and_join_summary_only() $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.join', ['room' => $this->room])) ->assertStatus(422) - ->assertJsonValidationErrors(['consent_record']) + ->assertJsonValidationErrors(['consent_record' => __('validation.required', ['attribute' => __('validation.attributes.consent_recap')])]) ->assertJsonMissingValidationErrors(['consent_record_video']); + $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.join', ['room' => $this->room]), ['consent_record' => false]) + ->assertStatus(422) + ->assertJsonValidationErrors(['consent_record' => __('validation.custom.consent_recap.accepted')]); + $this->addRunningMeetingInfoRequest(); $joinUrl = $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.join', ['room' => $this->room]), ['consent_record' => true, 'consent_record_video' => true]) ->assertSuccessful() @@ -327,7 +331,14 @@ public function test_join_recording_and_summary() $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.join', ['room' => $this->room])) ->assertStatus(422) - ->assertJsonValidationErrors(['consent_record', 'consent_record_video']); + ->assertJsonValidationErrors([ + 'consent_record' => __('validation.required', ['attribute' => __('validation.attributes.consent_record')]), + 'consent_record_video', + ]); + + $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.join', ['room' => $this->room]), ['consent_record' => false, 'consent_record_video' => false]) + ->assertStatus(422) + ->assertJsonValidationErrors(['consent_record' => __('validation.custom.consent_record.accepted')]); $this->addRunningMeetingInfoRequest(); $joinUrl = $this->actingAs($this->room->owner)->postJson(route('api.v1.rooms.join', ['room' => $this->room]), ['consent_record' => true, 'consent_record_video' => true]) From 4a398eb1758eb4d2fa649cee05d294809d27707f Mon Sep 17 00:00:00 2001 From: timo Date: Wed, 11 Nov 2026 12:32:25 +0100 Subject: [PATCH 15/18] Log a rejected meeting summary result only once --- app/Jobs/PollMeetingSummary.php | 8 +++++++- tests/Backend/Unit/Jobs/PollMeetingSummaryTest.php | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/Jobs/PollMeetingSummary.php b/app/Jobs/PollMeetingSummary.php index 02d670571f..a9dcdfbd4c 100644 --- a/app/Jobs/PollMeetingSummary.php +++ b/app/Jobs/PollMeetingSummary.php @@ -192,6 +192,7 @@ private function storeResult(RecapService $recapService, string $recordId, array if ($meetingSummary === null) { $content = null; + $contentReceived = false; if ($summaryAvailable) { try { $summaryResponse = $recapService->getSummary($recordId); @@ -202,6 +203,7 @@ private function storeResult(RecapService $recapService, string $recordId, array } if ($summaryResponse->successful()) { + $contentReceived = true; $content = $this->acceptedContent($summaryResponse->body()); } elseif (! $summaryResponse->notFound()) { $this->handleErrorResponse($summaryResponse, 'summary'); @@ -210,10 +212,14 @@ private function storeResult(RecapService $recapService, string $recordId, array } } + $documentUrlReceived = ($job['document_url'] ?? null) !== null; $documentUrl = $this->acceptedDocumentUrl($job['document_url'] ?? null); if ($documentUrl === null && $content === null) { - Log::notice('Meeting summary of meeting {meeting} delivered without a document link or summary text', ['meeting' => $this->meeting->id]); + // A rejected text or link was already logged as a warning + if (! $contentReceived && ! $documentUrlReceived) { + Log::notice('Meeting summary of meeting {meeting} delivered without a document link or summary text', ['meeting' => $this->meeting->id]); + } } else { $meetingSummary = new MeetingSummary; $meetingSummary->room_id = $this->meeting->room_id; diff --git a/tests/Backend/Unit/Jobs/PollMeetingSummaryTest.php b/tests/Backend/Unit/Jobs/PollMeetingSummaryTest.php index a148701dde..e929fda134 100644 --- a/tests/Backend/Unit/Jobs/PollMeetingSummaryTest.php +++ b/tests/Backend/Unit/Jobs/PollMeetingSummaryTest.php @@ -265,6 +265,8 @@ public function test_too_large_summary_is_rejected() // The pickup is still confirmed, so the service deletes the text Http::assertSent(fn (Request $request) => $request->method() === 'DELETE' && $request->url() === self::SUMMARY_URL); Log::assertLogged(fn (LogEntry $log) => $log->level === 'warning' && $log->context['bytes'] === PollMeetingSummary::MAX_SUMMARY_BYTES + 1); + // One log line for the rejected text + Log::assertNotLogged(fn (LogEntry $log) => str_contains($log->message, 'delivered without')); } public function test_summary_at_size_limit_is_stored() @@ -300,6 +302,9 @@ public function test_invalid_document_url_is_rejected() $job->assertNotFailed(); $job->assertNotReleased(); $this->assertSame(0, MeetingSummary::count()); + // One log line for the rejected link + Log::assertLogged(fn (LogEntry $log) => $log->level === 'warning' && str_contains($log->message, 'document link')); + Log::assertNotLogged(fn (LogEntry $log) => str_contains($log->message, 'delivered without')); } public function test_stored_result_is_not_duplicated() @@ -502,6 +507,7 @@ public function test_summary_not_available_is_not_stored() $job->assertNotFailed(); $job->assertNotReleased(); $this->assertSame(0, MeetingSummary::count()); + Log::assertLogged(fn (LogEntry $log) => $log->level === 'notice' && str_contains($log->message, 'delivered without')); } public function test_skip_without_service_configuration() From 11841534527c1fb412c43cea0780fd81abb90413 Mon Sep 17 00:00:00 2001 From: timo Date: Wed, 11 Nov 2026 12:32:25 +0100 Subject: [PATCH 16/18] Show the room owner a fitting Docs hint and document summary deletion and reruns --- .../08-advanced/10-meeting-summaries.md | 5 ++++- lang/ar/rooms.php | 1 + lang/de-gender/rooms.php | 1 + lang/de/rooms.php | 1 + lang/en/rooms.php | 1 + lang/fa/rooms.php | 1 + lang/fr/rooms.php | 1 + .../js/components/RoomTabMeetingSummaries.vue | 15 ++++++++++++++- 8 files changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/docs/administration/08-advanced/10-meeting-summaries.md b/docs/docs/administration/08-advanced/10-meeting-summaries.md index 67e8c1cb2b..69296a9c44 100644 --- a/docs/docs/administration/08-advanced/10-meeting-summaries.md +++ b/docs/docs/administration/08-advanced/10-meeting-summaries.md @@ -127,15 +127,18 @@ The tab is shown when meeting summaries are enabled or the room already has summ Depending on the destination configured at the summary service, an entry is one of: - **Link to a document**, for example in La Suite Docs. The document is created in the Docs account of the room owner at meeting start, and only people the owner shares it with in Docs can open it. - Other room members see the entry, but the link only works for them after the owner has shared the document. The tab shows this hint next to the link. + Other room members see the entry, but the link only works for them after the owner has shared the document. The tab shows this hint next to the link; the owner sees a hint that the document opens in their own Docs account. - **Summary text** (destination type `frontend` at the summary service). PILOS fetches the text (`GET …/summary`), stores it, and then confirms the pickup (`DELETE …/summary`), so the summary service deletes its copy. The text is shown read-only in the room, with the Markdown rendered and sanitized: headings, lists, emphasis, code, quotes, tables and links are kept; images, embedded HTML, styles and scripts are removed, and links open in a new tab. Texts larger than 2 MiB or not encoded in UTF-8 are not stored; the pickup is still confirmed. +PILOS stores the first result of a meeting and then stops polling. If an administrator reruns the processing at the summary service after that, the new result is not transferred to PILOS and the stored meeting summary is not updated. + Access works like for recordings: - Each summary has an access setting (everyone with access to the room, participants, moderators, or owner and co-owners). New summaries start with owner and co-owners only. - The room owner, co-owners and users with the permission to manage all rooms can change the access and delete a summary. Users with the permission to view all rooms see all summaries. - Summaries are deleted after the [recording retention period](./03-recording.md#max-retention-period) (application settings) by the `cleanup:recordings` command, with the room, or by the owner or a co-owner. + A summary is also deleted together with its meeting record in the meeting history, even before the retention period ends. ## Data flow and privacy diff --git a/lang/ar/rooms.php b/lang/ar/rooms.php index 38a88f8424..69f394974d 100644 --- a/lang/ar/rooms.php +++ b/lang/ar/rooms.php @@ -201,6 +201,7 @@ 'delete' => 'حذف ملخص الاجتماع', 'delete_aria' => 'حذف ملخص اجتماع :date', 'document_hint' => 'المستند محفوظ في حساب Docs الخاص بمالك الغرفة. لا يمكنك فتحه إلا إذا شاركه المالك معك في Docs.', + 'document_hint_owner' => 'يُفتح المستند في حسابك على Docs. لا يمكن للآخرين فتحه إلا إذا شاركته معهم في Docs.', 'edit' => 'تغيير صلاحية الوصول', 'edit_aria' => 'تغيير صلاحية الوصول إلى ملخص اجتماع :date', 'filter_aria' => 'تصفية ملخصات الاجتماعات', diff --git a/lang/de-gender/rooms.php b/lang/de-gender/rooms.php index 6b4adb286b..8aadfc7c79 100644 --- a/lang/de-gender/rooms.php +++ b/lang/de-gender/rooms.php @@ -207,6 +207,7 @@ 'delete' => 'Besprechungszusammenfassung löschen', 'delete_aria' => 'Besprechungszusammenfassung vom :date löschen', 'document_hint' => 'Das Dokument liegt im Docs-Konto der Person, der der Raum gehört. Sie können es nur öffnen, wenn diese Person es in Docs für Sie freigegeben hat.', + 'document_hint_owner' => 'Das Dokument öffnet sich in Ihrem Docs-Konto. Andere können es nur öffnen, wenn Sie es in Docs für sie freigeben.', 'edit' => 'Zugriffsrecht ändern', 'edit_aria' => 'Zugriffsrecht der Besprechungszusammenfassung vom :date ändern', 'filter_aria' => 'Besprechungszusammenfassungen filtern', diff --git a/lang/de/rooms.php b/lang/de/rooms.php index 698aeff6ce..58721ad3a1 100644 --- a/lang/de/rooms.php +++ b/lang/de/rooms.php @@ -226,6 +226,7 @@ 'delete' => 'Besprechungszusammenfassung löschen', 'delete_aria' => 'Besprechungszusammenfassung vom :date löschen', 'document_hint' => 'Das Dokument liegt im Docs-Konto des Raumbesitzers. Sie können es nur öffnen, wenn der Raumbesitzer es in Docs für Sie freigegeben hat.', + 'document_hint_owner' => 'Das Dokument öffnet sich in Ihrem Docs-Konto. Andere können es nur öffnen, wenn Sie es in Docs für sie freigeben.', 'edit' => 'Zugriffsrecht ändern', 'edit_aria' => 'Zugriffsrecht der Besprechungszusammenfassung vom :date ändern', 'filter_aria' => 'Besprechungszusammenfassungen filtern', diff --git a/lang/en/rooms.php b/lang/en/rooms.php index 95f576fa03..755a6b59e9 100644 --- a/lang/en/rooms.php +++ b/lang/en/rooms.php @@ -226,6 +226,7 @@ 'delete' => 'Delete meeting summary', 'delete_aria' => 'Delete meeting summary of :date', 'document_hint' => 'The document is stored in the Docs account of the room owner. You can only open it if the owner has shared it with you in Docs.', + 'document_hint_owner' => 'The document opens in your Docs account. Other people can only open it if you share it with them in Docs.', 'edit' => 'Change access', 'edit_aria' => 'Change access to the meeting summary of :date', 'filter_aria' => 'Filter meeting summaries', diff --git a/lang/fa/rooms.php b/lang/fa/rooms.php index e51c251a32..83fb9892db 100644 --- a/lang/fa/rooms.php +++ b/lang/fa/rooms.php @@ -201,6 +201,7 @@ 'delete' => 'حذف خلاصه جلسه', 'delete_aria' => 'حذف خلاصه جلسه :date', 'document_hint' => 'این سند در حساب Docs مالک اتاق ذخیره شده است. فقط در صورتی می‌توانید آن را باز کنید که مالک آن را در Docs با شما به اشتراک گذاشته باشد.', + 'document_hint_owner' => 'سند در حساب Docs شما باز می‌شود. دیگران فقط در صورتی می‌توانند آن را باز کنند که آن را در Docs با آن‌ها به اشتراک بگذارید.', 'edit' => 'تغییر دسترسی', 'edit_aria' => 'تغییر دسترسی به خلاصه جلسه :date', 'filter_aria' => 'فیلتر خلاصه‌های جلسه', diff --git a/lang/fr/rooms.php b/lang/fr/rooms.php index 70de384fce..1c5c5bc26e 100644 --- a/lang/fr/rooms.php +++ b/lang/fr/rooms.php @@ -226,6 +226,7 @@ 'delete' => 'Supprimer le résumé de réunion', 'delete_aria' => 'Supprimer le résumé de la réunion du :date', 'document_hint' => 'Le document se trouve dans le compte Docs du propriétaire de la salle. Vous ne pouvez l\'ouvrir que si le propriétaire l\'a partagé avec vous dans Docs.', + 'document_hint_owner' => 'Le document s\'ouvre dans votre compte Docs. Les autres personnes ne peuvent l\'ouvrir que si vous le partagez avec elles dans Docs.', 'edit' => 'Modifier l\'accès', 'edit_aria' => 'Modifier l\'accès au résumé de la réunion du :date', 'filter_aria' => 'Filtrer les résumés de réunion', diff --git a/resources/js/components/RoomTabMeetingSummaries.vue b/resources/js/components/RoomTabMeetingSummaries.vue index dd1ee2fef1..8916598a9c 100644 --- a/resources/js/components/RoomTabMeetingSummaries.vue +++ b/resources/js/components/RoomTabMeetingSummaries.vue @@ -118,7 +118,11 @@ v-if="item.type === 'document'" class="text-muted-color" data-test="room-meeting-summary-document-hint" - >{{ $t("rooms.meeting_summaries.document_hint") }}{{ + isOwner + ? $t("rooms.meeting_summaries.document_hint_owner") + : $t("rooms.meeting_summaries.document_hint") + }}
@@ -214,6 +218,7 @@ import { computed, onMounted, ref } from "vue"; import { useApi } from "../composables/useApi.js"; import { useUserPermissions } from "../composables/useUserPermission.js"; import { useSettingsStore } from "../stores/settings.js"; +import { useAuthStore } from "../stores/auth"; import { usePaginator } from "../composables/usePaginator.js"; import { useDateDiff } from "../composables/useDateDiff.js"; import { useI18n } from "vue-i18n"; @@ -250,6 +255,7 @@ const emit = defineEmits([ const api = useApi(); const userPermissions = useUserPermissions(); const settingsStore = useSettingsStore(); +const authStore = useAuthStore(); const paginator = usePaginator(); const dateDiff = useDateDiff(); const { t } = useI18n(); @@ -261,6 +267,13 @@ const summaries = ref([]); const sortOrder = ref(0); const filter = ref("all"); +const isOwner = computed(() => { + return ( + authStore.currentUser != null && + authStore.currentUser.id === props.room.owner?.id + ); +}); + const retentionPeriod = computed(() => settingsStore.getSetting("recording.recording_retention_period"), ); From f51426177e096fdd3ccdf15781e18b3f50730fdb Mon Sep 17 00:00:00 2001 From: timo Date: Thu, 12 Nov 2026 13:41:55 +0100 Subject: [PATCH 17/18] Offer meeting summary texts as a Markdown download instead of rendering them A summary text stored in the room is downloaded as a Markdown file (text/markdown, attachment, nosniff) with the access rules of the list; document links are unchanged. The in-page viewer, the show endpoint, the text in the JSON resource and the marked dependency are removed. --- CHANGELOG.md | 2 +- .../api/v1/MeetingSummaryController.php | 21 ++- app/Http/Resources/MeetingSummaryResource.php | 18 --- .../08-advanced/10-meeting-summaries.md | 4 +- lang/ar/rooms.php | 5 +- lang/de-gender/rooms.php | 5 +- lang/de/rooms.php | 5 +- lang/en/rooms.php | 5 +- lang/fa/rooms.php | 5 +- lang/fr/rooms.php | 5 +- package-lock.json | 13 -- package.json | 1 - .../components/RoomMeetingSummaryViewer.vue | 77 ---------- .../js/components/RoomTabMeetingSummaries.vue | 6 +- .../RoomTabMeetingSummariesDownloadButton.vue | 118 +++++++++++++++ .../RoomTabMeetingSummariesViewButton.vue | 135 ------------------ routes/api.php | 2 +- .../Feature/api/v1/MeetingSummaryTest.php | 83 ++++++++--- 18 files changed, 223 insertions(+), 287 deletions(-) delete mode 100644 resources/js/components/RoomMeetingSummaryViewer.vue create mode 100644 resources/js/components/RoomTabMeetingSummariesDownloadButton.vue delete mode 100644 resources/js/components/RoomTabMeetingSummariesViewButton.vue diff --git a/CHANGELOG.md b/CHANGELOG.md index 407932e56d..b4f34448fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Experimental AI meeting summaries via an external summary service, independent of the recording setting of the room: room setting for the room owner in its own section, meeting type and destination per room type, owner registration and cancellation on room deletion, consent texts for meetings with summary only and with recording and summary; playback recordings of meetings with summary only are not imported -- Meeting summaries tab in the room: PILOS polls the summary service after a meeting with summary ends and lists the result per meeting, either as a link to the document in the owner's account (opens only for people the owner shares it with) or as the summary text shown read-only; access per summary like recordings (default owner and co-owners, changed or deleted by owner and co-owners), deleted after the recording retention period and with the room +- Meeting summaries tab in the room: PILOS polls the summary service after a meeting with summary ends and lists the result per meeting, either as a link to the document in the owner's account (opens only for people the owner shares it with) or as the summary text available as a Markdown file download; access per summary like recordings (default owner and co-owners, changed or deleted by owner and co-owners), deleted after the recording retention period and with the room ## [v4.20.1] - 2026-11-19 diff --git a/app/Http/Controllers/api/v1/MeetingSummaryController.php b/app/Http/Controllers/api/v1/MeetingSummaryController.php index d80603952c..a15e7559d1 100644 --- a/app/Http/Controllers/api/v1/MeetingSummaryController.php +++ b/app/Http/Controllers/api/v1/MeetingSummaryController.php @@ -17,6 +17,7 @@ use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\Log; +use Symfony\Component\HttpFoundation\HeaderUtils; class MeetingSummaryController extends Controller { @@ -72,11 +73,27 @@ public function index(Room $room, MeetingSummaryIndexRequest $request, GeneralSe return MeetingSummaryResource::collection($resource->paginate($generalSettings->pagination_page_size))->additional($additional); } - public function show(Room $room, MeetingSummary $meetingSummary): MeetingSummaryResource + /** + * Download the summary text as a Markdown file; only for summaries stored in PILOS (not for document links) + */ + public function download(Room $room, MeetingSummary $meetingSummary, GeneralSettings $generalSettings): Response { $this->authorize('viewMeetingSummary', [$room, $meetingSummary]); - return (new MeetingSummaryResource($meetingSummary))->withContent(); + if ($meetingSummary->content === null) { + abort(404); + } + + // ASCII file name from the room ID and the local start time, e.g. meeting-summary-abc-def-123-2026-11-12-0930.md + $timezone = Auth::user()?->timezone ?? $generalSettings->default_timezone; + $start = $meetingSummary->start->copy()->setTimezone($timezone)->format('Y-m-d-Hi'); + $filename = preg_replace('/[^A-Za-z0-9_-]/', '-', 'meeting-summary-'.$room->id.'-'.$start).'.md'; + + return response($meetingSummary->content, 200, [ + 'Content-Type' => 'text/markdown; charset=utf-8', + 'Content-Disposition' => HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, $filename), + 'X-Content-Type-Options' => 'nosniff', + ]); } public function update(UpdateMeetingSummaryRequest $request, Room $room, MeetingSummary $meetingSummary): MeetingSummaryResource diff --git a/app/Http/Resources/MeetingSummaryResource.php b/app/Http/Resources/MeetingSummaryResource.php index 9a0187ec3b..6cf082f008 100644 --- a/app/Http/Resources/MeetingSummaryResource.php +++ b/app/Http/Resources/MeetingSummaryResource.php @@ -9,23 +9,6 @@ class MeetingSummaryResource extends JsonResource { - /** - * Include the summary text - */ - private bool $withContent = false; - - /** - * Sets the flag to also include the summary text. - * - * @return $this - */ - public function withContent(): static - { - $this->withContent = true; - - return $this; - } - /** * Transform the resource into an array. * @@ -42,7 +25,6 @@ public function toArray(Request $request): array 'access' => $this->access, 'type' => $this->document_url !== null ? 'document' : 'content', 'document_url' => $this->document_url, - 'content' => $this->when($this->withContent, fn () => $this->content), ]; } } diff --git a/docs/docs/administration/08-advanced/10-meeting-summaries.md b/docs/docs/administration/08-advanced/10-meeting-summaries.md index 69296a9c44..5a8f3bcbc4 100644 --- a/docs/docs/administration/08-advanced/10-meeting-summaries.md +++ b/docs/docs/administration/08-advanced/10-meeting-summaries.md @@ -129,7 +129,7 @@ Depending on the destination configured at the summary service, an entry is one - **Link to a document**, for example in La Suite Docs. The document is created in the Docs account of the room owner at meeting start, and only people the owner shares it with in Docs can open it. Other room members see the entry, but the link only works for them after the owner has shared the document. The tab shows this hint next to the link; the owner sees a hint that the document opens in their own Docs account. - **Summary text** (destination type `frontend` at the summary service). PILOS fetches the text (`GET …/summary`), stores it, and then confirms the pickup (`DELETE …/summary`), so the summary service deletes its copy. - The text is shown read-only in the room, with the Markdown rendered and sanitized: headings, lists, emphasis, code, quotes, tables and links are kept; images, embedded HTML, styles and scripts are removed, and links open in a new tab. Texts larger than 2 MiB or not encoded in UTF-8 are not stored; the pickup is still confirmed. + The text is available in the room as a Markdown file download (`meeting-summary--.md`); it is not displayed in the page. To read or edit a formatted summary, use a document destination such as La Suite Docs. Texts larger than 2 MiB or not encoded in UTF-8 are not stored; the pickup is still confirmed. PILOS stores the first result of a meeting and then stops polling. If an administrator reruns the processing at the summary service after that, the new result is not transferred to PILOS and the stored meeting summary is not updated. @@ -154,7 +154,7 @@ Access works like for recordings: - PILOS does not store the playback recording of a meeting with a summary but without recording; it deletes the spool file on import. - The queued jobs contain only model IDs or the internal meeting ID, no subject or email. - Logs contain only meeting and internal meeting IDs, HTTP status codes and problem types, never the subject, email or token. -- The summary text is stored in the PILOS database (`meeting_summaries` table), visible according to its access setting, and deleted after the recording retention period, with the room, or by the owner or a co-owner. The document link points to the owner's document; deleting the entry in PILOS does not delete the document. +- The summary text is stored in the PILOS database (`meeting_summaries` table), available for download according to its access setting, and deleted after the recording retention period, with the room, or by the owner or a co-owner. The document link points to the owner's document; deleting the entry in PILOS does not delete the document. - The summary text is never written to the logs; logs contain the meeting and summary IDs and the text size only. - How long the summary service keeps the registration, recording and summary is configured there. diff --git a/lang/ar/rooms.php b/lang/ar/rooms.php index 69f394974d..d7c4181ef5 100644 --- a/lang/ar/rooms.php +++ b/lang/ar/rooms.php @@ -202,6 +202,8 @@ 'delete_aria' => 'حذف ملخص اجتماع :date', 'document_hint' => 'المستند محفوظ في حساب Docs الخاص بمالك الغرفة. لا يمكنك فتحه إلا إذا شاركه المالك معك في Docs.', 'document_hint_owner' => 'يُفتح المستند في حسابك على Docs. لا يمكن للآخرين فتحه إلا إذا شاركته معهم في Docs.', + 'download' => 'تنزيل ملخص الاجتماع', + 'download_aria' => 'تنزيل ملخص اجتماع :date كملف Markdown', 'edit' => 'تغيير صلاحية الوصول', 'edit_aria' => 'تغيير صلاحية الوصول إلى ملخص اجتماع :date', 'filter_aria' => 'تصفية ملخصات الاجتماعات', @@ -227,9 +229,6 @@ 'sort_ascending' => 'فرز ملخصات الاجتماعات تصاعديًا', 'sort_descending' => 'فرز ملخصات الاجتماعات تنازليًا', 'title' => 'ملخصات الاجتماعات', - 'view' => 'عرض ملخص الاجتماع', - 'view_aria' => 'عرض ملخص اجتماع :date', - 'view_title' => 'ملخص اجتماع :date', ], 'members' => [ 'add_single_user' => 'إضافة مستخدم واحد', diff --git a/lang/de-gender/rooms.php b/lang/de-gender/rooms.php index 8aadfc7c79..0215592959 100644 --- a/lang/de-gender/rooms.php +++ b/lang/de-gender/rooms.php @@ -208,6 +208,8 @@ 'delete_aria' => 'Besprechungszusammenfassung vom :date löschen', 'document_hint' => 'Das Dokument liegt im Docs-Konto der Person, der der Raum gehört. Sie können es nur öffnen, wenn diese Person es in Docs für Sie freigegeben hat.', 'document_hint_owner' => 'Das Dokument öffnet sich in Ihrem Docs-Konto. Andere können es nur öffnen, wenn Sie es in Docs für sie freigeben.', + 'download' => 'Besprechungszusammenfassung herunterladen', + 'download_aria' => 'Besprechungszusammenfassung vom :date als Markdown-Datei herunterladen', 'edit' => 'Zugriffsrecht ändern', 'edit_aria' => 'Zugriffsrecht der Besprechungszusammenfassung vom :date ändern', 'filter_aria' => 'Besprechungszusammenfassungen filtern', @@ -233,9 +235,6 @@ 'sort_ascending' => 'Besprechungszusammenfassungen aufsteigend sortieren', 'sort_descending' => 'Besprechungszusammenfassungen absteigend sortieren', 'title' => 'Besprechungszusammenfassungen', - 'view' => 'Besprechungszusammenfassung anzeigen', - 'view_aria' => 'Besprechungszusammenfassung vom :date anzeigen', - 'view_title' => 'Besprechungszusammenfassung vom :date', ], 'members' => [ 'add_single_user' => 'Einen Benutzer hinzufügen', diff --git a/lang/de/rooms.php b/lang/de/rooms.php index 58721ad3a1..2e1929be08 100644 --- a/lang/de/rooms.php +++ b/lang/de/rooms.php @@ -227,6 +227,8 @@ 'delete_aria' => 'Besprechungszusammenfassung vom :date löschen', 'document_hint' => 'Das Dokument liegt im Docs-Konto des Raumbesitzers. Sie können es nur öffnen, wenn der Raumbesitzer es in Docs für Sie freigegeben hat.', 'document_hint_owner' => 'Das Dokument öffnet sich in Ihrem Docs-Konto. Andere können es nur öffnen, wenn Sie es in Docs für sie freigeben.', + 'download' => 'Besprechungszusammenfassung herunterladen', + 'download_aria' => 'Besprechungszusammenfassung vom :date als Markdown-Datei herunterladen', 'edit' => 'Zugriffsrecht ändern', 'edit_aria' => 'Zugriffsrecht der Besprechungszusammenfassung vom :date ändern', 'filter_aria' => 'Besprechungszusammenfassungen filtern', @@ -252,9 +254,6 @@ 'sort_ascending' => 'Besprechungszusammenfassungen aufsteigend sortieren', 'sort_descending' => 'Besprechungszusammenfassungen absteigend sortieren', 'title' => 'Besprechungszusammenfassungen', - 'view' => 'Besprechungszusammenfassung anzeigen', - 'view_aria' => 'Besprechungszusammenfassung vom :date anzeigen', - 'view_title' => 'Besprechungszusammenfassung vom :date', ], 'members' => [ 'add_single_user' => 'Einen Benutzer hinzufügen', diff --git a/lang/en/rooms.php b/lang/en/rooms.php index 755a6b59e9..858fe7b040 100644 --- a/lang/en/rooms.php +++ b/lang/en/rooms.php @@ -227,6 +227,8 @@ 'delete_aria' => 'Delete meeting summary of :date', 'document_hint' => 'The document is stored in the Docs account of the room owner. You can only open it if the owner has shared it with you in Docs.', 'document_hint_owner' => 'The document opens in your Docs account. Other people can only open it if you share it with them in Docs.', + 'download' => 'Download meeting summary', + 'download_aria' => 'Download the meeting summary of :date as a Markdown file', 'edit' => 'Change access', 'edit_aria' => 'Change access to the meeting summary of :date', 'filter_aria' => 'Filter meeting summaries', @@ -252,9 +254,6 @@ 'sort_ascending' => 'Sort meeting summaries ascending', 'sort_descending' => 'Sort meeting summaries descending', 'title' => 'Meeting summaries', - 'view' => 'Show meeting summary', - 'view_aria' => 'Show the meeting summary of :date', - 'view_title' => 'Meeting summary of :date', ], 'members' => [ 'add_single_user' => 'Add single user', diff --git a/lang/fa/rooms.php b/lang/fa/rooms.php index 83fb9892db..571bb47a64 100644 --- a/lang/fa/rooms.php +++ b/lang/fa/rooms.php @@ -202,6 +202,8 @@ 'delete_aria' => 'حذف خلاصه جلسه :date', 'document_hint' => 'این سند در حساب Docs مالک اتاق ذخیره شده است. فقط در صورتی می‌توانید آن را باز کنید که مالک آن را در Docs با شما به اشتراک گذاشته باشد.', 'document_hint_owner' => 'سند در حساب Docs شما باز می‌شود. دیگران فقط در صورتی می‌توانند آن را باز کنند که آن را در Docs با آن‌ها به اشتراک بگذارید.', + 'download' => 'دانلود خلاصه جلسه', + 'download_aria' => 'دانلود خلاصه جلسه :date به صورت فایل Markdown', 'edit' => 'تغییر دسترسی', 'edit_aria' => 'تغییر دسترسی به خلاصه جلسه :date', 'filter_aria' => 'فیلتر خلاصه‌های جلسه', @@ -227,9 +229,6 @@ 'sort_ascending' => 'مرتب‌سازی صعودی خلاصه‌های جلسه', 'sort_descending' => 'مرتب‌سازی نزولی خلاصه‌های جلسه', 'title' => 'خلاصه‌های جلسه', - 'view' => 'نمایش خلاصه جلسه', - 'view_aria' => 'نمایش خلاصه جلسه :date', - 'view_title' => 'خلاصه جلسه :date', ], 'members' => [ 'add_single_user' => 'افزودن کاربر تکی', diff --git a/lang/fr/rooms.php b/lang/fr/rooms.php index 1c5c5bc26e..3ad7a0c709 100644 --- a/lang/fr/rooms.php +++ b/lang/fr/rooms.php @@ -227,6 +227,8 @@ 'delete_aria' => 'Supprimer le résumé de la réunion du :date', 'document_hint' => 'Le document se trouve dans le compte Docs du propriétaire de la salle. Vous ne pouvez l\'ouvrir que si le propriétaire l\'a partagé avec vous dans Docs.', 'document_hint_owner' => 'Le document s\'ouvre dans votre compte Docs. Les autres personnes ne peuvent l\'ouvrir que si vous le partagez avec elles dans Docs.', + 'download' => 'Télécharger le résumé de réunion', + 'download_aria' => 'Télécharger le résumé de la réunion du :date en fichier Markdown', 'edit' => 'Modifier l\'accès', 'edit_aria' => 'Modifier l\'accès au résumé de la réunion du :date', 'filter_aria' => 'Filtrer les résumés de réunion', @@ -252,9 +254,6 @@ 'sort_ascending' => 'Trier les résumés de réunion par ordre croissant', 'sort_descending' => 'Trier les résumés de réunion par ordre décroissant', 'title' => 'Résumés de réunion', - 'view' => 'Afficher le résumé de réunion', - 'view_aria' => 'Afficher le résumé de la réunion du :date', - 'view_title' => 'Résumé de la réunion du :date', ], 'members' => [ 'add_single_user' => 'Ajouter un utilisateur unique', diff --git a/package-lock.json b/package-lock.json index 952a92b1d4..0d9f1ca4bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,6 @@ "dotenv": "^18.0.9", "laravel-vite-plugin": "^3.2.0", "lodash-es": "^4.18.1", - "marked": "18.2.0", "mitt": "^3.0.1", "pinia": "^4.1.0", "primeicons": "^7.0.0", @@ -8938,18 +8937,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/marked": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-18.2.0.tgz", - "integrity": "sha512-KaeL+tAbtvI930q7HE2PN5lYXYdT8EiSmxHlN6F3rsfb57wd5mp5W5TLazpdj4inTQBJdgjYwbs40W/0VUGU+Q==", - "license": "MIT", - "bin": { - "marked": "bin/marked.js" - }, - "engines": { - "node": ">= 20" - } - }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", diff --git a/package.json b/package.json index 02672ff4eb..41f78c57c5 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,6 @@ "dotenv": "^18.0.9", "laravel-vite-plugin": "^3.2.0", "lodash-es": "^4.18.1", - "marked": "18.2.0", "mitt": "^3.0.1", "pinia": "^4.1.0", "primeicons": "^7.0.0", diff --git a/resources/js/components/RoomMeetingSummaryViewer.vue b/resources/js/components/RoomMeetingSummaryViewer.vue deleted file mode 100644 index ecc5c1fb76..0000000000 --- a/resources/js/components/RoomMeetingSummaryViewer.vue +++ /dev/null @@ -1,77 +0,0 @@ - - diff --git a/resources/js/components/RoomTabMeetingSummaries.vue b/resources/js/components/RoomTabMeetingSummaries.vue index 8916598a9c..285e399d3b 100644 --- a/resources/js/components/RoomTabMeetingSummaries.vue +++ b/resources/js/components/RoomTabMeetingSummaries.vue @@ -146,8 +146,8 @@ data-test="room-meeting-summaries-open-document-button" /> - - + +