Compare commits

...

89 Commits

Author SHA1 Message Date
leo b56bcc38c8 ⬆️(dependencies) update python dependencies
Update python dependencies.
2026-07-06 20:34:09 +02:00
snyk-bot c3abd0441f ⬆️(agents) upgrade to python 3.14 slim
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-DEBIAN13-OPENSSL-17269387
- https://snyk.io/vuln/SNYK-DEBIAN13-OPENSSL-17269392
- https://snyk.io/vuln/SNYK-DEBIAN13-OPENSSL-17269400
- https://snyk.io/vuln/SNYK-DEBIAN13-OPENSSL-17269409
- https://snyk.io/vuln/SNYK-DEBIAN13-OPENSSL-17269415
2026-07-06 20:06:55 +02:00
snyk-bot 79245389ce ⬆️(frontend) dedupe react-stately, align react-aria packages
Add react-aria 3.49.0 + react-stately 3.47.0 as direct deps and bump
react-aria-components to 1.18.0 so react-stately resolves to one version.
Fixes the nominal Timer type clash and missing @react-stately/toast
imports introduced by the React Aria v1.17 monopackage consolidation.
2026-07-06 20:00:52 +02:00
Florent Chehab 3b3f992834 🐛(summary) support media files with bad streams
Rarely media files may have one or multiple
empty streams when they are badly formatted.
The extract metadata code would crash when that happened.
We now avoid crashing and create a clean file
from the bad one to make sure API calls with that data
works properly (observed some failures otherwise
in my tests).
2026-07-06 16:39:40 +02:00
lebaudantoine a98dc1484a 🩹(backend) fix case-insensitive email deduplication in merge command
The management command that merges users with duplicate emails was
comparing emails in a case-insensitive manner, which left some
duplicates in the database when their emails only differed by case.
2026-07-06 16:03:50 +02:00
snyk-bot dca24a1b25 ⬆️(frontend) upgrade i18next from 26.2.0 to 26.3.1
Snyk has created this PR to upgrade i18next from 26.2.0 to 26.3.1.

See this package in npm:
i18next

See this project in Snyk:
https://app.eu.snyk.io/org/lasuite-dinum-default/project/96ea03d8-8d09-493d-86bf-363f274e129e?utm_source=github&utm_medium=referral&page=upgrade-pr
2026-07-06 16:00:58 +02:00
leo 74b791e207 🐛(makefile) fix passing args to tests in makefile
When using Makefile to launch tests, passing flags as well as specific
classes (using "::") was broken. This PR fixes this issue, by adding
an `ARGS` argument allowing to do
`make test ARGS="core/tests/foo.py::Test::x -vv"`.
2026-07-06 15:17:05 +02:00
Bastien Ogier df1495c97b 🚀(paas) fix scalingo frontend build failure
(paas) fix scalingo frontend build failure
2026-07-03 19:40:15 +02:00
Florent Chehab c95e1c67bd ⬆️(summary) update ffmpeg to 8.1.2
Update ffmpeg to 8.1.2 inside summary docker image.
Maintenance task.
2026-07-03 18:51:11 +02:00
Florent Chehab f115c83752 ⬆️(summary) update alpine base image
Update alpine docker base image to 3.24.
Maintenance routine task
2026-07-03 18:51:11 +02:00
snyk-bot ebfcb42a7d fix: upgrade posthog-js from 1.382.0 to 1.386.5
Snyk has created this PR to upgrade posthog-js from 1.382.0 to 1.386.5.

See this package in npm:
posthog-js

See this project in Snyk:
https://app.eu.snyk.io/org/lasuite-dinum-default/project/96ea03d8-8d09-493d-86bf-363f274e129e?utm_source=github&utm_medium=referral&page=upgrade-pr
2026-07-03 17:53:56 +02:00
lebaudantoine c86a47f736 ⬆️(backend) update joserfc to 1.6.8 to fix CVE-2026-49852
joserfc versions before 1.6.8 accept an empty or nil HMAC key when
verifying HS256/HS384/HS512 tokens, which is a cross-language
sibling of CVE-2026-45363.

Bump joserfc from 1.6.4 to 1.6.8 to pick up the fix.

Ref: https://avd.aquasec.com/nvd/cve-2026-49852
2026-07-03 17:32:46 +02:00
lebaudantoine dd6b4512c8 🔖(minor) bump release to 1.22.0 2026-07-03 17:32:46 +02:00
lebaudantoine f82fd4bece 🔖(chart) release chart 0.0.26
Fix posthog ingresses.
2026-07-03 14:34:39 +02:00
lebaudantoine edab18d94a 🩹(helm) fix Helm ingress rendering when passing multiple hosts
Passing a list of hosts in the ingress was broken: the template
helpers were called with the current loop context (`.`) instead of
the root context (`$`), so the service name was rendered incorrectly
inside the hosts loop.
2026-07-03 14:34:39 +02:00
Cyril 636c2168be 🩹(frontend) allow fullscreen share warning interaction in PiP
Enable PiP fullscreen share warning buttons; drop `inert` from StageFrame
2026-07-03 11:31:36 +02:00
Cyril d54e9c2ad0 ♻️(frontend) autofocus stop button in fullscreen share warning
Replace the focus effect and ref with autoFocus on the stop button.
2026-07-03 11:31:36 +02:00
lebaudantoine 657712d7cb (backend) track meeting link generation events
Track events whenever a new meeting link is generated, both through
the public API and through the external API.

The goal is twofold:

* Identify where the most links are generated from, so we can assess
  which integration or entry point works best.
* Measure how many links are generated per user, so we can consider
  a user truly active when they generate a link, rather than only
  when they participate in a meeting.
2026-07-02 17:01:46 +02:00
lebaudantoine d2bfbee389 🩹(backend) fix client_id retrieval from request.auth
request.auth is a dict, not an object, so the getattr call was
failing when trying to retrieve client_id. Access it as a dict key
instead.
2026-07-02 17:01:46 +02:00
lebaudantoine 9ba97fd14f (backend) introduce a configurable analytics system
Add an analytics abstraction that allows configuring which analytics
solution the app uses. PostHog is implemented as one backend, but by
default no analytics backend is activated.

The goal is to track events in a sufficiently organized way and to
let any developer implement their own backend as long as it follows
the same protocol.
2026-07-02 17:01:46 +02:00
lebaudantoine be0d0927d4 (backend) install PostHog SDK in the backend
Add the PostHog SDK to the backend so we can send analytics events
from server-side code. We currently lack data on events triggered
from the backend, and this closes that gap.
2026-07-02 17:01:46 +02:00
ilias 27dce44d40 (backend) cover encoded S3 keys with plus signs
Add a regression test for already encoded S3 notification keys that contain plus signs in the prefix.
2026-07-02 12:23:31 +02:00
ilias 78acaf395e 🐛(backend) normalize raw S3 object keys
Correction to preserve already encoded plus signs in addition to slashes.
2026-07-02 12:23:31 +02:00
ilias 4e5e648730 (backend) add parser test docstrings
Add docstrings to the S3 parser tests
2026-07-02 12:23:31 +02:00
ilias 924fe95d94 📝(docs) update changelog for S3 notification key compatibility 2026-07-02 12:23:31 +02:00
ilias e3e33c7d0a 🐛(backend) normalize S3 notification object keys 2026-07-02 12:23:31 +02:00
lebaudantoine 16ee575ff8 (all) support a dedicated domain for the PostHog feature flag API
Ad blockers recently started blocking requests to our PostHog
feature flag API, leading to undesired behavior in the app.

Following PostHog's documentation, allow configuring a dedicated
domain for feature flags, isolated from the main PostHog domain.
2026-07-01 11:48:47 +02:00
lebaudantoine e42b083f20 🛂(backend) reject user access tokens on the API
The original implementation, introduced two years ago, was incorrect
and exposed the API to an undesired authentication mode: any user
access token obtained for a given user was being accepted as valid
credentials on the external API.

Restrict authentication to the intended mode so that user access
tokens are no longer accepted on this API.

Thanks @lunika spotting this.
2026-07-01 11:24:59 +02:00
snyk-bot 6d2c31eb0a fix: upgrade @pandacss/preset-panda from 1.11.1 to 1.11.3
Snyk has created this PR to upgrade @pandacss/preset-panda from 1.11.1 to 1.11.3.

See this package in npm:
@pandacss/preset-panda

See this project in Snyk:
https://app.eu.snyk.io/org/lasuite-dinum-default/project/96ea03d8-8d09-493d-86bf-363f274e129e?utm_source=github&utm_medium=referral&page=upgrade-pr
2026-06-30 18:56:32 +02:00
Cyril e9bdf173de 🩹(frontend) enable screen share button in PiP
Enable screen share button in PiP by passing showScreenShare to PipControlBar
2026-06-30 16:18:05 +02:00
leo dd23ce817a 📝(agents) add missing metadata_collector.dist environment template
PR #1446 introduced compose setup cleanup but ommited the
`metadata_collector.dist` environment template. Add this new file
to the repository.
2026-06-30 15:09:20 +02:00
lebaudantoine 1ca8f6e5ea 📝(doc) add email.eu to the list of known instances
List email.eu as one of the known instances running La Suite Meet.
2026-06-30 15:09:07 +02:00
Cyril f98e884067 (frontend) cap and paginate tiles in picture-in-picture
Cap PiP grid at 5 tiles per page with active-speaker priority and pagination.
2026-06-29 16:55:15 +02:00
Cyril b498926353 ️(frontend) improve pagination control accessibility
Turn main-window pagination into a labelled nav landmark with a live
page counter for screen readers. Add pagination.label in all locales.
2026-06-29 16:51:09 +02:00
lebaudantoine 3d4dc2d631 🚸(frontend) use "Advanced" instead of "Premium" in the sidepanel
Following internal feedback, rename the "Premium" wording to
"Advanced" across the transcription and recording sidepanels, so the
label no longer implies a paid tier.
2026-06-29 16:38:54 +02:00
lebaudantoine 1523e6aec9 📝(docs) precise the French generalization by the PM
Add a note in the documentation about La Suite Meet being
generalized by the French Prime Minister, along with a link to an
English-language source article.
2026-06-29 13:31:32 +02:00
lebaudantoine 99510c9c6a 📝(docs) add Clever Cloud as a La Suite Meet SaaS provider
List Clever Cloud as one of the providers offering La Suite Meet as
a SaaS.
2026-06-29 13:31:32 +02:00
lebaudantoine 9f003e95f3 📝(docs) highlight community interaction earlier in the README
Add a tip explaining how to interact with the community
higher up in the README so it is more visible to newcomers.
2026-06-29 13:31:32 +02:00
lebaudantoine 46c30b6fcd 📝(docs) clarify contribution guidelines
Update the contribution documentation to make the conditions of
contribution to the project clearer.

Also encourage potential contributors to connect with the community
and get involved.
2026-06-29 13:31:32 +02:00
snyk-bot 1533ae8a3c fix: upgrade posthog-js from 1.379.2 to 1.382.0
Snyk has created this PR to upgrade posthog-js from 1.379.2 to 1.382.0.

See this package in npm:
posthog-js

See this project in Snyk:
https://app.eu.snyk.io/org/lasuite-dinum-default/project/96ea03d8-8d09-493d-86bf-363f274e129e?utm_source=github&utm_medium=referral&page=upgrade-pr
2026-06-29 13:31:11 +02:00
leo 526e96797e ♻️(env) refactor env variables handling
Add missing variables and homogenize env settings between agents.
Create missing dist file for metadata collector.
2026-06-29 13:28:54 +02:00
Maarten Draijer 8903a55008 📝(docs) document rebranding the favicon via a volume mount
The favicon is bundled into the frontend image as static files served from
/usr/share/nginx/html. Rather than add a runtime config knob, document how to
overlay custom icons with a volume (ConfigMap + frontend.extraVolumes/
extraVolumeMounts). This serves the right icon from the first byte — no
rebuild, no favicon flash — and covers every variant, including the iOS
home-screen and Android/PWA icons.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 03:12:31 +02:00
snyk-bot 2a60b49086 fix: upgrade posthog-js from 1.376.4 to 1.379.2
Snyk has created this PR to upgrade posthog-js from 1.376.4 to 1.379.2.

See this package in npm:
posthog-js

See this project in Snyk:
https://app.eu.snyk.io/org/lasuite-dinum-default/project/96ea03d8-8d09-493d-86bf-363f274e129e?utm_source=github&utm_medium=referral&page=upgrade-pr
2026-06-28 03:07:09 +02:00
leo aee1847303 (backend) add LiveKit egress_ended fallback for saving recordings
Recording lifecycle previously relied exclusively on the MinIO storage-hook
endpoint to transition from STOPPED to SAVED, which made the system dependent
on MinIO bucket notifications and lifecycle configuration. Introduce support
for LiveKit egress_ended webhook (EGRESS_COMPLETE, EGRESS_LIMIT_REACHED) as
 an alternative finalization mechanism for self-hosted deployments that do
 not use MinIO / S3 hooks.

Change behavior of existing configuation RECORDING_STORAGE_EVENT_ENABLE.
When the LiveKit mechanism is enabled (RECORDING_STORAGE_EVENT_ENABLE=False),
RecordingEventsService.handle_complete is triggered from
LiveKitEventsService._handle_egress_ended.
2026-06-24 20:51:58 +02:00
snyk-bot 6b7cd8ab2e fix: upgrade posthog-js from 1.376.0 to 1.376.4
Snyk has created this PR to upgrade posthog-js from 1.376.0 to 1.376.4.

See this package in npm:
posthog-js

See this project in Snyk:
https://app.eu.snyk.io/org/lasuite-dinum-default/project/96ea03d8-8d09-493d-86bf-363f274e129e?utm_source=github&utm_medium=referral&page=upgrade-pr
2026-06-24 16:25:36 +02:00
Bolaji Ayodeji cc2a0ad322 Add DPG badge to README 2026-06-22 16:35:41 +02:00
Florent Chehab 3300226bbe 🧱(helm) include app labels and cron job name in cron jobs
Jobs created from cron jobs were lacking some labels that ease
with targetting them notably as part of network policies.
2026-06-22 15:38:26 +02:00
Florent Chehab 8efb11b3ae ⬆️(backend) upgrade cryptography package
The version we were using had a CVE.
2026-06-22 10:59:37 +02:00
Florent Chehab 8cf15cabaf 🔨(summary) change default transcribe model
This changes the default model when transcribing in dev
to openai/whisper-large-v3, which is the model provided
by AlbertAPI.
2026-06-18 18:10:50 +02:00
Florent Chehab 9b7c449ca5 🐛(summary) explicit transcription response format
We should be able to use other transcription services,
those usually relie on response_format="diarized_json"
to produce what we need.

Note that as part of this change, we stop using
openai library for making this call to avoid
casting the result to a payload that doesn't
contain the elements we used to rely on.
(setting this specific format auto cast the
results in openai lib). We keep the old
result class used.
2026-06-18 18:10:50 +02:00
Florent Chehab 5c27aba00f (summary) relaxed WhisperX response model
When going through AlbertAPI, timestamp are not provided at the word level.
This adds default values so that the summary external contract stays the same,
while giving us compatibility wisht AlbertAPI.
2026-06-18 18:10:03 +02:00
Florent Chehab 7256b87511 👷(ci) push images on integration branches
* Usefull for debugging directly on stagin
2026-06-18 18:10:03 +02:00
Florent Chehab 7b7951a0e0 🧱(helm) run clean files command as cronjob
Updates the help chart to be able to run a list of CronJobs.
By defaults it runs the clean_pending_files
and purge_deleted_files commands during the night.
2026-06-18 18:07:43 +02:00
Florent Chehab 5c15140783 (backend) add command to clean pending and deleted files
Since we have added custom backgrounds, they could be
soft deleted but were never really deleted.
This commits introduces a command to actually delete
this files.
In introduces also a command to purge pending upload
.
2026-06-18 18:07:43 +02:00
lebaudantoine 898bc9a0f8 🔖(minor) bump release to 1.21.0 2026-06-15 18:29:52 +02:00
Florent Chehab fd1715bacf ️(frontend) proper aria labels on custom backgrounds
* Set the aria-label to something meaningful,
* Set the delete btn aria label
2026-06-15 17:49:50 +02:00
Florent Chehab c9de7d049f ️(frontend) improve effects accessibility structure
* Set sub-headings to level 3, to be coherent
* Set role to list & list-item on background items list
2026-06-15 17:49:47 +02:00
Florent Chehab 6368b676a6 ️(frontend) set aria hidden on video effects preview
It makes sense to set aria-hidden for this video.
2026-06-15 17:49:47 +02:00
Florent Chehab 65789ef706 ️(frontend) fix blur effects aria label
Was configured to always light.
2026-06-15 17:49:46 +02:00
lebaudantoine c0feb1ee82 🐛(frontend) fix metadata agent collector enabled check
Fix an incorrect check that caused issues in production when
determining whether the metadata agent collector is enabled.
2026-06-15 17:48:50 +02:00
leo 135b99aee7 (summary) add optional satisfaction survey footer
Add a footer to transcription outputs linking to an external satisfaction
survey. The survey URL is built from TRANSCRIPTION_SATISFACTION_FORM_BASE_URL.
When TRANSCRIPTION_SATISFACTION_FORM_BASE_URL is unset or None, the
footer is omitted.
2026-06-15 17:33:24 +02:00
lebaudantoine 040df0e15a 🚸(frontend) mute participants by default when joining a large meeting
When joining a meeting that already has many participants, new
participants are now muted by default.

This is an empirical change, not directly requested by users but
informed by user experience: a lot of people joining large meetings
arrive with their microphone and/or camera open, which can be
painful for the host, who otherwise has to mute everyone or ask
everyone to mute. Many of these participants are inattentive but
still noisy.

If you are joining a room that is already at a certain size, you are
probably not the one expected to speak; presenters typically join
among the very first participants.
2026-06-15 17:02:00 +02:00
lebaudantoine 00e197b216 🚸(frontend) mute join notification sound in larger rooms
In particularly large rooms, with more than 5 or 10 participants,
the entry notification sound can quickly feel spammy.

A configuration to disable it exists, but new users do not discover
it easily. The sound notification is most useful while waiting for
the first few participants to arrive; once a few people are in, the
meeting usually starts and the sound becomes more disruptive than
helpful.

The visual notification remains in place, so users are still aware
when newcomers join. Roll this out and check whether users find the
change helpful.
2026-06-15 17:02:00 +02:00
lebaudantoine eae1a382d5 🩹(frontend) fix options unwrapping when silent login is disabled
The options were not properly unwrapped when silent login was
disabled, leading to incorrect behavior in that code path.
2026-06-14 00:49:42 +02:00
lebaudantoine d4a7cf279c (frontend) allow hiding the login button via a URL parameter
Required by some self-hosters who want to present a link to
participants that are guests only, without access to their SSO. For
example, a meeting between a citizen and a public servant where the
guest is known not to have an account.

Also useful when rendering the join page inside an iframe.
2026-06-14 00:49:42 +02:00
lebaudantoine 70a296eea6 (frontend) allow disabling silent login via a URL parameter
Several clients ran into issues with the silent login, leading to
redirections that were not appropriate for their use case.

Offer a URL parameter to control this behavior and disable silent
login when needed.
2026-06-14 00:49:42 +02:00
lebaudantoine ac85a20271 ️(frontend) lazy-load @libreaudio/la-call via dynamic import
The noise-suppression processor is now imported on demand with a
dynamic import() instead of a top-level static import, so it lands in
its own code-split chunk rather than the main bundle.

Why this is necessary:

* @libreaudio/la-call is fully self-contained. It inlines *everything*
  as JavaScript: two WASM binaries (SIMD and non-SIMD variants), the
  Emscripten glue, the worklet processor source, and the noise model
  plus its weights — the model is compiled into the .wasm, so we ship
  effectively two copies of it.

* The WASM is inlined as numeric array literals (new Uint8Array([...])),
  the least compact representation possible (~2-4 source chars/byte) and
  not meaningfully minifiable. The result is a large module that also
  can't be stream-compiled the way an external .wasm asset would be.

* A static import would pull all of that into the initial bundle,
  inflating critical-path download size and lengthening build time
  (parsing/minifying the big literal) — for a feature that's only used
  when the user actually turns on noise suppression.

* Dynamic import() isolates the whole payload in a separate,
  content-hashed, browser-cached chunk. The cost (chunk fetch + WASM
  instantiation) becomes a one-time hit deferred to first activation,
  and is fully off the page's initial load path.

Notes:

* The library self-bundles its AudioWorklet at runtime from a Blob URL
  and inlines the WASM, so it needs no build-tool asset plumbing
  (no ?worker&url / ?url, no Vite asset config). The dynamic import is
  therefore the only splitting mechanism required.

* Audio processing still runs off the main thread on the AudioWorklet
  path (desktop/most browsers); only the Android ScriptProcessor
  fallback runs on the main thread. Import style does not affect this.

* To hide the first-activation latency, the chunk can be prefetched
  (e.g. import() on idle or <link rel="modulepreload">) so it's warm
  before the user enables suppression.
2026-06-13 13:30:20 +02:00
falkTX 13036f6ab7 (frontend) enhance noise reduction with BBBA audio processing pipeline
Replace the basic RNN noise processor with a more advanced audio
pipeline powered by Big Blue Better Audio (BBBA), a project
supported by the Prototype Fund.

The new WASM-based pipeline introduced by @falkTX and
@trummerschlunk adds:
- voice isolation
- high-pass filtering
- spectral balancing
- multiband compression
- low-pass filtering

This significantly improves overall audio quality and speech
clarity.

More information about the pipeline is available on the
trummerschlunk/BigBlueBetterAudio repo.

Voice isolation still relies on RNNNoise, a widely used deep
learning-based denoising model. Audio quality could be further
improved in the future if DeepFilterNet becomes usable directly
in the browser.

Their code has been released in an NPM package under GPL license.
2026-06-13 13:30:20 +02:00
lebaudantoine 64819b3696 🔖(minor) bump release to 1.20.0 2026-06-12 17:25:56 +02:00
lebaudantoine 53722ad1bc 🩹(frontend) fix CSP regression breaking inline styles and ProConnect
A previous CSP change suggested by CodeRabbit was not properly
tested and broke inline styling as well as the loading of the
ProConnect image.

Adjust the CSP directives to allow these resources again.
2026-06-12 15:54:26 +02:00
lebaudantoine dcfdd35c82 🔖(helm) release chart 0.0.23 2026-06-12 09:38:53 +02:00
snyk-bot 16f465432d fix: upgrade react-i18next from 15.1.1 to 17.0.8
Snyk has created this PR to upgrade react-i18next from 15.1.1 to 17.0.8.

See this package in npm:
react-i18next

See this project in Snyk:
https://app.eu.snyk.io/org/lasuite-dinum-default/project/96ea03d8-8d09-493d-86bf-363f274e129e?utm_source=github&utm_medium=referral&page=upgrade-pr
2026-06-12 09:11:07 +02:00
lebaudantoine 90f95ab2a9 ⬆️(frontend) upgrade libcrypto3 and libssl3 to 3.5.7-r0
Patches CVE-2026-45447 (HIGH), heap use-after-free in OpenSSL
PKCS7_verify(), flagged by Trivy scan of the frontend image.

- libcrypto3: 3.5.6-r0 -> 3.5.7-r0
- libssl3: 3.5.6-r0 -> 3.5.7-r0

Ref: https://avd.aquasec.com/nvd/cve-2026-45447
2026-06-11 16:26:13 +02:00
leo 61f7ad05e9 🐛(frontend) fix noise reduction left-channel-only audio
Fix bug with RNNoise noise reduction which interprets mono input
as left channel with some browsers.
2026-06-11 16:26:13 +02:00
lebaudantoine 69a6dd1463 🩹(frontend) fix missing default-src in CSP configuration
The CSP was missing a default-src directive (flagged by CodeRabbit).
Without it, styles, images, fonts, and media are completely
unrestricted, which undercuts the otherwise strict policy.

Set default-src to 'self' and add an explicit style-src directive
since we rely on inline styles (e.g. #close-msg and the view
toggling use inline style attributes), so style-src needs to allow
'self' and 'unsafe-inline'.
2026-06-11 15:16:52 +02:00
lebaudantoine 6d06aee92d 📝(addon) update the changelog
please refer the previous commits where I enhanced the whole
addin features.
2026-06-11 15:16:52 +02:00
lebaudantoine 54908b9caa 🔧(addon) parametrize the frontend nginx configuration via a volume
Mount the nginx configuration used by the frontend image as a volume
so the default one can be overridden by a custom configuration at
deployment time.

Based on suggestions from @rouja to help parametrize the
configuration at deployment time.
2026-06-11 15:16:52 +02:00
lebaudantoine 08af6e77bb 📌(addon) pin dependencies to their currently installed versions
Improve code quality and reproducibility by pinning project
dependencies to the exact versions currently installed.
2026-06-11 15:16:52 +02:00
lebaudantoine 4525c9c255 💄(addon) align the beta tag with the UI kit styling
Update the beta tag to follow the UI kit styling so it clearly
signals that the plugin is in beta.
2026-06-11 15:16:52 +02:00
lebaudantoine 44d3ed8f2e (addon) add a feedback form link in the footer
Add the possibility to display a feedback form link in the footer to
help collect feedback from the first users of the plugin.

Once the plugin is in production at scale, this will be replaced
with a link to the support page.
2026-06-11 15:16:52 +02:00
lebaudantoine 9522dc72ac 📈(addon) allow appending an Outlook source query param to the URL
Offer the possibility to append a query parameter at the end of the
meeting URL to flag links created from the Outlook plugin, inspired
by Zoom.

The behavior is toggled via an environment variable.
2026-06-11 15:16:52 +02:00
lebaudantoine 09dbb250a7 🚸(addon) switch add button to remove when a link already exists
From the task panel, change the "add" button to "remove" when a
meeting link is already present.

This will be updated to "update" once the external API supports
updating an existing room.
2026-06-11 15:16:52 +02:00
lebaudantoine 321cb99f82 🩹(addon) skip link generation when one already exists in the event
Detect whether a meeting link is already present in the calendar
event item or its body, and prevent generating a new link if one is
found.

Detection is based on the presence of the app URL in the text. This
is imperfect but covers the most naive scenarios.
2026-06-11 15:16:52 +02:00
lebaudantoine 52bad6faaf 🔖(addons) bump plugin version to 0.0.2
Update the plugin version displayed to the user to 0.0.2 and move the
tag from alpha to beta.
2026-06-11 15:16:52 +02:00
lebaudantoine 0065527a5e 🌐(addon) internationalize the addon
Refactor the plugin to support internationalization and ship it in
three languages.

Internationalizing requires updating the manifest, which involves
touching the Helm chart and releasing a new version. Ship a beta
version of the plugin once the i18n work is done to bundle these
changes together.
2026-06-11 15:16:52 +02:00
lebaudantoine 818d20888e 💄(addons) use the app logo for the "create a meeting link" ribbon action
In the ribbon, the "create a meeting link" action was displayed with
the generic add icon, which is fitting in the context of a menu but
not explicit enough on its own.

Following feedback from the social ministries, replace the add icon
with the app logo to make it clear that this button creates a
videoconference link.
2026-06-11 15:16:52 +02:00
lebaudantoine f1fce4431f ♻️(addons) insert meeting link at the cursor position
Instead of appending the meeting link at the end of the email, insert
it where the user's cursor is. This ensures the link is not placed
after the email signature, or below the quoted thread in a reply.
2026-06-11 15:16:52 +02:00
lebaudantoine 491866e584 ♻️(addons) try using the default client font
Refactor the message builder so that rendered messages are displayed
in a nicer way. Based on user feedback from the social ministries.

Go for a hybrid approach: on the desktop client, insert plain text so
it picks up the default font configured by the client theme; on the
web client, insert HTML, as the editor there is rendered using HTML.
2026-06-11 15:16:52 +02:00
lebaudantoine f777f2fdeb 🩹(addon) show fallback message when dialog cannot auto-close
The dialog window does not close itself on Outlook Desktop, which
opens links in a webview that behaves like a different browser.

Calling window.close() fails because, for security reasons, JS is
prevented from closing the window. The browser considers that the JS
script is not the one that opened the dialog.

The dialog also loses its reference to the opener due to the
redirection, so there is no way to message the parent to trigger a
close.

Keeping the dialog reference on the parent side does not help either:
since the opener is lost, the parent cannot call close on the dialog.

After investigation, go with a temporary solution that shows an
explicit message hinting the user to close the dialog manually if it
does not close automatically.
2026-06-11 15:16:52 +02:00
142 changed files with 4650 additions and 5689 deletions
+10 -10
View File
@@ -46,7 +46,7 @@ jobs:
images: '${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-backend' images: '${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-backend'
- -
name: Login to DockerHub name: Login to DockerHub
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request' || startsWith(github.head_ref, 'integration/')
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_HUB_USER }} username: ${{ secrets.DOCKER_HUB_USER }}
@@ -65,7 +65,7 @@ jobs:
target: backend-production target: backend-production
platforms: ${{ env.BUILD_PLATFORMS }} platforms: ${{ env.BUILD_PLATFORMS }}
build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000 build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' || startsWith(github.head_ref, 'integration/') }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
@@ -92,7 +92,7 @@ jobs:
images: '${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-frontend' images: '${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-frontend'
- -
name: Login to DockerHub name: Login to DockerHub
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request' || startsWith(github.head_ref, 'integration/')
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_HUB_USER }} username: ${{ secrets.DOCKER_HUB_USER }}
@@ -112,7 +112,7 @@ jobs:
target: frontend-production target: frontend-production
platforms: ${{ env.BUILD_PLATFORMS }} platforms: ${{ env.BUILD_PLATFORMS }}
build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000 build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' || startsWith(github.head_ref, 'integration/') }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
@@ -139,7 +139,7 @@ jobs:
images: '${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-frontend-dinum' images: '${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-frontend-dinum'
- -
name: Login to DockerHub name: Login to DockerHub
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request' || startsWith(github.head_ref, 'integration/')
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_HUB_USER }} username: ${{ secrets.DOCKER_HUB_USER }}
@@ -159,7 +159,7 @@ jobs:
target: frontend-production target: frontend-production
platforms: ${{ env.BUILD_PLATFORMS }} platforms: ${{ env.BUILD_PLATFORMS }}
build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000 build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' || startsWith(github.head_ref, 'integration/') }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
@@ -186,7 +186,7 @@ jobs:
images: '${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-summary' images: '${{ env.DOCKER_CONTAINER_REGISTRY_NAMESPACE }}/meet-summary'
- -
name: Login to DockerHub name: Login to DockerHub
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request' || startsWith(github.head_ref, 'integration/')
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_HUB_USER }} username: ${{ secrets.DOCKER_HUB_USER }}
@@ -208,7 +208,7 @@ jobs:
target: production target: production
platforms: ${{ env.BUILD_PLATFORMS }} platforms: ${{ env.BUILD_PLATFORMS }}
build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000 build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' || startsWith(github.head_ref, 'integration/') }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
@@ -235,7 +235,7 @@ jobs:
images: lasuite/meet-agents images: lasuite/meet-agents
- -
name: Login to DockerHub name: Login to DockerHub
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request' || startsWith(github.head_ref, 'integration/')
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_HUB_USER }} username: ${{ secrets.DOCKER_HUB_USER }}
@@ -257,7 +257,7 @@ jobs:
target: production target: production
platforms: ${{ env.BUILD_PLATFORMS }} platforms: ${{ env.BUILD_PLATFORMS }}
build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000 build-args: DOCKER_USER=${{ env.DOCKER_USER }}:-1000
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' || startsWith(github.head_ref, 'integration/') }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
+71 -1
View File
@@ -8,6 +8,76 @@ and this project adheres to
## [Unreleased] ## [Unreleased]
### Changed
- ⬆️(agents) upgrade to python 3.14 slim
- ⬆️(dependencies) update python dependencies
### Fixed
- 🚀(front) fix frontend build failure
- 🐛(makefile) fix args in make test
- 🩹(backend) fix case-insensitive email deduplication in merge command
- 🐛(summary) support media files with bad streams #1478
## [1.22.0] - 2026-07-03
### Added
- ✨(frontend) cap and paginate tiles in picture-in-picture #1383
- 📝(docs) document rebranding the favicon via a volume mount #1443
- ✨(backend) add command to clean pending and deleted files
- 🧱(helm) run clean files command as cronjob
- ✨(backend) add fallback to save recordings without S3/MinIO webhooks
- 🩹(frontend) enable screen share button in PiP #1458
- 🐛(backend) support unencoded S3 notification object keys #1455
### Changed
- ✨(summary) generalized stt api call #1420
- ♻️(env) refactor env variables handling
- 🚸(frontend) use "Advanced" instead of "Premium" in the sidepanel
- ♿️(frontend) make fullscreen share warning keyboard accessible #1459
- ⬆️(summary) update docker alpine to 3.24 & ffmpeg to 8.1.2 #1471
### Fixed
- 🛂(backend) reject user access tokens on the API
- 🩹(helm) fix Helm ingress rendering when passing multiple hosts
## [1.21.0] - 2026-06-15
### Added
- ✨(frontend) allow disabling silent login via a URL parameter
- ✨(frontend) allow hiding the login button via a URL parameter
- ✨(summary) add optional satisfaction survey footer
### Changed
- ✨(frontend) enhance noise reduction with BBBA audio processing pipeline
- 🚸(frontend) mute join notification sound in larger rooms
- 🚸(frontend) mute participants by default when joining a large meeting
### Fixed
- 🐛(frontend) fix metadata agent collector enabled check
### Fixed
- ♿️(frontend) improve accessibilty of the Effects panel #1401
## [1.20.0] - 2026-06-12
### Changed
- ♻️(addon) improve Outlook add-on: i18n support, feedback link, smarter link
- ⬆️(frontend) upgrade react-i18next from 15.1.1 to 17.0.8
### Fixed
- 🐛(frontend) fix noise reduction left-channel-only audio
## [1.19.0] - 2026-06-04 ## [1.19.0] - 2026-06-04
### Added ### Added
@@ -25,7 +95,7 @@ and this project adheres to
- 🔇(summary) make ffmpeg quiet #1404 - 🔇(summary) make ffmpeg quiet #1404
- 🔒️(backend) prevent accessing files if they are not ready #1395 - 🔒️(backend) prevent accessing files if they are not ready #1395
- ⬆️(backend) upgrade idna to >=3.15 to address CVE-2026-45409 - # ⬆️(backend) upgrade idna to >=3.15 to address CVE-2026-45409
## [1.18.0] - 2026-06-03 ## [1.18.0] - 2026-06-03
+18 -13
View File
@@ -75,7 +75,8 @@ create-env-files: \
env.d/development/kc_postgresql \ env.d/development/kc_postgresql \
env.d/development/summary \ env.d/development/summary \
env.d/development/kube-secret \ env.d/development/kube-secret \
env.d/development/multi_user_transcriber env.d/development/multi_user_transcriber \
env.d/development/metadata_collector
.PHONY: create-env-files .PHONY: create-env-files
bootstrap: ## Prepare Docker images for the project bootstrap: ## Prepare Docker images for the project
@@ -210,24 +211,25 @@ lint-pylint: ## lint back-end python sources with pylint only on changed files f
@$(COMPOSE_RUN_APP) pylint meet demo core @$(COMPOSE_RUN_APP) pylint meet demo core
.PHONY: lint-pylint .PHONY: lint-pylint
test: ## run project tests test: ## run project tests; pass extra pytest args via ARGS, e.g. `make test ARGS="-vv"`
@$(MAKE) test-back-parallel @args="$(ARGS) $(filter-out $@,$(MAKECMDGOALS))" && \
@$(MAKE) test-summary $(MAKE) test-back-parallel ARGS="$${args}" && \
$(MAKE) test-summary ARGS="$${args}"
.PHONY: test .PHONY: test
test-back: ## run back-end tests test-back: ## run back-end tests (pass extra pytest args via ARGS)
@args="$(filter-out $@,$(MAKECMDGOALS))" && \ @args="$(ARGS) $(filter-out $@,$(MAKECMDGOALS))" && \
bin/pytest $${args:-${1}} bin/pytest $${args}
.PHONY: test-back .PHONY: test-back
test-back-parallel: ## run all back-end tests in parallel test-back-parallel: ## run all back-end tests in parallel (pass extra pytest args via ARGS)
@args="$(filter-out $@,$(MAKECMDGOALS))" && \ @args="$(ARGS) $(filter-out $@,$(MAKECMDGOALS))" && \
bin/pytest -n auto $${args:-${1}} bin/pytest -n auto $${args}
.PHONY: test-back-parallel .PHONY: test-back-parallel
test-summary: ## run summary tests test-summary: ## run summary tests (pass extra pytest args via ARGS)
@args="$(filter-out $@,$(MAKECMDGOALS))" && \ @args="$(ARGS) $(filter-out $@,$(MAKECMDGOALS))" && \
bin/pytest-summary $${args:-${1}} bin/pytest-summary $${args}
.PHONY: test-summary .PHONY: test-summary
makemigrations: ## run django makemigrations for the Meet project. makemigrations: ## run django makemigrations for the Meet project.
@@ -292,6 +294,9 @@ env.d/development/kube-secret:
env.d/development/multi_user_transcriber: env.d/development/multi_user_transcriber:
cp -n env.d/development/multi_user_transcriber.dist env.d/development/multi_user_transcriber cp -n env.d/development/multi_user_transcriber.dist env.d/development/multi_user_transcriber
env.d/development/metadata_collector:
cp -n env.d/development/metadata_collector.dist env.d/development/metadata_collector
# -- Internationalization # -- Internationalization
env.d/development/crowdin: env.d/development/crowdin:
+55 -9
View File
@@ -13,6 +13,9 @@
<a href="https://github.com/suitenumerique/meet/blob/main/LICENSE"> <a href="https://github.com/suitenumerique/meet/blob/main/LICENSE">
<img alt="GitHub closed issues" src="https://img.shields.io/github/license/suitenumerique/meet"/> <img alt="GitHub closed issues" src="https://img.shields.io/github/license/suitenumerique/meet"/>
</a> </a>
<a href="https://digitalpublicgoods.net/r/la-suite-meet-simple-video-conferencing">
<img src="https://img.shields.io/badge/Verified-DPG-3333AB?logo=data:image/svg%2bxml;base64,PHN2ZyB3aWR0aD0iMzEiIGhlaWdodD0iMzMiIHZpZXdCb3g9IjAgMCAzMSAzMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE0LjIwMDggMjEuMzY3OEwxMC4xNzM2IDE4LjAxMjRMMTEuNTIxOSAxNi40MDAzTDEzLjk5MjggMTguNDU5TDE5LjYyNjkgMTIuMjExMUwyMS4xOTA5IDEzLjYxNkwxNC4yMDA4IDIxLjM2NzhaTTI0LjYyNDEgOS4zNTEyN0wyNC44MDcxIDMuMDcyOTdMMTguODgxIDUuMTg2NjJMMTUuMzMxNCAtMi4zMzA4MmUtMDVMMTEuNzgyMSA1LjE4NjYyTDUuODU2MDEgMy4wNzI5N0w2LjAzOTA2IDkuMzUxMjdMMCAxMS4xMTc3TDMuODQ1MjEgMTYuMDg5NUwwIDIxLjA2MTJMNi4wMzkwNiAyMi44Mjc3TDUuODU2MDEgMjkuMTA2TDExLjc4MjEgMjYuOTkyM0wxNS4zMzE0IDMyLjE3OUwxOC44ODEgMjYuOTkyM0wyNC44MDcxIDI5LjEwNkwyNC42MjQxIDIyLjgyNzdMMzAuNjYzMSAyMS4wNjEyTDI2LjgxNzYgMTYuMDg5NUwzMC42NjMxIDExLjExNzdMMjQuNjI0MSA5LjM1MTI3WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==" alt="DPG Badge"/>
</a>
</p> </p>
<p align="center"> <p align="center">
@@ -28,6 +31,14 @@
## La Suite Meet: Simple Video Conferencing ## La Suite Meet: Simple Video Conferencing
Powered by [LiveKit](https://livekit.io/), La Suite Meet offers Zoom-level performance with high-quality video and audio. No installation required—simply join calls directly from your browser. Check out LiveKit's impressive optimizations in their [blog post](https://blog.livekit.io/livekit-one-dot-zero/). Powered by [LiveKit](https://livekit.io/), La Suite Meet offers Zoom-level performance with high-quality video and audio. No installation required—simply join calls directly from your browser. Check out LiveKit's impressive optimizations in their [blog post](https://blog.livekit.io/livekit-one-dot-zero/).
> [!TIP]
> New here? Start by introducing yourself in our Matrix channel:
> **https://matrix.to/#/#meet-official:matrix.org**
>
> Were happy to discuss ideas, answer questions, and help to deploy LaSuite Meet.
### Features ### Features
- Optimized for stability in large meetings (+100 p.) - Optimized for stability in large meetings (+100 p.)
- Support for multiple screen sharing streams - Support for multiple screen sharing streams
@@ -52,7 +63,7 @@ Were continuously adding new features to enhance your experience, with the la
### 🚀 Major roll out to all French public servants ### 🚀 Major roll out to all French public servants
On the 25th of January 2026, David Amiel, Frances Minister for Civil Service and State Reform, announced the full deployment of Visio—the French governments dedicated Meet platform—to all public servants. ([Source in French](https://www.latribune.fr/article/la-tribune-dimanche/politique/73157688099661/david-amiel-ministre-delegue-de-la-fonction-publique-nous-allons-sortir-de-la-dependance-aux-outils-americains)) On the 29th of January 2026, Prime Minister Sébastien Lecornu, announced the full deployment of Visio—the French governments dedicated Meet platform—to all public servants. ([Source in English](https://www.nytimes.com/2026/01/29/world/europe/france-zoom-alternative-visio.html))
## Table of Contents ## Table of Contents
@@ -85,21 +96,56 @@ We use Kubernetes for our [production instance](https://visio.numerique.gouv.fr/
We hope to see many more, here is an incomplete list of public La Suite Meet instances. Feel free to make a PR to add ones that are not listed below🙏 We hope to see many more, here is an incomplete list of public La Suite Meet instances. Feel free to make a PR to add ones that are not listed below🙏
| Url | Org | Access | | Url | Org | Access |
|---------------------------------------------------------------| --- | ------- | |---------------------------------------------------------------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| [visio.numerique.gouv.fr](https://visio.numerique.gouv.fr/) | DINUM | French public agents working for the central administration and the extended public sphere. ProConnect is required to login in or sign up| | [visio.numerique.gouv.fr](https://visio.numerique.gouv.fr/) | DINUM | French public agents working for the central administration and the extended public sphere. ProConnect is required to login in or sign up |
| [visio.suite.anct.gouv.fr](https://visio.suite.anct.gouv.fr/) | ANCT | French public agents working for the territorial administration and the extended public sphere. ProConnect is required to login in or sign up| | [visio.suite.anct.gouv.fr](https://visio.suite.anct.gouv.fr/) | ANCT | French public agents working for the territorial administration and the extended public sphere. ProConnect is required to login in or sign up |
| [visio.lasuite.coop](https://visio.lasuite.coop/) | lasuite.coop | Free and open demo to all. Content and accounts are reset after one month | | [visio.lasuite.coop](https://visio.lasuite.coop/) | lasuite.coop | Free and open demo to all. Content and accounts are reset after one month |
| [mosacloud.cloud](https://mosa.cloud/) | mosa.cloud | Demo instance of mosa.cloud, a dutch company providing services around La Suite apps. | | [mosacloud.cloud](https://mosa.cloud/) | mosa.cloud | Demo instance of mosa.cloud, a dutch company providing services around La Suite apps. |
| [Clever Cloud](https://www.clever.cloud/product/visio/) | clever cloud | Openvisio is a sovereign video conferencing solution based on LaSuite Meet offered by [Clever Cloud](https://www.clever.cloud/). |
| [Email.eu](https://email.eu/) | Email.eu | Sovereign business workspace. |
## Contributing # Contributing
We <3 contributions of any kind, big and small: We <3 contributions of all kinds **big or small** and were genuinely glad youre here. 🌱
- Vote on features or get early access to beta functionality in our [roadmap](https://github.com/orgs/suitenumerique/projects/11/views/4) ### Start by saying hi
- Open a PR (see our instructions on [developing La Suite Meet locally](https://github.com/suitenumerique/meet/blob/main/docs/developping_locally.md))
- Submit a [feature request](https://github.com/suitenumerique/meet/issues/new?assignees=&labels=enhancement&template=Feature_request.md) or [bug report](https://github.com/suitenumerique/meet/issues/new?assignees=&labels=bug&template=Bug_report.md)
**The best first contribution is simply to come say hi.**
Before opening a PR, especially a larger one, or one written with the help of AI, we encourage you to reach out to a maintainer on our [Matrix channel](https://matrix.to/#/#meet-official:matrix.org) (@antoine.lebaud:matrix.org).
Getting in touch early helps us align on goals, avoid duplicated or wasted effort, and build a community that stays active, welcoming, and fun to be part of. There are no silly questions here: whether youve shipped hundreds of PRs or youre just getting started, youre welcome.
### AI contributions
AI-assisted contributions are welcome. But code is never the end goal. What matters most is building relationships, sharing knowledge, and growing a sustainable community over time.
If your contribution has been heavily generated with AI, please be transparent about it. This helps maintainers review it with the right context and respects the time they invest in the project.
Using AI does not transfer ownership of the contribution: you should still fully understand the code, the problem it solves, and the reasoning behind the approach you propose. In short, even if AI helped write it, the why should still be yours.
### Contributions beyond code
**Not technical? We need you too.**
Open source is much more than code. Writing documentation, improving onboarding, translating content, answering questions, reporting bugs, or simply helping others feel welcome all make a huge difference.
### Ways to contribute
When youre ready, here are a few ways to get involved:
* 👋 **Say hello** and share your ideas with the community and maintainers on our [Matrix channel](https://matrix.to/#/#meet-official:matrix.org)
* 🛠️ **Open a PR** by following our guide to [develop La Suite Meet locally](https://github.com/suitenumerique/meet/blob/main/docs/developping_locally.md)
* 💡 **Suggest an idea** by opening a [feature request](https://github.com/suitenumerique/meet/issues/new?assignees=&labels=enhancement&template=Feature_request.md)
* 🐛 **Report a bug** by opening a [bug report](https://github.com/suitenumerique/meet/issues/new?assignees=&labels=bug&template=Bug_report.md)
Thank you for helping build something open, useful, and human. 💙
### Community call
We host a community call on the first Friday of every month to share updates, discuss ideas, and connect with contributors.
Whether youre actively contributing or just curious about the project, youre welcome to join. More details are shared on the [Matrix channel](https://matrix.to/#/#meet-official:matrix.org).
## Philosophy ## Philosophy
+2 -9
View File
@@ -251,15 +251,8 @@ services:
context: ./src/agents context: ./src/agents
target: development target: development
command: ["python", "metadata_collector.py", "dev"] command: ["python", "metadata_collector.py", "dev"]
environment: env_file:
- LIVEKIT_URL=ws://livekit:7880 - env.d/development/metadata_collector
- LIVEKIT_API_KEY=devkey
- LIVEKIT_API_SECRET=secret
- AWS_S3_ENDPOINT_URL=minio:9000
- AWS_S3_ACCESS_KEY_ID=meet
- AWS_S3_SECRET_ACCESS_KEY=password
- AWS_STORAGE_BUCKET_NAME=meet-media-storage
- AWS_S3_SECURE_ACCESS=False
volumes: volumes:
- ./src/agents:/app - ./src/agents:/app
- /app/.venv - /app/.venv
+2
View File
@@ -60,6 +60,8 @@ USER root
# Security patches for known CVEs # Security patches for known CVEs
RUN apk update && apk upgrade \ RUN apk update && apk upgrade \
libcrypto3>=3.5.7-r0 \
libssl3>=3.5.7-r0 \
musl \ musl \
musl-utils \ musl-utils \
zlib>=1.3.2-r0 \ zlib>=1.3.2-r0 \
+4 -1
View File
@@ -48,9 +48,12 @@ server {
set $nonce $request_id; set $nonce $request_id;
set $csp "upgrade-insecure-requests; "; set $csp "default-src 'self'; upgrade-insecure-requests; ";
set $csp "${csp}frame-ancestors ${ms_domains}; "; set $csp "${csp}frame-ancestors ${ms_domains}; ";
set $csp "${csp}script-src 'nonce-${nonce}' 'strict-dynamic'; "; set $csp "${csp}script-src 'nonce-${nonce}' 'strict-dynamic'; ";
set $csp "${csp}style-src 'self' 'unsafe-inline'; ";
set $csp "${csp}img-src 'self' data:; ";
set $csp "${csp}font-src 'self' data:; ";
set $csp "${csp}connect-src 'self' ${ms_domains}; "; set $csp "${csp}connect-src 'self' ${ms_domains}; ";
set $csp "${csp}frame-src 'none'; "; set $csp "${csp}frame-src 'none'; ";
set $csp "${csp}object-src 'none'; "; set $csp "${csp}object-src 'none'; ";
+1 -1
View File
@@ -96,7 +96,7 @@ sequenceDiagram
| **RECORDING_WORKER_CLASSES** | Dict | `{ "screen_recording": "core.recording.worker.services.VideoCompositeEgressService", "transcript": "core.recording.worker.services.AudioCompositeEgressService" }` | Maps recording types to their worker service classes. | | **RECORDING_WORKER_CLASSES** | Dict | `{ "screen_recording": "core.recording.worker.services.VideoCompositeEgressService", "transcript": "core.recording.worker.services.AudioCompositeEgressService" }` | Maps recording types to their worker service classes. |
| **RECORDING_EVENT_PARSER_CLASS** | String | `"core.recording.event.parsers.MinioParser"` | Class responsible for parsing storage events and updating the backend. | | **RECORDING_EVENT_PARSER_CLASS** | String | `"core.recording.event.parsers.MinioParser"` | Class responsible for parsing storage events and updating the backend. |
| **RECORDING_ENABLE_STORAGE_EVENT_AUTH** | Boolean | `True` | Enable authentication for storage event webhook requests. | | **RECORDING_ENABLE_STORAGE_EVENT_AUTH** | Boolean | `True` | Enable authentication for storage event webhook requests. |
| **RECORDING_STORAGE_EVENT_ENABLE** | Boolean | `False` | Enable handling of storage events (must configure webhook in storage). | | **RECORDING_STORAGE_EVENT_ENABLE** | Boolean | `False` | Enable handling of storage events (must configure webhook in storage). If `False`, fallback to LiveKit egress complete webhook. |
| **RECORDING_STORAGE_EVENT_TOKEN** | Secret/File | `None` | Token used to authenticate storage webhook requests, if `RECORDING_ENABLE_STORAGE_EVENT_AUTH` is enabled. | | **RECORDING_STORAGE_EVENT_TOKEN** | Secret/File | `None` | Token used to authenticate storage webhook requests, if `RECORDING_ENABLE_STORAGE_EVENT_AUTH` is enabled. |
| **RECORDING_EXPIRATION_DAYS** | Integer | `None` | Number of days before recordings expire. Should match bucket lifecycle policy. Set to `None` for no expiration. | | **RECORDING_EXPIRATION_DAYS** | Integer | `None` | Number of days before recordings expire. Should match bucket lifecycle policy. Set to `None` for no expiration. |
| **RECORDING_MAX_DURATION** | Integer | `None` | Maximum duration of a recording in milliseconds. Must be synced with the LiveKit Egress configuration. Set to None for unlimited duration. When the maximum duration is reached, the recording is automatically stopped and saved, and the user is prompted in the frontend with an alert message. | | **RECORDING_MAX_DURATION** | Integer | `None` | Maximum duration of a recording in milliseconds. Must be synced with the LiveKit Egress configuration. Set to None for unlimited duration. When the maximum duration is reached, the recording is automatically stopped and saved, and the user is prompted in the frontend with an alert message. |
-1
View File
@@ -80,7 +80,6 @@ sequenceDiagram
| whisperx_api_key | Secret | — | API key for accessing WhisperX. | | whisperx_api_key | Secret | — | API key for accessing WhisperX. |
| whisperx_base_url | String | `"https://api.whisperx.com/v1"` | Base URL for the WhisperX API. | | whisperx_base_url | String | `"https://api.whisperx.com/v1"` | Base URL for the WhisperX API. |
| whisperx_asr_model | String | `"whisper-1"` | ASR model used for transcription. | | whisperx_asr_model | String | `"whisper-1"` | ASR model used for transcription. |
| whisperx_max_retries | Integer | `0` | Maximum number of retries for WhisperX API requests. |
| webhook_max_retries | Integer | `2` | Maximum retries for webhook requests. | | webhook_max_retries | Integer | `2` | Maximum retries for webhook requests. |
| webhook_status_forcelist | List[Int] | `[502, 503, 504]` | HTTP status codes triggering webhook retry. | | webhook_status_forcelist | List[Int] | `[502, 503, 504]` | HTTP status codes triggering webhook retry. |
| webhook_backoff_factor | Float | `0.1` | Exponential backoff factor for webhook retries. | | webhook_backoff_factor | Float | `0.1` | Exponential backoff factor for webhook retries. |
+64 -1
View File
@@ -244,6 +244,69 @@ meet-admin <none> meet.127.0.0.1.nip.io localhost 80, 44
You can use LaSuite Meet on https://meet.127.0.0.1.nip.io from the local device. The provisioning user in keycloak is meet/meet. You can use LaSuite Meet on https://meet.127.0.0.1.nip.io from the local device. The provisioning user in keycloak is meet/meet.
## Rebranding the favicon
The favicon is bundled into the frontend image and served as a set of static
files from `/usr/share/nginx/html` (`favicon.ico`, `favicon-16x16.png`,
`favicon-32x32.png`, `apple-touch-icon.png`, `android-chrome-192x192.png`,
`android-chrome-512x512.png`, `icon.png`). To rebrand without forking and
rebuilding the image, overlay your own icons onto those paths with a volume —
this serves the right icon from the first byte (no rebuild, no flash) and
covers every variant, including the iOS home-screen and Android/PWA icons.
Put your icons in a `ConfigMap` (`binaryData` keeps the PNGs intact)…
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: meet-favicon
binaryData:
# base64 of each replacement icon
favicon.ico: <base64…>
favicon-16x16.png: <base64…>
favicon-32x32.png: <base64…>
apple-touch-icon.png: <base64…>
android-chrome-192x192.png: <base64…>
android-chrome-512x512.png: <base64…>
```
```bash
# e.g. build the ConfigMap straight from a directory of icons
$ kubectl create configmap meet-favicon --from-file=./my-icons/
```
…then mount each file over the bundled one via the chart's
`frontend.extraVolumes` / `frontend.extraVolumeMounts` (the `subPath` mounts
the single file without hiding the rest of `html/`):
```yaml
frontend:
extraVolumes:
- name: favicon
configMap:
name: meet-favicon
extraVolumeMounts:
- name: favicon
mountPath: /usr/share/nginx/html/favicon.ico
subPath: favicon.ico
- name: favicon
mountPath: /usr/share/nginx/html/favicon-16x16.png
subPath: favicon-16x16.png
- name: favicon
mountPath: /usr/share/nginx/html/favicon-32x32.png
subPath: favicon-32x32.png
- name: favicon
mountPath: /usr/share/nginx/html/apple-touch-icon.png
subPath: apple-touch-icon.png
- name: favicon
mountPath: /usr/share/nginx/html/android-chrome-192x192.png
subPath: android-chrome-192x192.png
- name: favicon
mountPath: /usr/share/nginx/html/android-chrome-512x512.png
subPath: android-chrome-512x512.png
```
## All options ## All options
These are the environmental options available on meet backend. These are the environmental options available on meet backend.
@@ -344,7 +407,7 @@ These are the environmental options available on meet backend.
| RECORDING_WORKER_CLASSES | Worker classes for recording | {"screen_recording": "core.recording.worker.services.VideoCompositeEgressService","transcript": "core.recording.worker.services.AudioCompositeEgressService"} | | RECORDING_WORKER_CLASSES | Worker classes for recording | {"screen_recording": "core.recording.worker.services.VideoCompositeEgressService","transcript": "core.recording.worker.services.AudioCompositeEgressService"} |
| RECORDING_EVENT_PARSER_CLASS | Storage event engine for recording | core.recording.event.parsers.MinioParser | | RECORDING_EVENT_PARSER_CLASS | Storage event engine for recording | core.recording.event.parsers.MinioParser |
| RECORDING_ENABLE_STORAGE_EVENT_AUTH | Enable storage event authorization | true | | RECORDING_ENABLE_STORAGE_EVENT_AUTH | Enable storage event authorization | true |
| RECORDING_STORAGE_EVENT_ENABLE | Enable recording storage events | false | | RECORDING_STORAGE_EVENT_ENABLE | Enable recording storage events. If false, fallback to egress webhook. | false |
| RECORDING_STORAGE_EVENT_TOKEN | Recording storage event token | | | RECORDING_STORAGE_EVENT_TOKEN | Recording storage event token | |
| RECORDING_EXPIRATION_DAYS | Recording expiration in days | | | RECORDING_EXPIRATION_DAYS | Recording expiration in days | |
| RECORDING_MAX_DURATION | Maximum recording duration in milliseconds. Must match LiveKit Egress configuration exactly. | | | RECORDING_MAX_DURATION | Maximum recording duration in milliseconds. Must match LiveKit Egress configuration exactly. | |
+5
View File
@@ -57,6 +57,7 @@ OIDC_RS_CLIENT_SECRET=ThisIsAnExampleKeyForDevPurposeOnly
LIVEKIT_API_SECRET=secret LIVEKIT_API_SECRET=secret
LIVEKIT_API_KEY=devkey LIVEKIT_API_KEY=devkey
LIVEKIT_API_URL=http://127.0.0.1.nip.io:7880 LIVEKIT_API_URL=http://127.0.0.1.nip.io:7880
LIVEKIT_INTERNAL_URL=http://livekit:7880
LIVEKIT_VERIFY_SSL=False LIVEKIT_VERIFY_SSL=False
ALLOW_UNREGISTERED_ROOMS=False ALLOW_UNREGISTERED_ROOMS=False
@@ -86,6 +87,9 @@ ROOM_TELEPHONY_ENABLED=True
# Metadata # Metadata
METADATA_COLLECTOR_ENABLED=True METADATA_COLLECTOR_ENABLED=True
# Subtitle
ROOM_SUBTITLE_ENABLED=False
FRONTEND_USE_FRENCH_GOV_FOOTER=False FRONTEND_USE_FRENCH_GOV_FOOTER=False
FRONTEND_USE_PROCONNECT_BUTTON=False FRONTEND_USE_PROCONNECT_BUTTON=False
@@ -94,3 +98,4 @@ EXTERNAL_API_ENABLED=True
APPLICATION_JWT_AUDIENCE=http://localhost:8071/external-api/v1.0/ APPLICATION_JWT_AUDIENCE=http://localhost:8071/external-api/v1.0/
APPLICATION_JWT_SECRET_KEY=devKey APPLICATION_JWT_SECRET_KEY=devKey
APPLICATION_BASE_URL=http://localhost:3000 APPLICATION_BASE_URL=http://localhost:3000
@@ -0,0 +1,9 @@
LIVEKIT_URL=ws://livekit:7880
LIVEKIT_API_KEY=devkey
LIVEKIT_API_SECRET=secret
AWS_S3_ENDPOINT_URL=minio:9000
AWS_S3_ACCESS_KEY_ID=meet
AWS_S3_SECRET_ACCESS_KEY=password
AWS_STORAGE_BUCKET_NAME=meet-media-storage
AWS_S3_SECURE_ACCESS=False
@@ -2,8 +2,10 @@ LIVEKIT_URL=ws://livekit:7880
LIVEKIT_API_KEY=devkey LIVEKIT_API_KEY=devkey
LIVEKIT_API_SECRET=secret LIVEKIT_API_SECRET=secret
STT_PROVIDER=kyutai STT_PROVIDER=kyutai # kyutai, deepgram
ENABLE_SILERO_VAD=False ENABLE_SILERO_VAD=False
DEEPGRAM_API_KEY=
KYUTAI_STT_BASE_URL= KYUTAI_STT_BASE_URL=
KYUTAI_API_KEY= KYUTAI_API_KEY=
+9 -1
View File
@@ -1,7 +1,7 @@
APP_NAME="meet-app-summary-dev" APP_NAME="meet-app-summary-dev"
APP_API_TOKEN="password" APP_API_TOKEN="password"
AWS_STORAGE_BUCKET_NAME="http://meet-media-storage" AWS_STORAGE_BUCKET_NAME="meet-media-storage"
AWS_S3_ENDPOINT_URL="minio:9000" AWS_S3_ENDPOINT_URL="minio:9000"
AWS_S3_SECURE_ACCESS=false AWS_S3_SECURE_ACCESS=false
@@ -20,5 +20,13 @@ LLM_MODEL="albert-large"
WEBHOOK_API_TOKEN="secret" WEBHOOK_API_TOKEN="secret"
WEBHOOK_URL="https://configure-your-url.com" WEBHOOK_URL="https://configure-your-url.com"
IS_RESOLVE_SPEAKER_IDENTITIES_ENABLED=true
RESOLVE_SPEAKER_IDENTITIES_DEFAULT_OVERLAP=0.5
RESOLVE_SPEAKER_ENABLE_SPLIT_ON_WORDS=true
RESOLVE_SPEAKER_MAX_WORD_DURATION=1
POSTHOG_API_KEY="your-posthog-key" POSTHOG_API_KEY="your-posthog-key"
POSTHOG_ENABLED="False" POSTHOG_ENABLED="False"
# Transcription
TRANSCRIPTION_SATISFACTION_FORM_BASE_URL=
+32 -13
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp"> <OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
<Id>a025f0f6-757a-4790-97f3-99c66c4a5795</Id> <Id>a025f0f6-757a-4790-97f3-99c66c4a5795</Id>
<Version>0.0.1.0</Version> <Version>0.0.2.0</Version>
<ProviderName>__APP_NAME__</ProviderName> <ProviderName>__APP_NAME__</ProviderName>
<DefaultLocale>fr-FR</DefaultLocale> <DefaultLocale>fr-FR</DefaultLocale>
<DisplayName DefaultValue="__APP_NAME__"/> <DisplayName DefaultValue="__APP_NAME__"/>
@@ -87,9 +87,9 @@
<Description resid="GenerateLink.Tooltip"/> <Description resid="GenerateLink.Tooltip"/>
</Supertip> </Supertip>
<Icon> <Icon>
<bt:Image size="16" resid="Add.16x16"/> <bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Add.32x32"/> <bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Add.80x80"/> <bt:Image size="80" resid="Icon.80x80"/>
</Icon> </Icon>
<Action xsi:type="ExecuteFunction"> <Action xsi:type="ExecuteFunction">
<FunctionName>generateMeetingLinkFromMail</FunctionName> <FunctionName>generateMeetingLinkFromMail</FunctionName>
@@ -126,9 +126,9 @@
<Description resid="GenerateLink.Tooltip"/> <Description resid="GenerateLink.Tooltip"/>
</Supertip> </Supertip>
<Icon> <Icon>
<bt:Image size="16" resid="Add.16x16"/> <bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Add.32x32"/> <bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Add.80x80"/> <bt:Image size="80" resid="Icon.80x80"/>
</Icon> </Icon>
<Action xsi:type="ExecuteFunction"> <Action xsi:type="ExecuteFunction">
<FunctionName>generateMeetingLinkFromCalendar</FunctionName> <FunctionName>generateMeetingLinkFromCalendar</FunctionName>
@@ -175,15 +175,34 @@
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/> <bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
</bt:Urls> </bt:Urls>
<bt:ShortStrings> <bt:ShortStrings>
<!-- Default (French) -->
<bt:String id="GroupLabel" DefaultValue="__APP_NAME__"/> <bt:String id="GroupLabel" DefaultValue="__APP_NAME__"/>
<bt:String id="TaskpaneButton.Label" DefaultValue="Ouvrir les paramètres"/> <bt:String id="GenerateLink.Label" DefaultValue="Ajouter un lien __APP_NAME__">
<bt:String id="GenerateLink.Label" DefaultValue="Ajouter un lien __APP_NAME__"/> <bt:Override Locale="en-US" Value="Add a __APP_NAME__ link"/>
<bt:String id="OpenSettings.Label" DefaultValue="Paramètres"/> <bt:Override Locale="de-DE" Value="__APP_NAME__-Link hinzufügen"/>
</bt:String>
<bt:String id="TaskpaneButton.Label" DefaultValue="Ouvrir les paramètres">
<bt:Override Locale="en-US" Value="Open settings"/>
<bt:Override Locale="de-DE" Value="Einstellungen öffnen"/>
</bt:String>
<bt:String id="OpenSettings.Label" DefaultValue="Paramètres">
<bt:Override Locale="en-US" Value="Settings"/>
<bt:Override Locale="de-DE" Value="Einstellungen"/>
</bt:String>
</bt:ShortStrings> </bt:ShortStrings>
<bt:LongStrings> <bt:LongStrings>
<bt:String id="TaskpaneButton.Tooltip" DefaultValue="Ouvre les paramètres de connexion __APP_NAME__."/> <bt:String id="GenerateLink.Tooltip" DefaultValue="Génère un lien de réunion __APP_NAME__ et l'insère dans l'événement.">
<bt:String id="GenerateLink.Tooltip" DefaultValue="Génère un lien de réunion __APP_NAME__ et l'insère dans l'événement."/> <bt:Override Locale="de-DE" Value="Generiert einen __APP_NAME__-Besprechungslink und fügt ihn in den Termin ein."/>
<bt:String id="OpenSettings.Tooltip" DefaultValue="Ouvre les paramètres de connexion __APP_NAME__."/> <bt:Override Locale="en-US" Value="Generates a __APP_NAME__ meeting link and inserts it into the item."/>
</bt:String>
<bt:String id="TaskpaneButton.Tooltip" DefaultValue="Ouvre les paramètres de connexion __APP_NAME__.">
<bt:Override Locale="de-DE" Value="Öffnet die __APP_NAME__-Verbindungseinstellungen."/>
<bt:Override Locale="en-US" Value="Opens the __APP_NAME__ connection settings."/>
</bt:String>
<bt:String id="OpenSettings.Tooltip" DefaultValue="Ouvre les paramètres de connexion __APP_NAME__.">
<bt:Override Locale="de-DE" Value="Öffnet die __APP_NAME__-Verbindungseinstellungen."/>
<bt:Override Locale="en-US" Value="Opens the __APP_NAME__ connection settings."/>
</bt:String>
</bt:LongStrings> </bt:LongStrings>
</Resources> </Resources>
</VersionOverrides> </VersionOverrides>
+65 -28
View File
@@ -9,33 +9,35 @@
"version": "0.0.1", "version": "0.0.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"core-js": "^3.49.0", "core-js": "3.49.0",
"regenerator-runtime": "^0.14.1" "i18next": "26.3.1",
"i18next-browser-languagedetector": "8.2.1",
"regenerator-runtime": "0.14.1"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.24.0", "@babel/core": "7.29.0",
"@babel/preset-env": "^7.25.4", "@babel/preset-env": "7.29.0",
"@types/office-js": "^1.0.377", "@types/office-js": "1.0.582",
"@types/office-runtime": "^1.0.35", "@types/office-runtime": "1.0.36",
"acorn": "^8.11.3", "acorn": "8.16.0",
"babel-loader": "^9.1.3", "babel-loader": "9.2.1",
"copy-webpack-plugin": "^14.0.0", "copy-webpack-plugin": "14.0.0",
"eslint-plugin-office-addins": "^4.0.3", "eslint-plugin-office-addins": "4.0.6",
"file-loader": "^6.2.0", "file-loader": "6.2.0",
"html-loader": "^5.0.0", "html-loader": "5.1.0",
"html-webpack-inject-attributes-plugin": "^1.0.6", "html-webpack-inject-attributes-plugin": "1.0.6",
"html-webpack-plugin": "^5.6.0", "html-webpack-plugin": "5.6.6",
"office-addin-cli": "^2.0.3", "office-addin-cli": "2.0.6",
"office-addin-debugging": "^6.0.3", "office-addin-debugging": "6.0.6",
"office-addin-dev-certs": "^2.0.3", "office-addin-dev-certs": "2.0.6",
"office-addin-lint": "^3.0.3", "office-addin-lint": "3.0.6",
"office-addin-manifest": "^2.0.3", "office-addin-manifest": "2.1.2",
"office-addin-prettier-config": "^2.0.1", "office-addin-prettier-config": "2.0.1",
"os-browserify": "^0.3.0", "os-browserify": "0.3.0",
"process": "^0.11.10", "process": "0.11.10",
"source-map-loader": "^5.0.0", "source-map-loader": "5.0.0",
"webpack": "^5.95.0", "webpack": "5.105.4",
"webpack-cli": "^5.1.4", "webpack-cli": "5.1.4",
"webpack-dev-server": "5.2.4" "webpack-dev-server": "5.2.4"
} }
}, },
@@ -2111,9 +2113,7 @@
"version": "7.28.6", "version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz",
"integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==", "integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==",
"dev": true,
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
@@ -9363,6 +9363,43 @@
"node": ">=10.18" "node": ">=10.18"
} }
}, },
"node_modules/i18next": {
"version": "26.3.1",
"resolved": "https://registry.npmjs.org/i18next/-/i18next-26.3.1.tgz",
"integrity": "sha512-txQqd5EULsqEh9OJqRH15aCaOuy/nLJyhw5EHCSKLKJE1aBbb3Zve2+uQIxgWhPm1QqUQoWyQBm2kfmmIrzkcQ==",
"funding": [
{
"type": "individual",
"url": "https://www.locize.com/i18next"
},
{
"type": "individual",
"url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project"
},
{
"type": "individual",
"url": "https://www.locize.com"
}
],
"license": "MIT",
"peerDependencies": {
"typescript": "^5 || ^6"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
},
"node_modules/i18next-browser-languagedetector": {
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-8.2.1.tgz",
"integrity": "sha512-bZg8+4bdmaOiApD7N7BPT9W8MLZG+nPTOFlLiJiT8uzKXFjhxw4v2ierCXOwB5sFDMtuA5G4kgYZ0AznZxQ/cw==",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.23.2"
}
},
"node_modules/iconv-lite": { "node_modules/iconv-lite": {
"version": "0.6.3", "version": "0.6.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
@@ -15213,7 +15250,7 @@
"version": "5.9.3", "version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true, "devOptional": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
+27 -25
View File
@@ -26,33 +26,35 @@
"watch": "webpack --mode development --watch" "watch": "webpack --mode development --watch"
}, },
"dependencies": { "dependencies": {
"core-js": "^3.49.0", "core-js": "3.49.0",
"regenerator-runtime": "^0.14.1" "i18next": "26.3.1",
"i18next-browser-languagedetector": "8.2.1",
"regenerator-runtime": "0.14.1"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.24.0", "@babel/core": "7.29.0",
"@babel/preset-env": "^7.25.4", "@babel/preset-env": "7.29.0",
"@types/office-js": "^1.0.377", "@types/office-js": "1.0.582",
"@types/office-runtime": "^1.0.35", "@types/office-runtime": "1.0.36",
"acorn": "^8.11.3", "acorn": "8.16.0",
"babel-loader": "^9.1.3", "babel-loader": "9.2.1",
"copy-webpack-plugin": "^14.0.0", "copy-webpack-plugin": "14.0.0",
"eslint-plugin-office-addins": "^4.0.3", "eslint-plugin-office-addins": "4.0.6",
"file-loader": "^6.2.0", "file-loader": "6.2.0",
"html-loader": "^5.0.0", "html-loader": "5.1.0",
"html-webpack-inject-attributes-plugin": "^1.0.6", "html-webpack-inject-attributes-plugin": "1.0.6",
"html-webpack-plugin": "^5.6.0", "html-webpack-plugin": "5.6.6",
"office-addin-cli": "^2.0.3", "office-addin-cli": "2.0.6",
"office-addin-debugging": "^6.0.3", "office-addin-debugging": "6.0.6",
"office-addin-dev-certs": "^2.0.3", "office-addin-dev-certs": "2.0.6",
"office-addin-lint": "^3.0.3", "office-addin-lint": "3.0.6",
"office-addin-manifest": "^2.0.3", "office-addin-manifest": "2.1.2",
"office-addin-prettier-config": "^2.0.1", "office-addin-prettier-config": "2.0.1",
"os-browserify": "^0.3.0", "os-browserify": "0.3.0",
"process": "^0.11.10", "process": "0.11.10",
"source-map-loader": "^5.0.0", "source-map-loader": "5.0.0",
"webpack": "^5.95.0", "webpack": "5.105.4",
"webpack-cli": "^5.1.4", "webpack-cli": "5.1.4",
"webpack-dev-server": "5.2.4" "webpack-dev-server": "5.2.4"
}, },
"prettier": "office-addin-prettier-config", "prettier": "office-addin-prettier-config",
+36 -19
View File
@@ -1,12 +1,18 @@
/* global Office */ /* global Office */
const { APP_NAME } = require("../common/index");
const { createRoom, initSession } = require("../common/api"); const { createRoom, initSession } = require("../common/api");
const { startPolling } = require("../common/polling"); const { startPolling } = require("../common/polling");
const { saveSession, loadSession } = require("../common/session"); const { saveSession, loadSession } = require("../common/session");
const { openTransitDialog } = require("../common/transitDialog"); const { openTransitDialog } = require("../common/transitDialog");
const { buildMeetingMessage } = require("../common/messageBuilder"); const { buildMeetingMessage } = require("../common/messageBuilder");
const { applyAppName } = require("../common/helpers"); const { applyAppName } = require("../common/helpers");
const { initI18n, t } = require("../common/i18n");
const { isMeetingAlreadyAdded } = require("../common/meetingDetector");
Office.onReady(async function (info) {
await initI18n()
Office.onReady(function (info) {
if (info.host === Office.HostType.Outlook) { if (info.host === Office.HostType.Outlook) {
applyAppName(); applyAppName();
} }
@@ -22,44 +28,55 @@ function notify(message) {
} }
function insertMeetingLink(event, session) { function insertMeetingLink(event, session) {
createRoom(session)
.then((data) => {
const { url, message } = buildMeetingMessage(data);
const item = Office.context.mailbox.item; const item = Office.context.mailbox.item;
return new Promise((resolve, reject) => { isMeetingAlreadyAdded(item)
item.body.getAsync(Office.CoercionType.Html, (getResult) => { .then((alreadyAdded) => {
if (getResult.status !== Office.AsyncResultStatus.Succeeded) { if (alreadyAdded) {
notify(`Erreur de lecture : ${getResult.error.message}`); notify(t("meeting.already_added", { app_name: APP_NAME }));
resolve(); event.completed();
return; return;
} }
return _doInsertMeetingLink(event, session);
})
.catch((err) => {
notify(t("meeting.error.details", { message: err.message }));
event.completed();
});
}
const newBody = getResult.value + message; function _doInsertMeetingLink(event, session) {
item.body.setAsync(newBody, { coercionType: Office.CoercionType.Html }, (setResult) => { createRoom(session)
.then((data) => {
const isWeb = Office.context.diagnostics.platform === "OfficeOnline";
const { url, text } = buildMeetingMessage(data, isWeb);
const item = Office.context.mailbox.item;
const coercionType = isWeb ? Office.CoercionType.Html : Office.CoercionType.Text;
return new Promise((resolve, reject) => {
item.body.setSelectedDataAsync(text, { coercionType }, (setResult) => {
if (setResult.status !== Office.AsyncResultStatus.Succeeded) { if (setResult.status !== Office.AsyncResultStatus.Succeeded) {
notify(`Erreur d'insertion : ${setResult.error.message}`); notify(t("meeting.error.details", { message: setResult.error.message }));
resolve(); resolve();
return; return;
} }
if (item.itemType !== Office.MailboxEnums.ItemType.Appointment) { if (item.itemType !== Office.MailboxEnums.ItemType.Appointment) {
notify("Lien de réunion inséré !"); notify(t("meeting.link_inserted"));
resolve(); resolve();
return; return;
} }
item.location.setAsync(url, (locationResult) => { item.location.setAsync(url, (locationResult) => {
if (locationResult.status !== Office.AsyncResultStatus.Succeeded) { if (locationResult.status !== Office.AsyncResultStatus.Succeeded) {
notify(`Erreur de localisation : ${locationResult.error.message}`); notify(t("meeting.error.details", { message: locationResult.error.message }));
} else { } else {
notify("Lien de réunion inséré !"); notify(t("meeting.link_inserted"));
} }
resolve(); resolve();
}); });
}); });
}); });
});
}) })
.catch((err) => { .catch((err) => {
notify(`Erreur : ${err.message}`); notify(`Erreur : ${err.message}`);
@@ -79,11 +96,11 @@ function connect(event) {
}); });
}, },
onTimeout: () => { onTimeout: () => {
notify("Connexion expirée, veuillez réessayer."); notify(t("meeting.error.auth"));
event.completed(); event.completed();
}, },
onError: (err) => { onError: (err) => {
notify("Une erreur est survenue, veuillez ré-essayer"); notify(t("meeting.error.retry"));
event.completed(); event.completed();
}, },
}); });
@@ -99,7 +116,7 @@ function connect(event) {
}); });
}) })
.catch((err) => { .catch((err) => {
notify(`Erreur : ${err.message}`); notify(t("meeting.error.details", { message: err.message }));
event.completed(); event.completed();
}); });
} }
+48
View File
@@ -0,0 +1,48 @@
const { APP_NAME } = require("../common");
const i18nextModule = require("i18next");
const i18next = i18nextModule.default || i18nextModule;
const fr = require("../locales/fr/translation.json");
const en = require("../locales/en/translation.json");
const de = require("../locales/de/translation.json");
async function initI18n() {
const lng = typeof Office !== "undefined" ? Office.context.displayLanguage : navigator.language;
await i18next.init({
lng,
fallbackLng: "fr",
interpolation: { escapeValue: false },
resources: {
fr: { translation: fr },
en: { translation: en },
de: { translation: de },
},
});
}
function t(key, vars) {
return i18next.t(key, vars);
}
function translateUI() {
document.querySelectorAll("[data-i18n]").forEach((el) => {
const key = el.getAttribute("data-i18n");
el.textContent = t(key, { app_name: APP_NAME });
});
document.querySelectorAll("[data-i18n-attr]").forEach((el) => {
const pairs = el.getAttribute("data-i18n-attr").split(",");
pairs.forEach((pair) => {
const [attr, key] = pair.split(":");
el.setAttribute(attr, t(key, { app_name: APP_NAME }));
});
});
document.querySelectorAll("[data-i18n-aria]").forEach((el) => {
el.setAttribute("aria-label", t(el.getAttribute("data-i18n-aria")));
});
}
module.exports = { initI18n, t, translateUI };
+4
View File
@@ -1,7 +1,11 @@
const BASE_URL = window.__APP_CONFIG__?.BASE_URL || "https://meet.127.0.0.1.nip.io"; const BASE_URL = window.__APP_CONFIG__?.BASE_URL || "https://meet.127.0.0.1.nip.io";
const APP_NAME = window.__APP_CONFIG__?.APP_NAME || "LaSuite Meet"; const APP_NAME = window.__APP_CONFIG__?.APP_NAME || "LaSuite Meet";
const ENABLE_SOURCE_TRACKING = window.__APP_CONFIG__?.ENABLE_SOURCE_TRACKING === "true";
const FEEDBACK_FORM = window.__APP_CONFIG__?.FEEDBACK_FORM || null;
module.exports = { module.exports = {
BASE_URL, BASE_URL,
APP_NAME, APP_NAME,
ENABLE_SOURCE_TRACKING,
FEEDBACK_FORM
}; };
@@ -0,0 +1,107 @@
const { BASE_URL } = require("./index");
/**
* Returns a promise that resolves to true if a meeting link is already present
*/
function isMeetingAlreadyAdded(item) {
return Promise.all([_checkBody(item), _checkLocation(item)]).then(
([inBody, inLocation]) => inBody || inLocation
);
}
function _checkBody(item) {
return new Promise((resolve) => {
item.body.getAsync(Office.CoercionType.Text, (result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
resolve(false);
return;
}
resolve(_containsMeetingUrl(result.value));
});
});
}
function _checkLocation(item) {
// Location only exists on appointments
if (item.itemType !== Office.MailboxEnums.ItemType.Appointment) {
return Promise.resolve(false);
}
return new Promise((resolve) => {
item.location.getAsync((result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
resolve(false);
return;
}
resolve(_containsMeetingUrl(result.value));
});
});
}
function _containsMeetingUrl(text) {
if (!text) return false;
return text.includes(BASE_URL);
}
function removeMeetingLink(item) {
return Promise.all([_removeFromBody(item), _removeFromLocation(item)]);
}
function _removeFromBody(item) {
return new Promise((resolve) => {
item.body.getAsync(Office.CoercionType.Html, (result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
resolve();
return;
}
const cleaned = _cleanBody(result.value || "");
if (cleaned === null) {
resolve();
return;
}
item.body.setAsync(cleaned, { coercionType: Office.CoercionType.Html }, () => resolve());
});
});
}
function _removeFromLocation(item) {
if (item.itemType !== Office.MailboxEnums.ItemType.Appointment) {
return Promise.resolve();
}
return new Promise((resolve) => {
item.location.getAsync((result) => {
if (
result.status === Office.AsyncResultStatus.Succeeded &&
_containsMeetingUrl(result.value)
) {
item.location.setAsync("", () => resolve());
} else {
resolve();
}
});
});
}
const SEPARATOR = /─{10,}/;
/**
* Returns cleaned HTML, or null if no meeting block was found.
*/
function _cleanBody(html) {
const doc = new DOMParser().parseFromString(html, "text/html");
const hits = [];
const walker = doc.createTreeWalker(doc.body, NodeFilter.SHOW_TEXT);
while (walker.nextNode()) {
if (SEPARATOR.test(walker.currentNode.nodeValue)) hits.push(walker.currentNode);
}
if (hits.length < 2) return null;
const range = doc.createRange();
range.setStartBefore(hits[0]);
range.setEndAfter(hits[hits.length - 1]);
range.deleteContents();
return doc.documentElement.outerHTML;
}
module.exports = { isMeetingAlreadyAdded, removeMeetingLink };
+43 -16
View File
@@ -1,4 +1,5 @@
const { APP_NAME } = require("./index"); const { APP_NAME, ENABLE_SOURCE_TRACKING } = require("./index");
const { t } = require("./i18n");
function _formatPin(pin) { function _formatPin(pin) {
if (!pin) return ""; if (!pin) return "";
@@ -20,33 +21,59 @@ function _formatPhone(phone) {
return clean; return clean;
} }
function _appendTrackingParams(url) {
if (!ENABLE_SOURCE_TRACKING) return url;
const u = new URL(url);
u.searchParams.set("from", "outlook-addin");
return u.toString();
}
// todo - escape html / link // todo - escape html / link
function buildMeetingMessage(data) { function buildMeetingMessage(data, isWeb) {
if (!data?.url) { if (!data?.url) {
throw new Error("buildMeetingMessage: missing url in data"); throw new Error("buildMeetingMessage: missing url in data");
} }
const url = data.url; const url = _appendTrackingParams(data.url);
const phone = _formatPhone(data.telephony?.phone_number); const phone = _formatPhone(data.telephony?.phone_number);
const pin = _formatPin(data.telephony?.pin_code); const pin = _formatPin(data.telephony?.pin_code);
const telephonyBlock = let textLines = "";
phone && pin let phoneLines = [];
? `
Ou appelez (audio uniquement) const join = t("meeting_message.join", { app_name: APP_NAME });
(FR) ${phone} const phoneOnly = t("meeting_message.phone_only");
Code : ${pin}` const phoneFr = t("meeting_message.phone_fr", { phone });
: ""; const pinCode = t("meeting_message.pin_code", { pin });
const message = `<pre style="font-family:inherit; font-size:inherit; border:none; background:none; margin:16px 0;"> if (isWeb) {
──────────────────────────────────────── phoneLines = phone && pin ? [`<br><br>${phoneOnly}`, `<br>${phoneFr}`, `<br>${pinCode}`] : [];
Rejoindre la réunion ${APP_NAME}
<a href="${url}">${url}</a>${telephonyBlock} textLines = [
────────────────────────────────────────</pre>`; "<br><br>────────────────────────────────────────",
`<br>${join}`,
`<br><br><a href="${url}" target="_blank">${url}</a>`,
...phoneLines,
"<br>────────────────────────────────────────<br>",
];
return { url, message }; } else {
phoneLines = phone && pin ? [`\n\n${phoneOnly}`, `\n${phoneFr}`, `\n${pinCode}`] : [];
textLines = [
"\n\n────────────────────────────────────────",
`\n${join}`,
`\n\n${url}`,
...phoneLines,
"\n────────────────────────────────────────\n",
];
}
const text = textLines.join("");
return { url, text };
} }
module.exports = { buildMeetingMessage }; module.exports = { buildMeetingMessage };
@@ -0,0 +1,40 @@
{
"app": {
"sideload": "Laden Sie das Add-In.",
"loading": "Wird geladen..."
},
"unauth": {
"intro": "Fügen Sie Ihren Outlook-Terminen ganz einfach einen {{app_name}}-Besprechungslink hinzu.",
"proconnect_btn": "Aanmelden met ProConnect",
"proconnect_link": "Wat is ProConnect?",
"proconnect_link_title": "Wat is ProConnect? - nieuw venster"
},
"success": {
"close_window": "Falls sich dieses Fenster nicht automatisch schließt, schließen Sie es bitte manuell."
},
"auth": {
"disconnect": "Abmelden"
},
"meeting": {
"already_added": "Es wurde bereits ein {{app_name}}-Meeting hinzugefügt.",
"link_inserted": "Besprechungslink erfolgreich eingefügt",
"generating": "Wird erstellt...",
"add_meeting": "{{app_name}}-Besprechung hinzufügen",
"remove_meeting": "{{app_name}}-Besprechung entfernen",
"removing": "Wird entfernt...",
"error": {
"auth": "Ihre Sitzung ist abgelaufen. Bitte versuchen Sie es erneut.",
"retry": "Es ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.",
"details": "Fehler: {{message}}"
}
},
"meeting_message": {
"join": "An der {{app_name}}-Besprechung teilnehmen",
"phone_only": "Oder per Telefon teilnehmen (nur Audio)",
"phone_fr": "(FR) {{phone}}",
"pin_code": "Code {{pin}}"
},
"footer": {
"feedback": "Teilen Sie uns Ihr Feedback mit"
}
}
@@ -0,0 +1,40 @@
{
"app": {
"sideload": "Please load the add-in.",
"loading": "Loading..."
},
"unauth": {
"intro": "Easily add a {{app_name}} meeting link to your Outlook events.",
"proconnect_btn": "Sign in with ProConnect",
"proconnect_link": "What is ProConnect?",
"proconnect_link_title": "What is ProConnect? - new window"
},
"success": {
"close_window": "If this window does not close automatically, please close it manually."
},
"auth": {
"disconnect": "Sign out"
},
"meeting": {
"already_added": "A {{app_name}} meeting has already been added.",
"link_inserted": "Meeting link inserted successfully",
"generating": "Generating...",
"add_meeting": "Add a {{app_name}} meeting",
"remove_meeting": "Remove the {{app_name}} meeting",
"removing": "Removing...",
"error": {
"auth": "Your session has expired. Please try again.",
"retry": "An error occurred. Please try again.",
"details": "Error: {{message}}"
}
},
"meeting_message": {
"join": "Join the {{app_name}} meeting",
"phone_only": "Or call in (audio only)",
"phone_fr": "(FR) {{phone}}",
"pin_code": "Code {{pin}}"
},
"footer": {
"feedback": "Share your feedback"
}
}
@@ -0,0 +1,40 @@
{
"app": {
"sideload": "Veuillez charger le complément.",
"loading": "Chargement..."
},
"unauth": {
"intro": "Ajoutez facilement un lien de réunion {{app_name}} à vos événements Outlook.",
"proconnect_btn": "S'identifier avec ProConnect",
"proconnect_link": "Qu'est-ce que ProConnect ?",
"proconnect_link_title": "Qu'est-ce que ProConnect ? - nouvelle fenêtre"
},
"success": {
"close_window": "Si cette fenêtre ne se ferme pas toute seule, veuillez la fermer manuellement."
},
"auth": {
"disconnect": "Se déconnecter"
},
"meeting": {
"already_added": "Une réunion {{app_name}} a déjà été ajoutée.",
"link_inserted": "Lien de réunion inséré avec succès",
"generating": "Génération...",
"add_meeting": "Ajouter une réunion {{app_name}}",
"remove_meeting": "Supprimer la réunion {{app_name}}",
"removing": "Suppression en cours...",
"error": {
"auth": "Connexion expirée, veuillez réessayer.",
"retry": "Une erreur est survenue, veuillez ré-essayer",
"details": "Erreur : {{message}}"
}
},
"meeting_message": {
"join": "Rejoindre la réunion {{app_name}}",
"phone_only": "Ou appelez (audio uniquement)",
"phone_fr": "(FR) {{phone}}",
"pin_code": "Code {{pin}}"
},
"footer": {
"feedback": "Partagez-nous vos retours"
}
}
+3 -2
View File
@@ -9,10 +9,10 @@
<script nonce="NONCE_PLACEHOLDER" src="/addons/outlook/config.js"></script> <script nonce="NONCE_PLACEHOLDER" src="/addons/outlook/config.js"></script>
</head> </head>
<body> <body>
<div id="sideload-msg">Veuillez charger le complément.</div> <div id="sideload-msg" data-i18n="app.sideload"></div>
<div class="spinner-container" <div class="spinner-container"
role="progressbar" role="progressbar"
aria-label="Chargement..." data-i18n-aria="app.loading"
> >
<svg class="spinner-svg" <svg class="spinner-svg"
viewBox="0 0 28 28" viewBox="0 0 28 28"
@@ -40,5 +40,6 @@
</svg> </svg>
</span> </span>
</div> </div>
<p id="close-msg" style="display: none; text-align: center; font-size: 13px; color: #666; margin-top: 16px;" data-i18n="success.close_window"></p>
</body> </body>
</html> </html>
+20 -5
View File
@@ -1,20 +1,35 @@
const { applyAppName } = require("../common/helpers"); const { applyAppName } = require("../common/helpers");
const { exchangeSession } = require("../common/api"); const { exchangeSession } = require("../common/api");
const { consume } = require("../common/transitToken"); const { consume } = require("../common/transitToken");
const { initI18n, translateUI } = require("../common/i18n");
applyAppName(); (async () => {
await initI18n();
const transitToken = consume(); applyAppName();
translateUI();
if (!transitToken) { const transitToken = consume();
if (!transitToken) {
console.error("Transit token not found in sessionStorage"); console.error("Transit token not found in sessionStorage");
window.close(); window.close();
} else { } else {
exchangeSession(transitToken) exchangeSession(transitToken)
.then(() => {
document.querySelector(".spinner-container").style.display = "none";
document.querySelector("#close-msg").style.display = "block";
})
.catch((e) => { .catch((e) => {
console.error(`Error occured: ${e}`); console.error(`Error occured: ${e}`);
}) })
.finally(() => { .finally(() => {
// NOTE: doesn't work with the desktop client — the browser considers
// this window wasn't opened by this script (it was opened externally),
// so it blocks window.close() for security reasons. The "#close-msg"
// shown above is the fallback for that case.g
window.close(); window.close();
}); });
} }
})();
+48 -4
View File
@@ -115,15 +115,39 @@ button {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
/* ── Danger button (remove meeting) ── */
#btn-remove {
background-color: #CA3632; /* error.400 */
color: #FFFFFF;
border: none;
}
#btn-remove:hover {
background-color: #EE6A66; /* error.600 */
}
#btn-remove:active {
background-color: #F28D8A; /* error.700 */
color: #F6AFAD; /* error.200 */
}
#btn-remove:disabled {
background-color: #F6AFAD; /* error.800 */
color: #FAD2D1; /* error.900 */
cursor: not-allowed;
}
/* ── Version ── */ /* ── Version ── */
#version-tag { #version-tag {
position: fixed; position: fixed;
bottom: 8px; bottom: 8px;
left: 8px;
right: 8px; right: 8px;
display: inline-flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
gap: 4px;
font-size: 11px; font-size: 11px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
color: #6b7280; color: #6b7280;
@@ -131,9 +155,29 @@ button {
pointer-events: none; pointer-events: none;
} }
#feedback-link {
font-size: 11px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
color: #6b7280;
text-decoration: underline;
pointer-events: all; /* override parent's pointer-events: none */
cursor: pointer;
}
#feedback-link:hover {
color: #374151;
}
#footer-right {
display: inline-flex;
align-items: center;
gap: 4px;
margin-left: auto;
}
.version-badge { .version-badge {
background: #fef3c7; background: #EEF1F4;
color: #92400e; color: #2845C1;
padding: 1px 6px; padding: 1px 6px;
border-radius: 3px; border-radius: 3px;
font-weight: 600; font-weight: 600;
+23 -14
View File
@@ -10,47 +10,56 @@
<script nonce="NONCE_PLACEHOLDER" src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script> <script nonce="NONCE_PLACEHOLDER" src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script>
</head> </head>
<body> <body>
<div id="sideload-msg">Veuillez charger le complément.</div> <div id="sideload-msg" data-i18n="app.sideload"></div>
<div id="app-body"> <div id="app-body">
<!-- Loading --> <!-- Loading -->
<div id="view-loading"> <div id="view-loading">
<p class="intro-text">Chargement...</p> <p class="intro-text" data-i18n="app.loading"></p>
</div> </div>
<!-- Unauthenticated --> <!-- Unauthenticated -->
<div id="view-unauth" style="display:none;"> <div id="view-unauth" style="display:none;">
<p class="intro-text"> <p class="intro-text">
<span>Ajoutez facilement un lien de réunion <span data-app-name></span> à vos événements Outlook.</span> <span data-i18n="unauth.intro"></span>
</p> </p>
<hr class="divider" /> <hr class="divider" />
<button class="proconnect-button" id="btn-connect"> <button class="proconnect-button" id="btn-connect">
<span class="proconnect-sr-only">S'identifier avec ProConnect</span> <span class="proconnect-sr-only" data-i18n="unauth.proconnect_btn"></span>
</button> </button>
<p> <p>
<a <a href="https://www.proconnect.gouv.fr/"
href="https://www.proconnect.gouv.fr/"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
title="Quest-ce que ProConnect ? - nouvelle fenêtre" data-i18n-attr="title:unauth.proconnect_link_title"
> data-i18n="unauth.proconnect_link"
Quest-ce que ProConnect ? ></a>
</a>
</p> </p>
</div> </div>
<!-- Authenticated --> <!-- Authenticated -->
<div id="view-auth" style="display:none;"> <div id="view-auth" style="display:none;">
<div id="btn-container"> <div id="btn-container">
<button id="btn-generate">Ajouter une réunion <span data-app-name></span></button> <!-- shown when no meeting is present -->
<button id="btn-disconnect">Se déconnecter</button> <button id="btn-generate" data-i18n="meeting.add_meeting"></button>
<!-- shown when a meeting is already present -->
<button id="btn-remove" style="display:none;" data-i18n="meeting.remove_meeting"></button>
<button id="btn-disconnect" data-i18n="auth.disconnect"></button>
</div> </div>
</div> </div>
</div> </div>
<footer id="version-tag"> <footer id="version-tag">
<span class="version-badge">alpha</span> <a id="feedback-link"
<span class="version-number">0.0.1</span> style="display:none;"
target="_blank"
rel="noopener noreferrer"
data-i18n="footer.feedback"
></a>
<div id="footer-right">
<span class="version-badge">beta</span>
<span class="version-number">0.0.2</span>
</div>
</footer> </footer>
</body> </body>
</html> </html>
+106 -35
View File
@@ -1,22 +1,77 @@
const { APP_NAME } = require("../common"); /* global Office */
const { APP_NAME, FEEDBACK_FORM } = require("../common");
const { applyAppName } = require("../common/helpers"); const { applyAppName } = require("../common/helpers");
const { initSession, createRoom } = require("../common/api"); const { initSession, createRoom } = require("../common/api");
const { startPolling } = require("../common/polling"); const { startPolling } = require("../common/polling");
const { openTransitDialog } = require("../common/transitDialog"); const { openTransitDialog } = require("../common/transitDialog");
const { loadSession, saveSession, clearSession } = require("../common/session"); const { loadSession, saveSession, clearSession } = require("../common/session");
const { buildMeetingMessage } = require("../common/messageBuilder"); const { buildMeetingMessage } = require("../common/messageBuilder");
const { initI18n, t, translateUI } = require("../common/i18n");
const { isMeetingAlreadyAdded, removeMeetingLink } = require("../common/meetingDetector");
// ── Views ────────────────────────────────────────────────────
// todo - support loading view while polling
// todo - support error view
function showView(name) { function showView(name) {
document.getElementById("view-loading").style.display = "none"; document.getElementById("view-loading").style.display = "none";
document.getElementById("view-unauth").style.display = "none"; document.getElementById("view-unauth").style.display = "none";
document.getElementById("view-auth").style.display = "none"; document.getElementById("view-auth").style.display = "none";
document.getElementById(`view-${name}`).style.display = "block"; document.getElementById(`view-${name}`).style.display = "block";
if (name === "auth") {
_refreshMeetingButtonState();
}
} }
// ── Button state ─────────────────────────────────────────────
function _showAddButton() {
document.getElementById("btn-generate").style.display = "block";
document.getElementById("btn-remove").style.display = "none";
}
function _showRemoveButton() {
document.getElementById("btn-generate").style.display = "none";
document.getElementById("btn-remove").style.display = "block";
}
function _setButtonLoading() {
const btn = document.getElementById("btn-generate");
btn.disabled = true;
btn.textContent = t("meeting.generating");
}
function _setButtonIdle() {
const btn = document.getElementById("btn-generate");
btn.disabled = false;
btn.textContent = t("meeting.add_meeting", { app_name: APP_NAME });
}
function _setRemoveLoading() {
const btn = document.getElementById("btn-remove");
btn.disabled = true;
btn.textContent = t("meeting.removing");
}
function _setRemoveIdle() {
const btn = document.getElementById("btn-remove");
btn.disabled = false;
btn.textContent = t("meeting.remove_meeting", { app_name: APP_NAME });
}
function _refreshMeetingButtonState() {
const item = Office.context.mailbox.item;
if (!item) return;
isMeetingAlreadyAdded(item).then((alreadyAdded) => {
if (alreadyAdded) {
_showRemoveButton();
} else {
_showAddButton();
}
});
}
// ── Auth ─────────────────────────────────────────────────────
function connect() { function connect() {
initSession() initSession()
.then((data) => { .then((data) => {
@@ -47,22 +102,11 @@ function disconnect() {
clearSession().finally(() => showView("unauth")); clearSession().finally(() => showView("unauth"));
} }
function _setButtonLoading() { // ── Meeting ──────────────────────────────────────────────────
const btn = document.getElementById("btn-generate");
btn.disabled = true;
btn.textContent = "Génération...";
}
function _setButtonIdle() {
const btn = document.getElementById("btn-generate");
btn.disabled = false;
btn.textContent = `Ajouter une réunion ${APP_NAME}`;
}
function generateMeetingLink() { function generateMeetingLink() {
const session = loadSession(); const session = loadSession();
if (!session?.access_token) { if (!session?.access_token) {
console.error("Session introuvable. Veuillez vous reconnecter.");
showView("unauth"); showView("unauth");
return; return;
} }
@@ -71,36 +115,28 @@ function generateMeetingLink() {
createRoom(session) createRoom(session)
.then((data) => { .then((data) => {
const { url, message } = buildMeetingMessage(data); const isWeb = Office.context.diagnostics.platform === "OfficeOnline";
const { url, text } = buildMeetingMessage(data, isWeb);
const item = Office.context.mailbox.item; const item = Office.context.mailbox.item;
return new Promise((resolve, reject) => { const coercionType = isWeb ? Office.CoercionType.Html : Office.CoercionType.Text;
item.body.getAsync(Office.CoercionType.Html, (getResult) => {
if (getResult.status !== Office.AsyncResultStatus.Succeeded) {
reject(getResult.error);
return;
}
item.body.setAsync( return new Promise((resolve, reject) => {
getResult.value + message, item.body.setSelectedDataAsync(text, { coercionType }, (setResult) => {
{ coercionType: Office.CoercionType.Html },
(setResult) => {
if (setResult.status !== Office.AsyncResultStatus.Succeeded) { if (setResult.status !== Office.AsyncResultStatus.Succeeded) {
reject(setResult.error); reject(setResult.error);
return; return;
} }
// ─── If calendar event, also set location ──────────────
if (item.itemType === Office.MailboxEnums.ItemType.Appointment) { if (item.itemType === Office.MailboxEnums.ItemType.Appointment) {
item.location.setAsync(url, () => resolve()); item.location.setAsync(url, () => resolve());
return; return;
} }
resolve(); resolve();
}
);
}); });
}); });
}) })
.then(() => {
_showRemoveButton();
})
.catch((err) => { .catch((err) => {
console.error(err); console.error(err);
}) })
@@ -109,7 +145,41 @@ function generateMeetingLink() {
}); });
} }
Office.onReady((info) => { function removeMeetingLinkFromItem() {
const session = loadSession();
if (!session?.access_token) {
showView("unauth");
return;
}
_setRemoveLoading();
const item = Office.context.mailbox.item;
removeMeetingLink(item)
.then(() => {
_showAddButton();
})
.catch((err) => {
console.error(err);
})
.finally(() => {
_setRemoveIdle();
});
}
// ── Init ─────────────────────────────────────────────────────
Office.onReady(async (info) => {
await initI18n();
translateUI();
if (FEEDBACK_FORM) {
const link = document.getElementById("feedback-link");
link.href = FEEDBACK_FORM;
link.style.display = "inline";
}
if (info.host === Office.HostType.Outlook) { if (info.host === Office.HostType.Outlook) {
applyAppName(); applyAppName();
document.getElementById("sideload-msg").style.display = "none"; document.getElementById("sideload-msg").style.display = "none";
@@ -117,10 +187,11 @@ Office.onReady((info) => {
document.getElementById("btn-connect").onclick = connect; document.getElementById("btn-connect").onclick = connect;
document.getElementById("btn-disconnect").onclick = disconnect; document.getElementById("btn-disconnect").onclick = disconnect;
document.getElementById("btn-generate").onclick = generateMeetingLink; document.getElementById("btn-generate").onclick = generateMeetingLink;
document.getElementById("btn-remove").onclick = removeMeetingLinkFromItem;
const session = loadSession(); const session = loadSession();
if (session?.state === "authenticated" && session?.access_token) { if (session?.state === "authenticated" && session?.access_token) {
showView("auth"); showView("auth"); // this already calls _refreshMeetingButtonState internally
} else { } else {
showView("unauth"); showView("unauth");
} }
+2 -2
View File
@@ -10,11 +10,11 @@
<script nonce="NONCE_PLACEHOLDER" src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script> <script nonce="NONCE_PLACEHOLDER" src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script>
</head> </head>
<body> <body>
<div id="sideload-msg">Veuillez charger le complément.</div> <div id="sideload-msg" data-i18n="app.sideload"></div>
<div <div
class="spinner-container" class="spinner-container"
role="progressbar" role="progressbar"
aria-label="Chargement..." data-i18n-aria="app.loading"
> >
<svg <svg
class="spinner-svg" class="spinner-svg"
+6 -1
View File
@@ -2,6 +2,7 @@ const { applyAppName } = require("../common/helpers");
const { URLS } = require("../common/urls"); const { URLS } = require("../common/urls");
const { save } = require("../common/transitToken"); const { save } = require("../common/transitToken");
const { DIALOG_SIGNALS } = require("../common/transitDialog"); const { DIALOG_SIGNALS } = require("../common/transitDialog");
const { initI18n, translateUI } = require("../common/i18n");
// Initiate the authentication flow, then return to the success page // Initiate the authentication flow, then return to the success page
function getAuthenticateUrl() { function getAuthenticateUrl() {
@@ -10,7 +11,11 @@ function getAuthenticateUrl() {
return url.toString(); return url.toString();
} }
Office.onReady(function (info) { Office.onReady(async function (info) {
await initI18n();
translateUI();
if (info.host === Office.HostType.Outlook) { if (info.host === Office.HostType.Outlook) {
applyAppName(); applyAppName();
} }
+1 -1
View File
@@ -1,4 +1,4 @@
FROM python:3.13.13-slim AS base FROM python:3.14.6-slim AS base
# Install system dependencies required by LiveKit # Install system dependencies required by LiveKit
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
+6 -6
View File
@@ -1,21 +1,21 @@
[project] [project]
name = "agents" name = "agents"
version = "1.19.0" version = "1.22.0"
requires-python = ">=3.12" requires-python = ">=3.12"
dependencies = [ dependencies = [
"livekit-agents==1.5.13", "livekit-agents==1.6.4",
"livekit-plugins-deepgram==1.5.13", "livekit-plugins-deepgram==1.6.4",
"livekit-plugins-silero==1.5.13", "livekit-plugins-silero==1.6.4",
"livekit-plugins-kyutai-lasuite==0.0.6", "livekit-plugins-kyutai-lasuite==0.0.6",
"python-dotenv==1.2.2", "python-dotenv==1.2.2",
"protobuf==6.33.6", "protobuf>=6.33.5",
"minio==7.2.20" "minio==7.2.20"
] ]
[project.optional-dependencies] [project.optional-dependencies]
dev = [ dev = [
"ruff==0.15.14", "ruff==0.15.19",
] ]
[tool.uv] [tool.uv]
+791 -718
View File
File diff suppressed because it is too large Load Diff
+59
View File
@@ -0,0 +1,59 @@
"""
Pluggable analytics.
Usage anywhere in the codebase:
from core import analytics
analytics.capture(request.user, "room_created", {"room_id": str(room.pk)})
The concrete backend is resolved lazily from Django settings, so swapping
PostHog for anything else is a configuration change, not a code change.
"""
from functools import lru_cache
from typing import Any
from django.conf import settings
from django.utils.module_loading import import_string
from .base import AnalyticsBackend, NoOpAnalytics
from .events import AnalyticsEvent
__all__ = [
"get_analytics",
"identify",
"capture",
"AnalyticsBackend",
"AnalyticsEvent",
]
@lru_cache(maxsize=1)
def get_analytics() -> AnalyticsBackend:
"""Instantiate the configured backend once per process."""
dotted_path = getattr(settings, "ANALYTICS_BACKEND", None)
options = getattr(settings, "ANALYTICS_BACKEND_SETTINGS", {}) or {}
if not dotted_path:
return NoOpAnalytics()
backend_class = import_string(dotted_path)
return backend_class(**options)
# Convenience module-level shortcuts
analytics_instance = get_analytics()
def identify(user, properties: dict[str, Any] | None = None) -> None:
"""Associate traits with an identified user."""
analytics_instance.identify(user, properties)
def capture(
user, event: AnalyticsEvent, properties: dict[str, Any] | None = None
) -> None:
"""Record an event performed by an identified user."""
analytics_instance.capture(user, event, properties)
+50
View File
@@ -0,0 +1,50 @@
"""Analytics backend protocol and default no-op implementation."""
from typing import Any, Protocol
from ..models import User
from .events import AnalyticsEvent
class AnalyticsBackend(Protocol):
"""
Interface every analytics backend must implement.
Backends are instantiated once (singleton) with the kwargs declared in
settings.ANALYTICS_BACKEND_SETTINGS, e.g.:
ANALYTICS_BACKEND = "core.analytics.posthog.PostHogAnalytics"
ANALYTICS_BACKEND_SETTINGS = {"api_key": "...", "host": "..."}
"""
def __init__(self, **kwargs: Any) -> None: ...
def identify(self, user: User, properties: dict[str, Any] | None = None) -> None:
"""Associate traits (email, name, ...) with an identified user."""
def capture(
self,
user: User,
event: AnalyticsEvent,
properties: dict[str, Any] | None = None,
) -> None:
"""Record an event performed by an identified user."""
def shutdown(self) -> None:
"""Flush pending events. Called on process exit."""
class NoOpAnalytics:
"""Default backend: silently discards everything."""
def __init__(self, **kwargs: Any) -> None:
"""No-op: accepts and ignores any backend settings kwargs."""
def identify(self, user: User, properties=None) -> None:
"""No-op: discards identify calls."""
def capture(self, user, event, properties=None) -> None:
"""No-op: discards captured events."""
def shutdown(self) -> None:
"""No-op: nothing to flush."""
+10
View File
@@ -0,0 +1,10 @@
"""Catalog of all analytics events emitted by the backend."""
from enum import StrEnum
class AnalyticsEvent(StrEnum):
"""All trackable events. Values are the wire names sent to the provider."""
# Rooms
ROOM_CREATED = "room_created"
+74
View File
@@ -0,0 +1,74 @@
"""PostHog implementation of the analytics backend protocol."""
import logging
from typing import Any
from posthog import Posthog
from ..models import User
from .events import AnalyticsEvent
logger = logging.getLogger(__name__)
class PostHogAnalytics:
"""Send events to PostHog, keyed on the user's primary key (UUID)."""
def __init__(
self,
*,
api_key: str,
host: str = "https://eu.i.posthog.com",
**kwargs: Any,
) -> None:
# The SDK batches and sends in a background thread by default,
# so calls below never block the request/response cycle.
self._client = Posthog(
project_api_key=api_key,
host=host,
**kwargs,
)
@staticmethod
def _distinct_id(user: User) -> str | None:
"""Return the PostHog distinct_id for a user, or None if anonymous."""
if user is None or not getattr(user, "is_authenticated", False):
return None
return str(user.pk)
def identify(self, user: User, properties: dict[str, Any] | None = None) -> None:
"""Associate traits (email, name, ...) with an identified user."""
distinct_id = self._distinct_id(user)
if distinct_id is None:
return
try:
self._client.set(
distinct_id=distinct_id,
properties=properties or {},
)
except Exception: # pylint: disable=broad-exception-caught
logger.exception("PostHog identify failed")
def capture(
self,
user: User,
event: AnalyticsEvent,
properties: dict[str, Any] | None = None,
) -> None:
"""Record an event performed by an identified user."""
distinct_id = self._distinct_id(user)
if distinct_id is None:
return
try:
self._client.capture(
distinct_id=distinct_id,
event=str(event),
properties=properties or {},
)
except Exception: # pylint: disable=broad-exception-caught
logger.exception("PostHog capture failed for event %s", event)
def shutdown(self) -> None:
"""Flush pending events. Called on process exit."""
self._client.shutdown()
+25 -18
View File
@@ -35,7 +35,7 @@ from rest_framework import (
) )
from rest_framework.settings import api_settings from rest_framework.settings import api_settings
from core import enums, models, utils from core import analytics, enums, models, utils
from core.api.filters import ListFileFilter from core.api.filters import ListFileFilter
from core.enums import MEDIA_STORAGE_URL_PATTERN from core.enums import MEDIA_STORAGE_URL_PATTERN
from core.recording.enums import FileExtension from core.recording.enums import FileExtension
@@ -46,12 +46,15 @@ from core.recording.event.exceptions import (
InvalidFileTypeError, InvalidFileTypeError,
ParsingEventDataError, ParsingEventDataError,
) )
from core.recording.event.notification import notification_service
from core.recording.event.parsers import get_parser from core.recording.event.parsers import get_parser
from core.recording.services.metadata_collector import ( from core.recording.services.metadata_collector import (
MetadataCollectorException, MetadataCollectorException,
MetadataCollectorService, MetadataCollectorService,
) )
from core.recording.services.recording_events import (
RecordingEventsService,
RecordingNotSavableError,
)
from core.recording.worker.exceptions import ( from core.recording.worker.exceptions import (
RecordingStartError, RecordingStartError,
RecordingStopError, RecordingStopError,
@@ -305,6 +308,16 @@ class RoomViewSet(
if callback_id := self.request.data.get("callback_id"): if callback_id := self.request.data.get("callback_id"):
RoomCreation().persist_callback_state(callback_id, room) RoomCreation().persist_callback_state(callback_id, room)
analytics.capture(
self.request.user,
analytics.AnalyticsEvent.ROOM_CREATED,
{
"room_id": str(room.pk),
"access_level": room.access_level,
"from_callback": bool(self.request.data.get("callback_id")),
},
)
def perform_update(self, serializer): def perform_update(self, serializer):
"""Persist the room update, then sync metadata to LiveKit.""" """Persist the room update, then sync metadata to LiveKit."""
@@ -972,24 +985,15 @@ class RecordingViewSet(
except models.Recording.DoesNotExist as e: except models.Recording.DoesNotExist as e:
raise drf_exceptions.NotFound("No recording found for this event.") from e raise drf_exceptions.NotFound("No recording found for this event.") from e
if not recording.is_savable(): # Save recording
recording_events_service = RecordingEventsService()
try:
recording_events_service.handle_complete(recording)
except RecordingNotSavableError:
raise drf_exceptions.PermissionDenied( raise drf_exceptions.PermissionDenied(
f"Recording with ID {recording_id} cannot be saved because it is either," f"Recording with ID {recording_id} cannot be saved because it is either,"
" in an error state or has already been saved." " in an error state or has already been saved."
) ) from None
# Attempt to notify external services about the recording
# This is a non-blocking operation - failures are logged but don't interrupt the flow
notification_succeeded = notification_service.notify_external_services(
recording
)
recording.status = (
models.RecordingStatusChoices.NOTIFICATION_SUCCEEDED
if notification_succeeded
else models.RecordingStatusChoices.SAVED
)
recording.save()
return drf_response.Response( return drf_response.Response(
{"message": "Event processed."}, {"message": "Event processed."},
@@ -1187,7 +1191,10 @@ class FileViewSet(
serializer.save(creator=self.request.user) serializer.save(creator=self.request.user)
def perform_destroy(self, instance): def perform_destroy(self, instance):
"""Override to implement a soft delete instead of dumping the record in database.""" """Override to implement a soft delete instead of dumping the record in database.
Files are actually purged by commands that should run periodically.
"""
instance.soft_delete() instance.soft_delete()
@decorators.action(detail=True, methods=["post"], url_path="upload-ended") @decorators.action(detail=True, methods=["post"], url_path="upload-ended")
@@ -9,6 +9,7 @@ from django.utils.translation import gettext_lazy as _
from lasuite.oidc_login.backends import ( from lasuite.oidc_login.backends import (
OIDCAuthenticationBackend as LaSuiteOIDCAuthenticationBackend, OIDCAuthenticationBackend as LaSuiteOIDCAuthenticationBackend,
) )
from rest_framework.authentication import SessionAuthentication
from core.models import User from core.models import User
from core.services.marketing import ( from core.services.marketing import (
@@ -96,3 +97,17 @@ class OIDCAuthenticationBackend(LaSuiteOIDCAuthenticationBackend):
"Multiple user accounts share a common email." "Multiple user accounts share a common email."
) from e ) from e
return None return None
class SessionAuthenticationWith401(SessionAuthentication):
"""
Identical to DRF's SessionAuthentication, but returns a WWW-Authenticate
header so unauthenticated requests get a 401 instead of a 403.
The scheme is deliberately NOT 'Basic' that would trigger the browser's
native login popup. 'Session' is ignored by the browser's auth UI but is
still truthy, so DRF keeps the status at 401.
"""
def authenticate_header(self, request):
return "Session"
+19 -3
View File
@@ -19,7 +19,7 @@ from rest_framework import (
status as drf_status, status as drf_status,
) )
from core import api, models from core import analytics, api, models
from core.api.feature_flag import FeatureFlag from core.api.feature_flag import FeatureFlag
from core.services.jwt_token import JwtTokenService from core.services.jwt_token import JwtTokenService
@@ -194,10 +194,26 @@ class RoomViewSet(
role=models.RoleChoices.OWNER, role=models.RoleChoices.OWNER,
) )
auth_method = type(self.request.successful_authenticator).__name__
client_id = (self.request.auth or {}).get("client_id", "unknown")
# Log for auditing # Log for auditing
logger.info( logger.info(
"Room created via application: room_id=%s, user_id=%s, client_id=%s", "Room created via application: room_id=%s, user_id=%s, client_id=%s, auth_method=%s",
room.id, room.id,
self.request.user.id, self.request.user.id,
getattr(self.request.auth, "client_id", "unknown"), client_id,
auth_method,
)
analytics.capture(
self.request.user,
analytics.AnalyticsEvent.ROOM_CREATED,
{
"room_id": str(room.pk),
"access_level": room.access_level,
"client_id": client_id,
"external_api": True,
"auth_method": auth_method,
},
) )
@@ -0,0 +1,47 @@
"""Clean stale pending files that were never fully uploaded."""
from datetime import timedelta
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
from core.models import File, FileUploadStateChoices
from core.tasks.file import process_file_deletion
class Command(BaseCommand):
"""Remove pending files older than a given threshold."""
help = "Delete pending files that have been stuck for too long"
def add_arguments(self, parser):
parser.add_argument(
"--hours",
type=int,
default=24,
help="Age threshold in hours (default: 24)",
)
def handle(self, *args, **options):
hours = options["hours"]
if hours < 0:
raise CommandError("Hours must be greater than 0")
threshold = timezone.now() - timedelta(hours=hours)
files = File.objects.filter(
upload_state=FileUploadStateChoices.PENDING,
created_at__lt=threshold,
hard_deleted_at__isnull=True,
)
count = 0
for file in files.iterator():
# This check shouldn't happen, but just in case we do it to avoid an error
if not file.deleted_at:
file.soft_delete()
file.hard_delete()
process_file_deletion(file.id)
count += 1
self.stdout.write(f"Cleaned {count} stale pending file(s).")
@@ -6,6 +6,7 @@ from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
from django.db import transaction from django.db import transaction
from django.db.models import Count from django.db.models import Count
from django.db.models.functions import Lower
from core.models import File, RecordingAccess, ResourceAccess, RoleChoices from core.models import File, RecordingAccess, ResourceAccess, RoleChoices
@@ -20,11 +21,14 @@ ROLE_PRIORITY = {
class Command(BaseCommand): class Command(BaseCommand):
""" """
Merge duplicate users sharing the same email into the most recently created one. Merge duplicate users sharing the same email (case-insensitive) into the
most recently created one.
The KEPT user is the most recently created. All room memberships, recording Emails are compared case-insensitively, so 'John@Example.com' and
accesses and files are transferred to it. When a conflict exists, the 'john@example.com' are treated as duplicates. The KEPT user is the most
higher-privilege role wins. Stale users are then deleted. recently created. All room memberships, recording accesses and files are
transferred to it. When a conflict exists, the higher-privilege role wins.
Stale users are then deleted.
Each email group is processed inside a single database transaction. Each email group is processed inside a single database transaction.
""" """
@@ -56,13 +60,16 @@ class Command(BaseCommand):
users_qs = users_qs.filter(email__icontains=email_filter) users_qs = users_qs.filter(email__icontains=email_filter)
self.stdout.write(f"[INFO] Filtering emails containing '{email_filter}'.\n") self.stdout.write(f"[INFO] Filtering emails containing '{email_filter}'.\n")
# Group emails case-insensitively so 'John@X.com' and 'john@x.com'
# are detected as duplicates of each other.
duplicate_emails = ( duplicate_emails = (
users_qs.exclude(email__isnull=True) users_qs.exclude(email__isnull=True)
.exclude(email="") .exclude(email="")
.values("email") .annotate(email_lower=Lower("email"))
.values("email_lower")
.annotate(cnt=Count("id")) .annotate(cnt=Count("id"))
.filter(cnt__gt=1) .filter(cnt__gt=1)
.values_list("email", flat=True) .values_list("email_lower", flat=True)
) )
if not duplicate_emails: if not duplicate_emails:
@@ -78,9 +85,12 @@ class Command(BaseCommand):
failed_emails = [] failed_emails = []
for email in duplicate_emails: for email in duplicate_emails:
# Case-insensitive lookup to fetch every casing variant of the email.
# Secondary sort by id ensures a stable, deterministic order when # Secondary sort by id ensures a stable, deterministic order when
# created_at timestamps are equal (common in tests and bulk imports). # created_at timestamps are equal (common in tests and bulk imports).
users = list(User.objects.filter(email=email).order_by("created_at", "id")) users = list(
User.objects.filter(email__iexact=email).order_by("created_at", "id")
)
kept_user = users[-1] kept_user = users[-1]
stale_users = users[:-1] stale_users = users[:-1]
@@ -120,6 +130,10 @@ class Command(BaseCommand):
failed_emails.append(email) failed_emails.append(email)
self.stderr.write(f"[ERROR] Failed to merge '{email}': {exc}") self.stderr.write(f"[ERROR] Failed to merge '{email}': {exc}")
if not kept_user.email.islower():
kept_user.email = kept_user.email.lower()
kept_user.save(update_fields=["email"])
if failed_emails: if failed_emails:
raise CommandError( raise CommandError(
f"Failed to merge {len(failed_emails)} email group(s): {', '.join(failed_emails)}" f"Failed to merge {len(failed_emails)} email group(s): {', '.join(failed_emails)}"
@@ -0,0 +1,40 @@
"""Purge deleted files."""
from datetime import timedelta
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db.models import Q
from django.utils import timezone
from core.models import File
from core.tasks.file import process_file_deletion
class Command(BaseCommand):
"""
Purge deleted files (object storage and database object):
- files marked as hard deleted in database
- files marked as soft deleted and for which the trashbin retention period has expired
"""
help = "Purge deleted files"
def handle(self, *args, **options):
"""Browse purgeable files and queue them through the file deletion task."""
is_hard_deleted = Q(hard_deleted_at__isnull=False)
is_purgeable = Q(
deleted_at__lte=timezone.now()
- timedelta(days=settings.FILE_PURGE_GRACE_DAYS)
)
count = 0
for file in File.objects.filter(is_hard_deleted | is_purgeable).iterator():
if file.hard_deleted_at is None:
file.hard_delete()
process_file_deletion.delay(file.id)
count += 1
self.stdout.write(f"Purged {count} deleted file(s).")
+5 -1
View File
@@ -6,6 +6,7 @@ import re
from dataclasses import dataclass from dataclasses import dataclass
from functools import lru_cache from functools import lru_cache
from typing import Any, Dict, Optional, Protocol from typing import Any, Dict, Optional, Protocol
from urllib.parse import quote
from django.conf import settings from django.conf import settings
from django.utils.module_loading import import_string from django.utils.module_loading import import_string
@@ -58,7 +59,7 @@ class EventParser(Protocol):
def parse(self, data: Dict) -> StorageEvent: def parse(self, data: Dict) -> StorageEvent:
"""Extract storage event data from raw dictionary input.""" """Extract storage event data from raw dictionary input."""
def validate(self, data: StorageEvent) -> None: def validate(self, data: StorageEvent) -> str:
"""Verify storage event data meets all requirements.""" """Verify storage event data meets all requirements."""
def get_recording_id(self, data: Dict) -> str: def get_recording_id(self, data: Dict) -> str:
@@ -164,6 +165,9 @@ class S3Parser(BaseS3Parser):
if not filepath: if not filepath:
raise ParsingEventDataError("Missing object key name") raise ParsingEventDataError("Missing object key name")
filetype, _ = mimetypes.guess_type(filepath) filetype, _ = mimetypes.guess_type(filepath)
# Normalize raw S3-compatible object keys without re-encoding
# already encoded AWS S3 notification keys.
filepath = quote(filepath, safe="%+")
return StorageEvent( return StorageEvent(
filepath=filepath, filepath=filepath,
filetype=filetype, filetype=filetype,
@@ -8,6 +8,7 @@ from livekit import api
from core import models, utils from core import models, utils
from core.models import Recording from core.models import Recording
from core.recording.event.notification import notification_service
logger = getLogger(__name__) logger = getLogger(__name__)
@@ -16,6 +17,10 @@ class RecordingEventsError(Exception):
"""Recording event handling fails.""" """Recording event handling fails."""
class RecordingNotSavableError(Exception):
"""Recording cannot be saved because it is either in an error state or has already been saved"""
class RecordingEventsService: class RecordingEventsService:
"""Handles recording-related LiveKit webhook events.""" """Handles recording-related LiveKit webhook events."""
@@ -73,3 +78,23 @@ class RecordingEventsService:
f"Failed to notify participants in room '{recording.room.id}' about " f"Failed to notify participants in room '{recording.room.id}' about "
f"recording limit reached (recording_id={recording.id})" f"recording limit reached (recording_id={recording.id})"
) from e ) from e
@staticmethod
def handle_complete(recording: Recording):
"""Notify external services and save recording."""
if not recording.is_savable():
raise RecordingNotSavableError
# Attempt to notify external services about the recording
# This is a non-blocking operation - failures are logged but don't interrupt the flow
notification_succeeded = notification_service.notify_external_services(
recording
)
recording.status = (
models.RecordingStatusChoices.NOTIFICATION_SUCCEEDED
if notification_succeeded
else models.RecordingStatusChoices.SAVED
)
recording.save()
+29 -6
View File
@@ -19,6 +19,7 @@ from core.recording.services.metadata_collector import (
from core.recording.services.recording_events import ( from core.recording.services.recording_events import (
RecordingEventsError, RecordingEventsError,
RecordingEventsService, RecordingEventsService,
RecordingNotSavableError,
) )
from .lobby import LobbyService from .lobby import LobbyService
@@ -88,6 +89,13 @@ class LiveKitEventsService:
def __init__(self): def __init__(self):
"""Initialize with required services.""" """Initialize with required services."""
self._webhook_handlers = {
"egress_updated": self._handle_egress_updated,
"egress_ended": self._handle_egress_ended,
"room_started": self._handle_room_started,
"room_finished": self._handle_room_finished,
}
token_verifier = api.TokenVerifier( token_verifier = api.TokenVerifier(
settings.LIVEKIT_CONFIGURATION["api_key"], settings.LIVEKIT_CONFIGURATION["api_key"],
settings.LIVEKIT_CONFIGURATION["api_secret"], settings.LIVEKIT_CONFIGURATION["api_secret"],
@@ -135,13 +143,10 @@ class LiveKitEventsService:
f"Unknown webhook type: {data.event}" f"Unknown webhook type: {data.event}"
) from e ) from e
handler_name = f"_handle_{webhook_type.value}" # Handle according to received webhook type
handler = getattr(self, handler_name, None) handler = self._webhook_handlers.get(webhook_type.value)
if not handler or not callable(handler): if handler is not None:
return
# pylint: disable=not-callable
handler(data) handler(data)
def _handle_egress_updated(self, data): def _handle_egress_updated(self, data):
@@ -195,6 +200,24 @@ class LiveKitEventsService:
f"Failed to process limit reached event for recording {recording}" f"Failed to process limit reached event for recording {recording}"
) from e ) from e
# Fallback for completion when no MinIO/S3 webhooks are configured
if (
not settings.RECORDING_STORAGE_EVENT_ENABLE
) and data.egress_info.status in [
api.EgressStatus.EGRESS_COMPLETE,
api.EgressStatus.EGRESS_LIMIT_REACHED,
]:
try:
self.recording_events.handle_complete(recording)
except RecordingNotSavableError:
logger.warning(
"Recording %s is not savable on egress complete "
"(already saved or in an error state); ignoring.",
recording.id,
)
# Silently ignoring EGRESS_ABORTED, EGRESS_FAILED
def _handle_room_started(self, data): def _handle_room_started(self, data):
"""Handle 'room_started' event.""" """Handle 'room_started' event."""
@@ -0,0 +1,263 @@
"""
Unit tests for PostHogAnalytics.
"""
# pylint: disable=redefined-outer-name,unused-argument,protected-access
from unittest.mock import patch
from django.contrib.auth.models import AnonymousUser
import pytest
from core.analytics.events import AnalyticsEvent
from core.analytics.posthog import PostHogAnalytics
from core.factories import UserFactory
pytestmark = pytest.mark.django_db
# ==============================
# __init__
# ==============================
@patch("core.analytics.posthog.Posthog")
def test_init_constructs_posthog_client_with_api_key_and_host(mock_posthog_cls):
"""Should forward api_key and host to the Posthog SDK constructor."""
PostHogAnalytics(api_key="my-key", host="https://custom.i.posthog.com")
mock_posthog_cls.assert_called_once_with(
project_api_key="my-key",
host="https://custom.i.posthog.com",
)
@patch("core.analytics.posthog.Posthog")
def test_init_defaults_to_eu_host(mock_posthog_cls):
"""Should default host to the EU PostHog cloud when not specified."""
PostHogAnalytics(api_key="my-key")
_, kwargs = mock_posthog_cls.call_args
assert kwargs["host"] == "https://eu.i.posthog.com"
@patch("core.analytics.posthog.Posthog")
def test_init_forwards_extra_kwargs_to_client(mock_posthog_cls):
"""Should pass through arbitrary extra kwargs (e.g. debug, disabled) to the SDK."""
PostHogAnalytics(api_key="my-key", debug=True, disabled=False)
_, kwargs = mock_posthog_cls.call_args
assert kwargs["debug"] is True
assert kwargs["disabled"] is False
# ==============================
# _distinct_id
# ==============================
@patch("core.analytics.posthog.Posthog")
def test_distinct_id_returns_none_for_none_user(mock_posthog_cls):
"""Should return None when user is None."""
backend = PostHogAnalytics(api_key="test-api-key")
assert backend._distinct_id(None) is None
@patch("core.analytics.posthog.Posthog")
def test_distinct_id_returns_none_for_anonymous_user(mock_posthog_cls):
"""Should return None when user.is_authenticated is falsy."""
backend = PostHogAnalytics(api_key="test-api-key")
assert backend._distinct_id(AnonymousUser()) is None
@patch("core.analytics.posthog.Posthog")
def test_distinct_id_returns_none_when_attribute_missing(mock_posthog_cls):
"""Should return None when the user object has no is_authenticated attribute at all."""
backend = PostHogAnalytics(api_key="test-api-key")
assert backend._distinct_id(object()) is None
@patch("core.analytics.posthog.Posthog")
def test_distinct_id_returns_stringified_pk_for_authenticated_user(mock_posthog_cls):
"""Should return str(user.pk) for an authenticated user."""
backend = PostHogAnalytics(api_key="test-api-key")
user = UserFactory()
assert backend._distinct_id(user) == str(user.pk)
# ==============================
# identify
# ==============================
@patch("core.analytics.posthog.Posthog")
def test_identify_noop_for_anonymous_user(mock_posthog_cls):
"""Should not call the SDK when the user is anonymous."""
backend = PostHogAnalytics(api_key="test-api-key")
backend.identify(AnonymousUser(), {"email": "a@example.com"})
mock_posthog_cls.return_value.set.assert_not_called()
@patch("core.analytics.posthog.Posthog")
def test_identify_noop_for_none_user(mock_posthog_cls):
"""Should not call the SDK when user is None."""
backend = PostHogAnalytics(api_key="test-api-key")
backend.identify(None, {"email": "a@example.com"})
mock_posthog_cls.return_value.set.assert_not_called()
@patch("core.analytics.posthog.Posthog")
def test_identify_sends_set_properties_for_authenticated_user(mock_posthog_cls):
"""Should call capture with event=$identify and properties wrapped in $set."""
backend = PostHogAnalytics(api_key="test-api-key")
user = UserFactory()
backend.identify(user, {"email": "a@example.com", "name": "A"})
mock_posthog_cls.return_value.set.assert_called_once_with(
distinct_id=str(user.pk),
properties={"email": "a@example.com", "name": "A"},
)
@patch("core.analytics.posthog.Posthog")
def test_identify_defaults_properties_to_empty_dict(mock_posthog_cls):
"""Should send an empty $set payload when properties is None."""
backend = PostHogAnalytics(api_key="test-api-key")
user = UserFactory()
backend.identify(user, None)
mock_posthog_cls.return_value.set.assert_called_once_with(
distinct_id=str(user.pk),
properties={},
)
@patch("core.analytics.posthog.Posthog")
def test_identify_swallows_sdk_exceptions(mock_posthog_cls):
"""Should log and not raise when the SDK call fails."""
mock_posthog_cls.return_value.set.side_effect = RuntimeError("network down")
backend = PostHogAnalytics(api_key="test-api-key")
user = UserFactory()
# Must not propagate.
backend.identify(user, {"email": "a@example.com"})
# ==============================
# capture
# ==============================
@patch("core.analytics.posthog.Posthog")
def test_capture_noop_for_anonymous_user(mock_posthog_cls):
"""Should not call the SDK when the user is anonymous."""
backend = PostHogAnalytics(api_key="test-api-key")
backend.capture(AnonymousUser(), AnalyticsEvent.ROOM_CREATED, {"room_id": "1"})
mock_posthog_cls.return_value.capture.assert_not_called()
@patch("core.analytics.posthog.Posthog")
def test_capture_noop_for_none_user(mock_posthog_cls):
"""Should not call the SDK when user is None."""
backend = PostHogAnalytics(api_key="test-api-key")
backend.capture(None, AnalyticsEvent.ROOM_CREATED, {"room_id": "1"})
mock_posthog_cls.return_value.capture.assert_not_called()
@patch("core.analytics.posthog.Posthog")
def test_capture_sends_event_and_properties_for_authenticated_user(mock_posthog_cls):
"""Should call capture with the distinct_id, event name, and properties."""
backend = PostHogAnalytics(api_key="test-api-key")
user = UserFactory()
backend.capture(user, AnalyticsEvent.ROOM_CREATED, {"room_id": "room-1"})
mock_posthog_cls.return_value.capture.assert_called_once_with(
distinct_id=str(user.pk),
event="room_created",
properties={"room_id": "room-1"},
)
@patch("core.analytics.posthog.Posthog")
def test_capture_serializes_event_enum_to_plain_string(mock_posthog_cls):
"""Should send the wire string, not the AnalyticsEvent enum member, to the SDK."""
backend = PostHogAnalytics(api_key="test-api-key")
user = UserFactory()
backend.capture(user, AnalyticsEvent.ROOM_CREATED)
_, kwargs = mock_posthog_cls.return_value.capture.call_args
assert kwargs["event"] == "room_created"
assert isinstance(
kwargs["event"], str
) # not AnalyticsEvent, not StrEnum subclass leaking through
@patch("core.analytics.posthog.Posthog")
def test_capture_defaults_properties_to_empty_dict(mock_posthog_cls):
"""Should send an empty properties dict when properties is None."""
backend = PostHogAnalytics(api_key="test-api-key")
user = UserFactory()
backend.capture(user, AnalyticsEvent.ROOM_CREATED, None)
mock_posthog_cls.return_value.capture.assert_called_once_with(
distinct_id=str(user.pk),
event="room_created",
properties={},
)
@patch("core.analytics.posthog.Posthog")
def test_capture_swallows_sdk_exceptions(mock_posthog_cls):
"""Should log and not raise when the SDK call fails."""
mock_posthog_cls.return_value.capture.side_effect = RuntimeError("network down")
backend = PostHogAnalytics(api_key="test-api-key")
user = UserFactory()
# Must not propagate.
backend.capture(user, AnalyticsEvent.ROOM_CREATED, {"room_id": "1"})
@patch("core.analytics.posthog.Posthog")
def test_capture_logs_the_failing_event_name_on_exception(mock_posthog_cls, caplog):
"""Should log which event failed, to aid debugging without crashing the caller."""
mock_posthog_cls.return_value.capture.side_effect = RuntimeError("network down")
backend = PostHogAnalytics(api_key="test-api-key")
user = UserFactory()
with caplog.at_level("ERROR"):
backend.capture(user, AnalyticsEvent.ROOM_CREATED)
assert any("PostHog capture failed" in record.message for record in caplog.records)
# ==============================
# shutdown
# ==============================
@patch("core.analytics.posthog.Posthog")
def test_shutdown_flushes_the_client(mock_posthog_cls):
"""Should delegate to the SDK's shutdown to flush pending events."""
backend = PostHogAnalytics(api_key="test-api-key")
backend.shutdown()
mock_posthog_cls.return_value.shutdown.assert_called_once()
@@ -0,0 +1,90 @@
"""Tests for the clean_pending_files management command."""
from datetime import timedelta
from django.core.files.storage import default_storage
from django.core.management import call_command
from django.utils import timezone
import pytest
from core import factories, models
pytestmark = pytest.mark.django_db
def test_clean_pending_files_no_stale_files():
"""Nothing happens when there are no stale pending files."""
call_command("clean_pending_files")
def test_clean_pending_files_recent_pending_not_deleted():
"""Recent pending files (within threshold) should not be deleted."""
file = factories.FileFactory(
type=models.FileTypeChoices.BACKGROUND_IMAGE,
update_upload_state=models.FileUploadStateChoices.PENDING,
upload_bytes=b"hello",
)
call_command("clean_pending_files")
file.refresh_from_db()
assert file.deleted_at is None
assert default_storage.exists(file.file_key)
def test_clean_pending_files_old_pending_deleted():
"""Pending files older than the threshold should be deleted."""
old_date = timezone.now() - timedelta(hours=49)
file = factories.FileFactory(
type=models.FileTypeChoices.BACKGROUND_IMAGE,
update_upload_state=models.FileUploadStateChoices.PENDING,
upload_bytes=b"hello",
)
assert default_storage.exists(file.file_key)
models.File.objects.filter(pk=file.pk).update(created_at=old_date)
call_command("clean_pending_files")
assert not models.File.objects.filter(pk=file.pk).exists()
assert not default_storage.exists(file.file_key)
def test_clean_pending_files_old_non_pending_not_deleted():
"""Old files that are not pending should not be deleted."""
old_date = timezone.now() - timedelta(hours=49)
file = factories.FileFactory(
type=models.FileTypeChoices.BACKGROUND_IMAGE,
update_upload_state=models.FileUploadStateChoices.READY,
)
models.File.objects.filter(pk=file.pk).update(created_at=old_date)
call_command("clean_pending_files")
file.refresh_from_db()
assert file.deleted_at is None
assert file.hard_deleted_at is None
def test_clean_pending_files_custom_hours():
"""The --hours argument controls the age threshold."""
old_date = timezone.now() - timedelta(hours=10)
file = factories.FileFactory(
type=models.FileTypeChoices.BACKGROUND_IMAGE,
update_upload_state=models.FileUploadStateChoices.PENDING,
upload_bytes=b"hello",
)
models.File.objects.filter(pk=file.pk).update(created_at=old_date)
# Default 24h threshold -> file not deleted
call_command("clean_pending_files")
file.refresh_from_db()
assert file.deleted_at is None
assert default_storage.exists(file.file_key)
# 8h threshold -> file deleted
call_command("clean_pending_files", "--hours=8")
assert not models.File.objects.filter(pk=file.pk).exists()
assert not default_storage.exists(file.file_key)
@@ -0,0 +1,85 @@
"""Tests for the purge_deleted_files management command."""
from datetime import timedelta
from io import StringIO
from random import randint
from unittest.mock import patch
from django.core.files.storage import default_storage
from django.core.management import call_command
from django.utils import timezone
import pytest
from core import factories, models
from core.tasks.file import process_file_deletion
pytestmark = pytest.mark.django_db
def test_purge_deleted_files_no_deleted_files(django_assert_num_queries):
"""Nothing happens when there are no purgeable files."""
with django_assert_num_queries(1):
call_command("purge_deleted_files")
@pytest.mark.django_db(transaction=True)
def test_purge_deleted_files_success(settings):
"""
Queue deletion for:
- hard-deleted files
- soft-deleted files past retention period + grace period.
"""
out = StringIO()
settings.FILE_PURGE_GRACE_DAYS = grace = randint(1, 20)
now = timezone.now()
purge_now = now - timedelta(days=grace)
not_deleted_file = factories.FileFactory(
type=models.FileTypeChoices.BACKGROUND_IMAGE,
upload_bytes=b"hello",
)
with patch("django.utils.timezone.now", return_value=now):
not_purgeable_file = factories.FileFactory(
type=models.FileTypeChoices.BACKGROUND_IMAGE,
upload_bytes=b"hello",
)
not_purgeable_file.soft_delete()
with patch("django.utils.timezone.now", return_value=purge_now):
purgeable_file = factories.FileFactory(
type=models.FileTypeChoices.BACKGROUND_IMAGE,
upload_bytes=b"hello",
)
purgeable_file.soft_delete()
hard_deleted_file = factories.FileFactory(
type=models.FileTypeChoices.BACKGROUND_IMAGE,
upload_bytes=b"hello",
)
hard_deleted_file.soft_delete()
hard_deleted_file.hard_delete()
with patch(
"core.management.commands.purge_deleted_files.process_file_deletion.delay",
side_effect=process_file_deletion,
) as mock_delay:
call_command("purge_deleted_files", stdout=out)
assert "Purged 2 deleted file(s)." in out.getvalue()
assert mock_delay.call_count == 2
called_ids = {call.args[0] for call in mock_delay.call_args_list}
assert called_ids == {purgeable_file.id, hard_deleted_file.id}
assert models.File.objects.filter(id=not_deleted_file.id).exists()
assert models.File.objects.filter(id=not_purgeable_file.id).exists()
assert not models.File.objects.filter(id=purgeable_file.id).exists()
assert not models.File.objects.filter(id=hard_deleted_file.id).exists()
assert default_storage.exists(not_deleted_file.file_key)
assert default_storage.exists(not_purgeable_file.file_key)
assert not default_storage.exists(purgeable_file.file_key)
assert not default_storage.exists(hard_deleted_file.file_key)
@@ -36,6 +36,26 @@ def test_merge_keeps_most_recently_created_user():
assert User.objects.filter(id=user2.id).exists() assert User.objects.filter(id=user2.id).exists()
def test_merge_user_case_insensitive():
"""Emails differing only by case should be treated as duplicates and merged,
keeping the most recently created user."""
user1 = UserFactory(email="Dup@example.com")
user2 = UserFactory(email="dup@example.com")
call_command("merge_duplicate_users")
assert not User.objects.filter(id=user1.id).exists()
assert User.objects.filter(id=user2.id).exists()
user3 = UserFactory(email="joe@example.com")
user4 = UserFactory(email="Joe@example.com")
call_command("merge_duplicate_users")
assert not User.objects.filter(id=user3.id).exists()
assert User.objects.filter(id=user4.id).exists()
user4.refresh_from_db()
assert user4.email.islower()
def test_merge_deletes_all_stale_users(): def test_merge_deletes_all_stale_users():
"""Command should delete all stale users and keep only the most recently created one.""" """Command should delete all stale users and keep only the most recently created one."""
email = "many@example.com" email = "many@example.com"
@@ -457,4 +477,4 @@ def test_merge_email_filter_is_case_insensitive():
UserFactory(email="user1@Example.com") UserFactory(email="user1@Example.com")
UserFactory(email="user1@Example.com") UserFactory(email="user1@Example.com")
call_command("merge_duplicate_users", email_filter="@example.com") call_command("merge_duplicate_users", email_filter="@example.com")
assert User.objects.filter(email="user1@Example.com").count() == 1 assert User.objects.filter(email="user1@example.com").count() == 1
@@ -360,6 +360,75 @@ def test_s3_parse_unrecognized_extension(s3_parser):
s3_parser.parse(event_with_unknown_ext) s3_parser.parse(event_with_unknown_ext)
def test_s3_parser_keeps_encoded_filepath_compatible(settings):
"""Test S3 parser keeps already encoded object keys compatible."""
settings.RECORDING_OUTPUT_FOLDER = "recordings"
recording_id = "80ae9fe5-639a-438b-b86e-9e3dd2d55f4d"
parser = S3Parser(bucket_name="recordings-bucket")
data = {
"Records": [
{
"s3": {
"bucket": {"name": "recordings-bucket"},
"object": {
"key": f"recordings%2F{recording_id}.mp4",
},
}
}
]
}
assert parser.get_recording_id(data) == recording_id
def test_s3_parser_accepts_unencoded_filepath(settings):
"""Test S3 parser accepts raw object keys with slash separators."""
settings.RECORDING_OUTPUT_FOLDER = "recordings"
recording_id = "80ae9fe5-639a-438b-b86e-9e3dd2d55f4d"
parser = S3Parser(bucket_name="recordings-bucket")
data = {
"Records": [
{
"s3": {
"bucket": {"name": "recordings-bucket"},
"object": {
"key": f"recordings/{recording_id}.mp4",
},
}
}
]
}
assert parser.get_recording_id(data) == recording_id
def test_s3_parser_preserves_plus_signs_in_encoded_filepath(settings):
"""Test S3 parser preserves plus signs in already encoded object keys."""
settings.RECORDING_OUTPUT_FOLDER = "recordings"
recording_id = "80ae9fe5-639a-438b-b86e-9e3dd2d55f4d"
parser = S3Parser(bucket_name="recordings-bucket")
data = {
"Records": [
{
"s3": {
"bucket": {"name": "recordings-bucket"},
"object": {
"key": f"folder+name%2Frecordings%2F{recording_id}.mp4",
},
}
}
]
}
assert parser.get_recording_id(data) == recording_id
def test_s3_get_recording_id_success(s3_parser, valid_s3_event): def test_s3_get_recording_id_success(s3_parser, valid_s3_event):
"""Test successful extraction of recording ID from S3 event.""" """Test successful extraction of recording ID from S3 event."""
recording_id = s3_parser.get_recording_id(valid_s3_event) recording_id = s3_parser.get_recording_id(valid_s3_event)
@@ -224,3 +224,44 @@ def test_save_recording_success(recording_settings, mock_get_parser, client, sta
recording.refresh_from_db() recording.refresh_from_db()
assert recording.status == RecordingStatusChoices.SAVED assert recording.status == RecordingStatusChoices.SAVED
@mock.patch(
"core.recording.services.recording_events.notification_service."
"notify_external_services"
)
@pytest.mark.parametrize("notification_succeeded", [True, False])
def test_save_recording_notifies_external_services(
mock_notify_external_services,
recording_settings,
mock_get_parser,
client,
notification_succeeded,
):
"""External services should be notified when a recording is saved."""
recording = RecordingFactory(status="active")
mock_parser = mock.Mock()
mock_parser.get_recording_id.return_value = recording.id
mock_get_parser.return_value = mock_parser
mock_notify_external_services.return_value = notification_succeeded
response = client.post(
"/api/v1.0/recordings/storage-hook/",
{"recording_data": "valid-data"},
HTTP_AUTHORIZATION="Bearer testAuthToken",
)
assert response.status_code == 200
assert response.json() == {"message": "Event processed."}
mock_notify_external_services.assert_called_once_with(recording)
recording.refresh_from_db()
assert recording.status == (
RecordingStatusChoices.NOTIFICATION_SUCCEEDED
if notification_succeeded
else RecordingStatusChoices.SAVED
)
@@ -91,7 +91,9 @@ def test_handle_egress_ended_success(
) )
recording.refresh_from_db() recording.refresh_from_db()
assert recording.status == "stopped"
# NB: notify_external_services will return False, so status is "saved"
assert recording.status == "saved"
@pytest.mark.parametrize( @pytest.mark.parametrize(
@@ -155,7 +157,7 @@ def test_handle_egress_updated_non_handled(
def test_handle_egress_ended_metadata_update_fails( def test_handle_egress_ended_metadata_update_fails(
mock_update_room_metadata, mock_notify, mode, notification_type, service mock_update_room_metadata, mock_notify, mode, notification_type, service
): ):
"""Should successfully stop recording when metadata's update fails.""" """Should successfully stop and save recording when metadata's update fails."""
recording = RecordingFactory(worker_id="worker-1", mode=mode, status="active") recording = RecordingFactory(worker_id="worker-1", mode=mode, status="active")
mock_data = mock.MagicMock() mock_data = mock.MagicMock()
@@ -170,7 +172,9 @@ def test_handle_egress_ended_metadata_update_fails(
room_name=str(recording.room.id), notification_data={"type": notification_type} room_name=str(recording.room.id), notification_data={"type": notification_type}
) )
recording.refresh_from_db() recording.refresh_from_db()
assert recording.status == "stopped"
# NB: notify_external_services will return False, so status is "saved"
assert recording.status == "saved"
@mock.patch("core.utils.notify_participants") @mock.patch("core.utils.notify_participants")
@@ -326,6 +330,143 @@ def test_handle_egress_ended_does_not_call_metadata_collector_stop_when_conditio
mock_collector.stop.assert_not_called() mock_collector.stop.assert_not_called()
@mock.patch(
"core.recording.services.recording_events.notification_service."
"notify_external_services"
)
@mock.patch("core.utils.notify_participants")
@mock.patch("core.utils.update_room_metadata")
@pytest.mark.parametrize(
"egress_status",
[EgressStatus.EGRESS_COMPLETE, EgressStatus.EGRESS_LIMIT_REACHED],
)
@pytest.mark.parametrize(
"notify_return_value, recording_status",
[(True, "notification_succeeded"), (False, "saved")],
)
def test_handle_egress_ended_finalizes_recording( # noqa: PLR0913
mock_update_room_metadata,
mock_notify,
mock_notify_external_services,
notify_return_value,
recording_status,
egress_status,
service,
settings,
): # pylint: disable=too-many-arguments,too-many-positional-arguments
"""Should notify external services and save the recording on egress completion
(EGRESS_COMPLETE or EGRESS_LIMIT_REACHED) when RECORDING_STORAGE_EVENT_ENABLE is False.
"""
settings.RECORDING_STORAGE_EVENT_ENABLE = False
mock_notify_external_services.return_value = notify_return_value
recording = RecordingFactory(worker_id="worker-1", status="active")
mock_data = mock.MagicMock()
mock_data.egress_info.egress_id = recording.worker_id
mock_data.egress_info.status = egress_status
service._handle_egress_ended(mock_data)
mock_notify_external_services.assert_called_once_with(recording)
recording.refresh_from_db()
assert recording.status == recording_status
@mock.patch(
"core.recording.services.recording_events.notification_service."
"notify_external_services"
)
@mock.patch("core.utils.notify_participants")
@mock.patch("core.utils.update_room_metadata")
@pytest.mark.parametrize(
"egress_status, expected_status",
[
(EgressStatus.EGRESS_COMPLETE, "active"),
(EgressStatus.EGRESS_LIMIT_REACHED, "stopped"),
],
)
def test_handle_egress_ended_does_not_finalize_when_webhooks_enabled( # noqa: PLR0913
mock_update_room_metadata,
mock_notify,
mock_notify_external_services,
egress_status,
expected_status,
service,
settings,
): # pylint: disable=too-many-arguments,too-many-positional-arguments
"""When storage event webhooks are enabled, egress_ended must not finalize the
recording: external services are never notified. EGRESS_LIMIT_REACHED still stops
the recording, EGRESS_COMPLETE leaves it active.
"""
settings.RECORDING_STORAGE_EVENT_ENABLE = True
recording = RecordingFactory(worker_id="worker-1", status="active")
mock_data = mock.MagicMock()
mock_data.egress_info.egress_id = recording.worker_id
mock_data.egress_info.status = egress_status
service._handle_egress_ended(mock_data)
mock_notify_external_services.assert_not_called()
recording.refresh_from_db()
assert recording.status == expected_status
@pytest.mark.parametrize(
"egress_status",
[
EgressStatus.EGRESS_STARTING,
EgressStatus.EGRESS_ACTIVE,
EgressStatus.EGRESS_ENDING,
EgressStatus.EGRESS_FAILED,
EgressStatus.EGRESS_ABORTED,
],
)
@mock.patch("core.utils.update_room_metadata")
def test_handle_egress_ended_does_not_save_on_wrong_status(
mock_update_room_metadata, egress_status, service, settings
):
"""Shouldn't save on invalid status."""
settings.RECORDING_STORAGE_EVENT_ENABLE = False
recording = RecordingFactory(worker_id="worker-1", status="active")
mock_data = mock.MagicMock()
mock_data.egress_info.egress_id = recording.worker_id
mock_data.egress_info.status = egress_status
service._handle_egress_ended(mock_data)
recording.refresh_from_db()
assert recording.status == "active"
@pytest.mark.parametrize(
"status", ["failed_to_start", "aborted", "failed_to_stop", "saved", "initiated"]
)
@mock.patch("core.utils.update_room_metadata")
def test_handle_egress_ended_ignores_non_savable_recording(
mock_update_room_metadata, status, service, settings
):
"""Should handle non-savable recordings idempotently without raising.
'egress_ended' may be redelivered (e.g. for an already-saved recording);
this must not raise, otherwise the webhook would 500 and LiveKit would retry.
"""
settings.RECORDING_STORAGE_EVENT_ENABLE = False
recording = RecordingFactory(worker_id="worker-1", status=status)
mock_data = mock.MagicMock()
mock_data.egress_info.egress_id = recording.worker_id
mock_data.egress_info.status = EgressStatus.EGRESS_COMPLETE
service._handle_egress_ended(mock_data)
recording.refresh_from_db()
assert recording.status == status
@mock.patch.object(LobbyService, "clear_room_cache") @mock.patch.object(LobbyService, "clear_room_cache")
@mock.patch.object(TelephonyService, "delete_dispatch_rule") @mock.patch.object(TelephonyService, "delete_dispatch_rule")
def test_handle_room_finished_clears_cache_and_deletes_dispatch_rule( def test_handle_room_finished_clears_cache_and_deletes_dispatch_rule(
+18 -3
View File
@@ -182,7 +182,9 @@ class Base(Configuration):
environ_name="FILE_UPLOAD_ENABLED", environ_name="FILE_UPLOAD_ENABLED",
environ_prefix=None, environ_prefix=None,
) )
FILE_PURGE_GRACE_DAYS = values.PositiveIntegerValue(
default=7, environ_name="FILE_PURGE_GRACE_DAYS", environ_prefix=None
)
FILE_UPLOAD_PATH = values.Value( FILE_UPLOAD_PATH = values.Value(
"files", environ_name="FILE_UPLOAD_PATH", environ_prefix=None "files", environ_name="FILE_UPLOAD_PATH", environ_prefix=None
) )
@@ -321,8 +323,7 @@ class Base(Configuration):
REST_FRAMEWORK = { REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": ( "DEFAULT_AUTHENTICATION_CLASSES": (
"mozilla_django_oidc.contrib.drf.OIDCAuthentication", "core.authentication.backends.SessionAuthenticationWith401",
"rest_framework.authentication.SessionAuthentication",
), ),
"DEFAULT_PARSER_CLASSES": [ "DEFAULT_PARSER_CLASSES": [
"rest_framework.parsers.JSONParser", "rest_framework.parsers.JSONParser",
@@ -411,6 +412,12 @@ class Base(Configuration):
"transcription_destination": values.Value( "transcription_destination": values.Value(
None, environ_name="FRONTEND_TRANSCRIPTION_DESTINATION", environ_prefix=None None, environ_name="FRONTEND_TRANSCRIPTION_DESTINATION", environ_prefix=None
), ),
"max_participants_for_sound": values.PositiveIntegerValue(
5, environ_name="FRONTEND_MAX_PARTICIPANTS_FOR_SOUND", environ_prefix=None
),
"auto_mute_on_join_threshold": values.PositiveIntegerValue(
50, environ_name="FRONTEND_AUTO_MUTE_ON_JOIN_THRESHOLD", environ_prefix=None
),
} }
# Mail # Mail
@@ -754,6 +761,14 @@ class Base(Configuration):
None, environ_name="RECORDING_DOWNLOAD_BASE_URL", environ_prefix=None None, environ_name="RECORDING_DOWNLOAD_BASE_URL", environ_prefix=None
) )
# Analytics
ANALYTICS_BACKEND = values.Value(
None, environ_name="ANALYTICS_BACKEND", environ_prefix=None
)
ANALYTICS_BACKEND_SETTINGS = values.DictValue(
{}, environ_name="ANALYTICS_BACKEND_SETTINGS", environ_prefix=None
)
# Marketing and communication settings # Marketing and communication settings
SIGNUP_NEW_USER_TO_MARKETING_EMAIL = values.BooleanValue( SIGNUP_NEW_USER_TO_MARKETING_EMAIL = values.BooleanValue(
False, # When enabled, new users are automatically added to mailing list. False, # When enabled, new users are automatically added to mailing list.
+14 -13
View File
@@ -7,7 +7,7 @@ build-backend = "uv_build"
[project] [project]
name = "meet" name = "meet"
version = "1.19.0" version = "1.22.0"
authors = [{ "name" = "DINUM", "email" = "dev@mail.numerique.gouv.fr" }] authors = [{ "name" = "DINUM", "email" = "dev@mail.numerique.gouv.fr" }]
classifiers = [ classifiers = [
"Development Status :: 5 - Production/Stable", "Development Status :: 5 - Production/Stable",
@@ -24,19 +24,19 @@ keywords = ["Django", "Contacts", "Templates", "RBAC"]
license = "MIT" license = "MIT"
requires-python = ">=3.13" requires-python = ">=3.13"
dependencies = [ dependencies = [
"boto3==1.43.14", "boto3==1.43.36",
"Brotli==1.2.0", "Brotli==1.2.0",
"brevo-python==1.2.0", "brevo-python==1.2.0",
"celery[redis]==5.6.3", "celery[redis]==5.6.3",
"dj-database-url==3.1.2", "dj-database-url==3.1.2",
"django-configurations==2.5.1", "django-configurations==2.5.1",
"django-cors-headers==4.9.0", "django-cors-headers==4.9.0",
"django-countries==8.2.0", "django-countries==9.0.0",
"django-filter==25.2", "django-filter==25.2",
"django-lasuite[all]==0.0.26", "django-lasuite[all]==0.0.27",
"django-parler==2.4", "django-parler==2.4",
"redis==5.2.1", "redis==5.2.1",
"django-redis==6.0.0", "django-redis==7.0.0",
"django-storages[s3]==1.14.6", "django-storages[s3]==1.14.6",
"django-timezone-field>=5.1", "django-timezone-field>=5.1",
"django-pydantic-field==0.5.4", "django-pydantic-field==0.5.4",
@@ -50,19 +50,20 @@ dependencies = [
"jsonschema==4.26.0", "jsonschema==4.26.0",
"markdown==3.10.2", "markdown==3.10.2",
"nested-multipart-parser==1.6.0", "nested-multipart-parser==1.6.0",
"posthog==7.16.1",
"psycopg[binary]==3.3.4", "psycopg[binary]==3.3.4",
"pydantic==2.13.4", "pydantic==2.13.4",
"PyJWT==2.13.0", "PyJWT==2.13.0",
"python-frontmatter==1.3.0", "python-frontmatter==1.3.0",
"python-magic==0.4.27", "python-magic==0.4.27",
"requests==2.34.2", "requests==2.34.2",
"sentry-sdk==2.60.0", "sentry-sdk==2.63.0",
"whitenoise==6.12.0", "whitenoise==6.12.0",
"mozilla-django-oidc==5.0.2", "mozilla-django-oidc==5.0.2",
"livekit-api==1.1.0", "livekit-api==1.1.1",
"aiohttp==3.14.0", "aiohttp==3.14.1",
"urllib3==2.7.0", "urllib3==2.7.0",
"phonenumbers==9.0.31", "phonenumbers==9.0.33",
] ]
[project.urls] [project.urls]
@@ -74,20 +75,20 @@ dependencies = [
[dependency-groups] [dependency-groups]
dev = [ dev = [
"django-extensions==4.1", "django-extensions==4.1",
"drf-spectacular-sidecar==2026.5.1", "drf-spectacular-sidecar==2026.6.1",
"freezegun==1.5.5", "freezegun==1.5.5",
"ipdb==0.13.13", "ipdb==0.13.13",
"ipython==9.13.0", "ipython==9.14.1",
"pyfakefs==6.2.0", "pyfakefs==6.2.0",
"pylint-django==2.7.0", "pylint-django==2.7.0",
"pylint<4.0.0", "pylint<4.0.0",
"pytest-cov==7.1.0", "pytest-cov==7.1.0",
"pytest-django==4.12.0", "pytest-django==4.12.0",
"pytest==9.0.3", "pytest==9.1.1",
"pytest-icdiff==0.9", "pytest-icdiff==0.9",
"pytest-xdist==3.8.0", "pytest-xdist==3.8.0",
"responses==0.26.1", "responses==0.26.1",
"ruff==0.15.14", "ruff==0.15.19",
"types-requests==2.33.0.20260518", "types-requests==2.33.0.20260518",
] ]
+584 -561
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -45,6 +45,8 @@ USER root
# Security patches for known CVEs # Security patches for known CVEs
RUN apk update && apk upgrade \ RUN apk update && apk upgrade \
libcrypto3>=3.5.7-r0 \
libssl3>=3.5.7-r0 \
musl \ musl \
musl-utils \ musl-utils \
zlib>=1.3.2-r0 \ zlib>=1.3.2-r0 \
+93 -2042
View File
File diff suppressed because it is too large Load Diff
+10 -7
View File
@@ -1,7 +1,7 @@
{ {
"name": "meet", "name": "meet",
"private": true, "private": true,
"version": "1.19.0", "version": "1.22.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "panda codegen && vite", "dev": "panda codegen && vite",
@@ -17,12 +17,12 @@
"dependencies": { "dependencies": {
"@fontsource-variable/atkinson-hyperlegible-next": "5.2.6", "@fontsource-variable/atkinson-hyperlegible-next": "5.2.6",
"@fontsource-variable/lexend": "5.2.11", "@fontsource-variable/lexend": "5.2.11",
"@libreaudio/la-call": "0.1.4",
"@fontsource/opendyslexic": "5.2.5", "@fontsource/opendyslexic": "5.2.5",
"@livekit/components-react": "2.9.21", "@livekit/components-react": "2.9.21",
"@livekit/components-styles": "1.2.0", "@livekit/components-styles": "1.2.0",
"@livekit/track-processors": "0.7.2", "@livekit/track-processors": "0.7.2",
"@pandacss/preset-panda": "1.11.1", "@pandacss/preset-panda": "1.11.3",
"@react-aria/toast": "3.0.10",
"@react-types/overlays": "3.10.0", "@react-types/overlays": "3.10.0",
"@remixicon/react": "4.9.0", "@remixicon/react": "4.9.0",
"@tanstack/react-query": "5.100.14", "@tanstack/react-query": "5.100.14",
@@ -31,16 +31,18 @@
"derive-valtio": "0.2.0", "derive-valtio": "0.2.0",
"hoofd": "1.7.3", "hoofd": "1.7.3",
"humanize-duration": "3.33.2", "humanize-duration": "3.33.2",
"i18next": "26.2.0", "i18next": "26.3.1",
"i18next-browser-languagedetector": "8.2.1", "i18next-browser-languagedetector": "8.2.1",
"i18next-parser": "9.4.0", "i18next-parser": "9.4.0",
"i18next-resources-to-backend": "1.2.1", "i18next-resources-to-backend": "1.2.1",
"livekit-client": "2.19.0", "livekit-client": "2.19.0",
"posthog-js": "1.376.0", "posthog-js": "1.386.5",
"react": "18.3.1", "react": "18.3.1",
"react-aria-components": "1.14.0", "react-aria": "3.49.0",
"react-aria-components": "1.18.0",
"react-dom": "18.3.1", "react-dom": "18.3.1",
"react-i18next": "15.1.1", "react-i18next": "17.0.8",
"react-stately": "3.47.0",
"use-sound": "5.0.0", "use-sound": "5.0.0",
"valtio": "2.3.2", "valtio": "2.3.2",
"wouter": "3.10.0" "wouter": "3.10.0"
@@ -51,6 +53,7 @@
"@tanstack/eslint-plugin-query": "5.100.14", "@tanstack/eslint-plugin-query": "5.100.14",
"@tanstack/react-query-devtools": "5.100.14", "@tanstack/react-query-devtools": "5.100.14",
"@types/humanize-duration": "3.27.4", "@types/humanize-duration": "3.27.4",
"@types/node": "24.12.4",
"@types/react": "18.3.12", "@types/react": "18.3.12",
"@types/react-dom": "18.3.1", "@types/react-dom": "18.3.1",
"@vitejs/plugin-react": "6.0.2", "@vitejs/plugin-react": "6.0.2",
+3
View File
@@ -9,6 +9,7 @@ export interface ApiConfig {
analytics?: { analytics?: {
id: string id: string
host: string host: string
flags_api_host?: string
} }
support?: { support?: {
id: string id: string
@@ -55,6 +56,8 @@ export interface ApiConfig {
default_sources: Source[] default_sources: Source[]
} }
transcription_destination?: string transcription_destination?: string
max_participants_for_sound: number
auto_mute_on_join_threshold: number
} }
const fetchConfig = (): Promise<ApiConfig> => { const fetchConfig = (): Promise<ApiConfig> => {
@@ -28,10 +28,16 @@ export const terminateAnalyticsSession = async () => {
export type useAnalyticsProps = { export type useAnalyticsProps = {
id?: string id?: string
host?: string host?: string
flags_api_host?: string
isDisabled?: boolean isDisabled?: boolean
} }
export const useAnalytics = ({ id, host, isDisabled }: useAnalyticsProps) => { export const useAnalytics = ({
id,
host,
flags_api_host,
isDisabled,
}: useAnalyticsProps) => {
const [location] = useLocation() const [location] = useLocation()
const { user } = useUser() const { user } = useUser()
@@ -39,9 +45,13 @@ export const useAnalytics = ({ id, host, isDisabled }: useAnalyticsProps) => {
if (!id || !host || isDisabled) return if (!id || !host || isDisabled) return
getPosthog().then((ph) => { getPosthog().then((ph) => {
if (ph.__loaded) return if (ph.__loaded) return
ph.init(id, { api_host: host, person_profiles: 'always' }) ph.init(id, {
api_host: host,
flags_api_host: flags_api_host,
person_profiles: 'always',
}) })
}, [id, host, isDisabled]) })
}, [id, host, flags_api_host, isDisabled])
useEffect(() => { useEffect(() => {
if (!user) return if (!user) return
+19 -3
View File
@@ -5,6 +5,16 @@ import { type ApiUser } from './ApiUser'
import { useMemo } from 'react' import { useMemo } from 'react'
import { useConfig } from '@/api/useConfig' import { useConfig } from '@/api/useConfig'
const SILENT_LOGIN_PARAM = 'silentLogin'
const isSilentLoginDisabledByUrl = () => {
if (typeof window === 'undefined') return false
const value = new URLSearchParams(window.location.search).get(
SILENT_LOGIN_PARAM
)
return value === 'false'
}
/** /**
* returns info about currently logged-in user * returns info about currently logged-in user
* *
@@ -17,16 +27,22 @@ export const useUser = (
) => { ) => {
const { data, isLoading: isConfigLoading } = useConfig() const { data, isLoading: isConfigLoading } = useConfig()
const disabledByUrl = useMemo(() => isSilentLoginDisabledByUrl(), [])
const options = useMemo(() => { const options = useMemo(() => {
if (isConfigLoading) return if (isConfigLoading) return
if (data?.is_silent_login_enabled !== true) {
const silentDisabled =
data?.is_silent_login_enabled !== true || disabledByUrl
if (silentDisabled) {
return { return {
...opts, ...opts.fetchUserOptions,
attemptSilent: false, attemptSilent: false,
} }
} }
return opts.fetchUserOptions return opts.fetchUserOptions
}, [data, opts, isConfigLoading]) }, [data, opts, isConfigLoading, disabledByUrl])
const query = useQuery({ const query = useQuery({
queryKey: [keys.user], queryKey: [keys.user],
@@ -44,7 +44,8 @@ export function PaginationControl({
if (totalPageCount <= 1) return null if (totalPageCount <= 1) return null
return ( return (
<div <nav
aria-label={t('label')}
className={css({ className={css({
position: 'absolute', position: 'absolute',
bottom: '1rem', bottom: '1rem',
@@ -74,7 +75,7 @@ export function PaginationControl({
<RiArrowLeftSLine /> <RiArrowLeftSLine />
</Button> </Button>
<span <span
aria-live="polite" role="status"
className={css({ className={css({
padding: '0.25rem 0.5rem', padding: '0.25rem 0.5rem',
})} })}
@@ -93,6 +94,6 @@ export function PaginationControl({
> >
<RiArrowRightSLine /> <RiArrowRightSLine />
</Button> </Button>
</div> </nav>
) )
} }
@@ -14,9 +14,11 @@ import { useScreenReaderAnnounce } from '@/hooks/useScreenReaderAnnounce'
import { Emoji } from '@/features/reactions/types' import { Emoji } from '@/features/reactions/types'
import { useReactions } from '@/features/reactions/hooks/useReactions' import { useReactions } from '@/features/reactions/hooks/useReactions'
import { NotificationProvider } from './NotificationProvider' import { NotificationProvider } from './NotificationProvider'
import { useConfig } from '@/api/useConfig'
export const MainNotificationToast = () => { export const MainNotificationToast = () => {
const room = useRoomContext() const room = useRoomContext()
const { data } = useConfig()
const { triggerNotificationSound } = useNotificationSound() const { triggerNotificationSound } = useNotificationSound()
const { t } = useTranslation('notifications') const { t } = useTranslation('notifications')
const announce = useScreenReaderAnnounce() const announce = useScreenReaderAnnounce()
@@ -135,12 +137,21 @@ export const MainNotificationToast = () => {
} }
}, [room, handleEmoji]) }, [room, handleEmoji])
const triggerNotificationSoundIfRoomIsSmall = useCallback(
(type: NotificationType) => {
if (!data) return
if (room.numParticipants >= data.max_participants_for_sound) return
triggerNotificationSound(type)
},
[room, data, triggerNotificationSound]
)
useEffect(() => { useEffect(() => {
const showJoinNotification = (participant: Participant) => { const showJoinNotification = (participant: Participant) => {
if (isMobileBrowser()) { if (isMobileBrowser()) {
return return
} }
triggerNotificationSound(NotificationType.ParticipantJoined) triggerNotificationSoundIfRoomIsSmall(NotificationType.ParticipantJoined)
toastQueue.add( toastQueue.add(
{ {
participant, participant,
@@ -155,7 +166,7 @@ export const MainNotificationToast = () => {
return () => { return () => {
room.off(RoomEvent.ParticipantConnected, showJoinNotification) room.off(RoomEvent.ParticipantConnected, showJoinNotification)
} }
}, [room, triggerNotificationSound]) }, [room, triggerNotificationSoundIfRoomIsSmall])
useEffect(() => { useEffect(() => {
const removeParticipantNotifications = (participant: Participant) => { const removeParticipantNotifications = (participant: Participant) => {
@@ -1,4 +1,5 @@
export enum NotificationType { export enum NotificationType {
AutoMuteLargeRoom = 'autoMuteLargeRoom',
ParticipantJoined = 'participantJoined', ParticipantJoined = 'participantJoined',
HandRaised = 'handRaised', HandRaised = 'handRaised',
ParticipantMuted = 'participantMuted', ParticipantMuted = 'participantMuted',
@@ -1,10 +1,10 @@
import { useToast } from '@react-aria/toast' import { useToast } from 'react-aria'
import { Button } from '@/primitives' import { Button } from '@/primitives'
import { RiCloseLine } from '@remixicon/react' import { RiCloseLine } from '@remixicon/react'
import { useRef } from 'react' import { useRef } from 'react'
import type { ToastState } from '@react-stately/toast' import type { ToastState } from 'react-stately'
import type { ToastData } from './ToastProvider' import type { ToastData } from './ToastProvider'
import type { QueuedToast } from '@react-stately/toast' import type { QueuedToast } from 'react-stately'
import { StyledToastContainer } from './StyledToastContainer' import { StyledToastContainer } from './StyledToastContainer'
import { StyledToast } from './StyledToast' import { StyledToast } from './StyledToast'
@@ -1,4 +1,4 @@
import { useToast } from '@react-aria/toast' import { useToast } from 'react-aria'
import { useMemo, useRef } from 'react' import { useMemo, useRef } from 'react'
import type { ToastProps } from './Toast' import type { ToastProps } from './Toast'
@@ -0,0 +1,54 @@
import { useToast } from 'react-aria'
import { useRef } from 'react'
import { type ToastProps } from './Toast'
import { VStack } from '@/styled-system/jsx'
import { useTranslation } from 'react-i18next'
import { Button } from '@/primitives'
import { css } from '@/styled-system/css'
import { StyledToastContainer } from './StyledToastContainer'
import { useRoomContext } from '@livekit/components-react'
export function ToastAutoMuteLargeRoom({
state,
...props
}: Readonly<ToastProps>) {
const room = useRoomContext()
const { t } = useTranslation('notifications', {
keyPrefix: 'autoMuteLargeRoom',
})
const ref = useRef(null)
const { toastProps, contentProps } = useToast(props, state, ref)
const toast = props.toast
const handleDismiss = async () => {
room.localParticipant
.setMicrophoneEnabled(true)
.finally(() => state.close(toast.key))
}
return (
<StyledToastContainer {...toastProps} ref={ref}>
<VStack
justify="start"
alignItems="self-start"
{...contentProps}
maxWidth="370px"
gap="0.75rem"
padding={14}
>
<p>{t('auto')}</p>
<Button
size="sm"
variant="text"
className={css({
color: 'primary.300',
})}
onPress={() => handleDismiss()}
>
{t('dismiss')}
</Button>
</VStack>
</StyledToastContainer>
)
}
@@ -1,4 +1,4 @@
import { useToast } from '@react-aria/toast' import { useToast } from 'react-aria'
import { useRef } from 'react' import { useRef } from 'react'
import { Button as RACButton } from 'react-aria-components' import { Button as RACButton } from 'react-aria-components'
import { Track } from 'livekit-client' import { Track } from 'livekit-client'
@@ -1,4 +1,4 @@
import { useToast } from '@react-aria/toast' import { useToast } from 'react-aria'
import { useRef } from 'react' import { useRef } from 'react'
import { type ToastProps } from './Toast' import { type ToastProps } from './Toast'
@@ -1,4 +1,4 @@
import { useToast } from '@react-aria/toast' import { useToast } from 'react-aria'
import { useEffect, useRef } from 'react' import { useEffect, useRef } from 'react'
import { type ToastProps } from './Toast' import { type ToastProps } from './Toast'
@@ -1,4 +1,4 @@
import { useToast } from '@react-aria/toast' import { useToast } from 'react-aria'
import { useRef } from 'react' import { useRef } from 'react'
import { type ToastProps } from './Toast' import { type ToastProps } from './Toast'
@@ -1,4 +1,4 @@
import { useToast } from '@react-aria/toast' import { useToast } from 'react-aria'
import { useMemo, useRef } from 'react' import { useMemo, useRef } from 'react'
import { type ToastProps } from './Toast' import { type ToastProps } from './Toast'
@@ -1,5 +1,5 @@
/* eslint-disable react-refresh/only-export-components */ /* eslint-disable react-refresh/only-export-components */
import { ToastQueue, useToastQueue } from '@react-stately/toast' import { ToastQueue, useToastQueue } from 'react-stately'
import { ToastRegion } from './ToastRegion' import { ToastRegion } from './ToastRegion'
import { Participant } from 'livekit-client' import { Participant } from 'livekit-client'
import type { NotificationType } from '../NotificationType' import type { NotificationType } from '../NotificationType'
@@ -1,4 +1,4 @@
import { useToast } from '@react-aria/toast' import { useToast } from 'react-aria'
import { useRef } from 'react' import { useRef } from 'react'
import { type ToastProps } from './Toast' import { type ToastProps } from './Toast'
@@ -1,4 +1,4 @@
import { useToast } from '@react-aria/toast' import { useToast } from 'react-aria'
import { useMemo, useRef } from 'react' import { useMemo, useRef } from 'react'
import { type ToastProps } from './Toast' import { type ToastProps } from './Toast'
@@ -1,4 +1,4 @@
import { useToast } from '@react-aria/toast' import { useToast } from 'react-aria'
import { useMemo, useRef } from 'react' import { useMemo, useRef } from 'react'
import { Text } from '@/primitives' import { Text } from '@/primitives'
@@ -1,5 +1,5 @@
import { AriaToastRegionProps, useToastRegion } from '@react-aria/toast' import { AriaToastRegionProps, useToastRegion } from 'react-aria'
import type { QueuedToast, ToastState } from '@react-stately/toast' import type { QueuedToast, ToastState } from 'react-stately'
import { Toast } from './Toast' import { Toast } from './Toast'
import { useRef } from 'react' import { useRef } from 'react'
import { NotificationType } from '../NotificationType' import { NotificationType } from '../NotificationType'
@@ -13,6 +13,7 @@ import { ToastAnyRecording } from './ToastAnyRecording'
import { ToastRecordingSaving } from './ToastRecordingSaving' import { ToastRecordingSaving } from './ToastRecordingSaving'
import { ToastPermissionsRemoved } from './ToastPermissionsRemoved' import { ToastPermissionsRemoved } from './ToastPermissionsRemoved'
import { ToastRecordingRequest } from './ToastRecordingRequest' import { ToastRecordingRequest } from './ToastRecordingRequest'
import { ToastAutoMuteLargeRoom } from './ToastAutoMuteLargeRoom'
interface ToastRegionProps extends AriaToastRegionProps { interface ToastRegionProps extends AriaToastRegionProps {
state: ToastState<ToastData> state: ToastState<ToastData>
@@ -45,6 +46,11 @@ const renderToast = (
case NotificationType.LowerHand: case NotificationType.LowerHand:
return <ToastLowerHand key={toast.key} toast={toast} state={state} /> return <ToastLowerHand key={toast.key} toast={toast} state={state} />
case NotificationType.AutoMuteLargeRoom:
return (
<ToastAutoMuteLargeRoom key={toast.key} toast={toast} state={state} />
)
case NotificationType.TranscriptionStarted: case NotificationType.TranscriptionStarted:
case NotificationType.TranscriptionStopped: case NotificationType.TranscriptionStopped:
case NotificationType.TranscriptionLimitReached: case NotificationType.TranscriptionLimitReached:
@@ -5,6 +5,15 @@ import type { Participant } from 'livekit-client'
import type { NotificationPayload } from './NotificationPayload' import type { NotificationPayload } from './NotificationPayload'
import type { RecordingMode } from '@/features/recording' import type { RecordingMode } from '@/features/recording'
export const notifyAutoMutedOnJoin = () => {
toastQueue.add(
{
type: NotificationType.AutoMuteLargeRoom,
},
{ timeout: NotificationDuration.ALERT }
)
}
export const showLowerHandToast = ( export const showLowerHandToast = (
participant: Participant, participant: Participant,
onClose: () => void onClose: () => void
@@ -68,7 +68,7 @@ export const PipView = () => {
</ConnectionStateWrapper> </ConnectionStateWrapper>
<PipStage /> <PipStage />
<ReactionsToolbar adjustedCentering={false} /> <ReactionsToolbar adjustedCentering={false} />
<PipControlBar showScreenShare={false} /> <PipControlBar showScreenShare={true} />
<PipFloatingReactions /> <PipFloatingReactions />
<NotificationProvider bottom={30} /> <NotificationProvider bottom={30} />
</Container> </Container>
@@ -1,6 +1,6 @@
import { useEffect, useRef, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import { RiMoreFill } from '@remixicon/react' import { RiMoreFill } from '@remixicon/react'
import { FocusScope } from '@react-aria/focus' import { FocusScope } from 'react-aria'
import { Box, Button } from '@/primitives' import { Box, Button } from '@/primitives'
import { css } from '@/styled-system/css' import { css } from '@/styled-system/css'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
@@ -0,0 +1,96 @@
import { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react'
import { useTranslation } from 'react-i18next'
import { styled } from '@/styled-system/jsx'
interface PipPaginationProps {
totalPageCount: number
currentPage: number
nextPage: () => void
prevPage: () => void
}
export const PipPagination = ({
totalPageCount,
currentPage,
nextPage,
prevPage,
}: PipPaginationProps) => {
const { t } = useTranslation('rooms', { keyPrefix: 'pagination' })
if (totalPageCount <= 1) return null
return (
<Nav aria-label={t('label')}>
<ArrowButton
type="button"
onClick={prevPage}
disabled={currentPage === 1}
aria-label={t('previous')}
>
<RiArrowLeftSLine size={18} />
</ArrowButton>
<Counter role="status">
{t('count', { currentPage, totalPageCount })}
</Counter>
<ArrowButton
type="button"
onClick={nextPage}
disabled={currentPage === totalPageCount}
aria-label={t('next')}
>
<RiArrowRightSLine size={18} />
</ArrowButton>
</Nav>
)
}
const Nav = styled('nav', {
base: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: '0.25rem',
marginTop: '1rem',
flexShrink: 0,
},
})
const ArrowButton = styled('button', {
base: {
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
width: '1.75rem',
height: '1.75rem',
borderRadius: '4px',
border: 'none',
cursor: 'pointer',
color: 'white',
backgroundColor: 'primaryDark.100',
transition: 'opacity 0.15s, background-color 0.15s',
'&:hover:not(:disabled)': {
backgroundColor: 'primaryDark.75',
},
'&:focus-visible': {
outline: '2px solid',
outlineColor: 'white',
outlineOffset: '2px',
},
'&:disabled': {
opacity: 0.3,
cursor: 'default',
},
},
})
const Counter = styled('span', {
base: {
fontSize: '0.75rem',
color: 'white',
opacity: 0.8,
whiteSpace: 'nowrap',
padding: '0 0.25rem',
minWidth: '3rem',
textAlign: 'center',
},
})
@@ -1,9 +1,12 @@
import { useMemo } from 'react' import { useMemo } from 'react'
import { useTracks } from '@livekit/components-react' import { usePagination, useTracks } from '@livekit/components-react'
import { RoomEvent, Track } from 'livekit-client' import { RoomEvent, Track } from 'livekit-client'
import { styled } from '@/styled-system/jsx'
import { PipFocusLayout } from './PipFocusLayout' import { PipFocusLayout } from './PipFocusLayout'
import { PipGridLayout } from './PipGridLayout' import { PipGridLayout } from './PipGridLayout'
import { PipPagination } from './PipPagination'
import { StageFrame } from './StageFrame' import { StageFrame } from './StageFrame'
import { MAX_PIP_TILES } from '../../utils/pipGrid'
import { import {
isTrackReference, isTrackReference,
TrackReferenceOrPlaceholder, TrackReferenceOrPlaceholder,
@@ -38,21 +41,38 @@ export const PipStage = () => {
[tracks] [tracks]
) )
// Grid mode order: screen share leads, then cameras (already ordered by
// active speaker via the `ActiveSpeakersChanged` update above).
const gridTracks = useMemo(
() =>
screenShareTrack ? [screenShareTrack, ...cameraTracks] : cameraTracks,
[screenShareTrack, cameraTracks]
)
// Cap the grid at MAX_PIP_TILES per page. `usePagination` keeps the visible
// page visually stable (active/recent speakers stay put) via its internal
// `useVisualStableUpdate`. Called unconditionally to respect hook rules.
const pagination = usePagination(MAX_PIP_TILES, gridTracks)
if (tracks.length === 0) return null if (tracks.length === 0) return null
/** /**
* The focus layout shows one main track with one thumbnail overlay, * The focus layout shows one main track with one thumbnail overlay,
* so it can only fit 2 tracks. Beyond that we switch to the grid. * so it can only fit 2 tracks. Beyond that we switch to the grid.
*/ */
if (tracks.length > 2) { if (gridTracks.length > 2) {
// Grid mode: 3+ tracks. Screen share goes first so it leads the grid.
const gridTracks = screenShareTrack
? [screenShareTrack, ...cameraTracks]
: cameraTracks
return ( return (
<StageWrapper>
<StageFrame> <StageFrame>
<PipGridLayout tracks={gridTracks} /> <PipGridLayout tracks={pagination.tracks} />
</StageFrame> </StageFrame>
<PipPagination
totalPageCount={pagination.totalPageCount}
currentPage={pagination.currentPage}
nextPage={pagination.nextPage}
prevPage={pagination.prevPage}
/>
</StageWrapper>
) )
} }
@@ -75,3 +95,12 @@ export const PipStage = () => {
</StageFrame> </StageFrame>
) )
} }
const StageWrapper = styled('div', {
base: {
display: 'flex',
flexDirection: 'column',
minWidth: 0,
minHeight: 0,
},
})
@@ -1,12 +1,19 @@
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { styled } from '@/styled-system/jsx' import { styled } from '@/styled-system/jsx'
import { useLocalParticipant } from '@livekit/components-react'
export const StageFrame = ({ children }: { children: React.ReactNode }) => { export const StageFrame = ({ children }: { children: React.ReactNode }) => {
const { t } = useTranslation('rooms', { const { t } = useTranslation('rooms', {
keyPrefix: 'pictureInPicture', keyPrefix: 'pictureInPicture',
}) })
const { localParticipant } = useLocalParticipant()
return ( return (
<Container role="region" aria-label={t('stage')} {...{ inert: '' }}> <Container
role="region"
aria-label={t('stage')}
{...(!localParticipant.isScreenShareEnabled ? { inert: '' } : {})}
>
{children} {children}
</Container> </Container>
) )
@@ -15,6 +22,7 @@ export const StageFrame = ({ children }: { children: React.ReactNode }) => {
const Container = styled('div', { const Container = styled('div', {
base: { base: {
position: 'relative', position: 'relative',
flex: 1,
minWidth: 0, minWidth: 0,
minHeight: 0, minHeight: 0,
marginLeft: '0.5rem', marginLeft: '0.5rem',
@@ -1,3 +1,10 @@
/**
* Maximum number of tiles rendered per PiP page. Beyond this the grid
* paginates so large meetings stay glanceable (active speaker priority)
* instead of subscribing to and rendering every camera in a small window.
*/
export const MAX_PIP_TILES = 5
export type PipTilePlacement = { export type PipTilePlacement = {
gridColumn: string gridColumn: string
gridRow: number gridRow: number
@@ -12,7 +12,7 @@ import { useSize } from '@/features/rooms/livekit/hooks/useResizeObserver'
import { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react' import { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react'
import { Button } from '@/primitives' import { Button } from '@/primitives'
import { ReactionsKeyboardNavigation } from './ReactionsKeyboardNavigation' import { ReactionsKeyboardNavigation } from './ReactionsKeyboardNavigation'
import { FocusScope } from '@react-aria/focus' import { FocusScope } from 'react-aria'
import { CONTROL_BAR_REGION_ID } from '@/features/layout/components/ControlBarRegion' import { CONTROL_BAR_REGION_ID } from '@/features/layout/components/ControlBarRegion'
import { REACTIONS_TOGGLE_ID } from '../ReactionsToggle' import { REACTIONS_TOGGLE_ID } from '../ReactionsToggle'
@@ -1,5 +1,5 @@
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { useFocusManager } from '@react-aria/focus' import { useFocusManager } from 'react-aria'
import { getFirstControlBarFocusable } from '@/utils/dom' import { getFirstControlBarFocusable } from '@/utils/dom'
import { REACTIONS_TOOLBAR_ID } from '../../constants' import { REACTIONS_TOOLBAR_ID } from '../../constants'
import { useReactionsToolbar } from '../../hooks/useReactionsToolbar' import { useReactionsToolbar } from '../../hooks/useReactionsToolbar'
@@ -6,5 +6,5 @@ export const useIsMetadataCollectorEnabled = () => {
const featureEnabled = useFeatureFlagEnabled(FeatureFlags.metadataCollector) const featureEnabled = useFeatureFlagEnabled(FeatureFlags.metadataCollector)
const isAnalyticsEnabled = useIsAnalyticsEnabled() const isAnalyticsEnabled = useIsAnalyticsEnabled()
return (featureEnabled && isAnalyticsEnabled) || true return !isAnalyticsEnabled || Boolean(featureEnabled)
} }
@@ -1,4 +1,4 @@
import { useEffect, useMemo, useState } from 'react' import { useEffect, useMemo, useRef, useState } from 'react'
import { useQuery } from '@tanstack/react-query' import { useQuery } from '@tanstack/react-query'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { import {
@@ -33,6 +33,9 @@ import { useIsMobile } from '@/utils/useIsMobile'
import { navigateTo } from '@/navigation/navigateTo' import { navigateTo } from '@/navigation/navigateTo'
import { connectionObserverStore } from '@/stores/connectionObserver' import { connectionObserverStore } from '@/stores/connectionObserver'
import { PictureInPictureConference } from '@/features/pip/components/PictureInPictureConference' import { PictureInPictureConference } from '@/features/pip/components/PictureInPictureConference'
import { notifyAutoMutedOnJoin } from '@/features/notifications/utils'
import { useSnapshot } from 'valtio'
import { userPreferencesStore } from '@/stores/userPreferences'
export const Conference = ({ export const Conference = ({
roomId, roomId,
@@ -57,6 +60,8 @@ export const Conference = ({
const [isConnectionWarmedUp, setIsConnectionWarmedUp] = useState(false) const [isConnectionWarmedUp, setIsConnectionWarmedUp] = useState(false)
const userPreferencesSnap = useSnapshot(userPreferencesStore)
const { const {
mutateAsync: createRoom, mutateAsync: createRoom,
status: createStatus, status: createStatus,
@@ -173,6 +178,8 @@ export const Conference = ({
const isMobile = useIsMobile() const isMobile = useIsMobile()
const hasAutoMutedRef = useRef(false)
/* /*
* Ensure stable WebSocket connection URL. This is critical for legacy browser compatibility * Ensure stable WebSocket connection URL. This is critical for legacy browser compatibility
* (Firefox <124, Chrome <125, Edge <125) where HTTPS URLs in WebSocket() constructor * (Firefox <124, Chrome <125, Edge <125) where HTTPS URLs in WebSocket() constructor
@@ -228,6 +235,19 @@ export const Conference = ({
onError={(e) => { onError={(e) => {
posthog.captureException(e) posthog.captureException(e)
}} }}
onConnected={async () => {
if (!apiConfig) return
if (
userPreferencesSnap.is_auto_mute_large_room_enabled &&
!hasAutoMutedRef.current &&
userConfig.audioEnabled &&
room.numParticipants > apiConfig.auto_mute_on_join_threshold
) {
hasAutoMutedRef.current = true
await room.localParticipant.setMicrophoneEnabled(false)
notifyAutoMutedOnJoin()
}
}}
onDisconnected={(e) => { onDisconnected={(e) => {
const metadata = { const metadata = {
room_id: roomId, room_id: roomId,
@@ -216,6 +216,14 @@ export const Join = ({
try { try {
const track = await createLocalAudioTrack({ const track = await createLocalAudioTrack({
deviceId: { exact: audioDeviceId }, deviceId: { exact: audioDeviceId },
noiseSuppression: true,
echoCancellation: true,
autoGainControl: true,
voiceIsolation: false,
// Audio quality optimized for voice
sampleRate: 48000, // High quality sample rate
channelCount: 1, // Mono for voice calls (saves bandwidth)
sampleSize: 16, // 16-bit audio
}) })
setDynamicAudioTrack(track) setDynamicAudioTrack(track)
} catch (error) { } catch (error) {
@@ -1,6 +1,6 @@
import { css } from '@/styled-system/css' import { css } from '@/styled-system/css'
import { Button, Text } from '@/primitives' import { Button, Text } from '@/primitives'
import { useMemo, useRef } from 'react' import { useCallback, useMemo, useRef } from 'react'
import { screenSharePreferenceStore } from '@/stores/screenSharePreferences' import { screenSharePreferenceStore } from '@/stores/screenSharePreferences'
import { useSnapshot } from 'valtio' import { useSnapshot } from 'valtio'
import { useLocalParticipant } from '@livekit/components-react' import { useLocalParticipant } from '@livekit/components-react'
@@ -61,9 +61,19 @@ export const FullScreenShareWarning = ({
await localParticipant.setScreenShareEnabled(false, {}, {}) await localParticipant.setScreenShareEnabled(false, {}, {})
} }
const handleDismissWarning = () => { const handleDismissWarning = useCallback(() => {
screenSharePreferenceStore.enabled = false screenSharePreferenceStore.enabled = false
}, [])
const handleKeyDown = useCallback(
(e: React.KeyboardEvent) => {
if (e.key === 'Escape') {
e.stopPropagation()
handleDismissWarning()
} }
},
[handleDismissWarning]
)
if (!shouldShowWarning) return null if (!shouldShowWarning) return null
@@ -98,6 +108,7 @@ export const FullScreenShareWarning = ({
})} })}
> >
<Text <Text
role="alert"
style={{ style={{
color: 'white', color: 'white',
flexBasis: '55%', flexBasis: '55%',
@@ -117,11 +128,14 @@ export const FullScreenShareWarning = ({
})} })}
> >
<Button <Button
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
variant="tertiary" variant="tertiary"
size="sm" size="sm"
style={{ style={{
height: 'fit-content', height: 'fit-content',
}} }}
onKeyDown={handleKeyDown}
onPress={async () => { onPress={async () => {
await handleStopScreenShare() await handleStopScreenShare()
}} }}
@@ -134,6 +148,7 @@ export const FullScreenShareWarning = ({
style={{ style={{
height: 'fit-content', height: 'fit-content',
}} }}
onKeyDown={handleKeyDown}
onPress={() => handleDismissWarning()} onPress={() => handleDismissWarning()}
> >
{t('ignore')} {t('ignore')}
@@ -400,6 +400,8 @@ export const EffectsConfiguration = ({
config: ProcessorConfig config: ProcessorConfig
isSelected: boolean isSelected: boolean
tooltip: string tooltip: string
ariaLabel: string
ariaDeleteLabel: string
file: ApiFileItem file: ApiFileItem
}[] }[]
}>(() => { }>(() => {
@@ -426,7 +428,9 @@ export const EffectsConfiguration = ({
const id = deriveIdFromProcessorConfig(config) const id = deriveIdFromProcessorConfig(config)
return { return {
id, id,
tooltip: t(`blur.light.${selectedId === id ? 'clear' : 'apply'}`), tooltip: t(
`blur.${item.key}.${selectedId === id ? 'clear' : 'apply'}`
),
radius: item.radius, radius: item.radius,
isSelected: selectedId === id, isSelected: selectedId === id,
Icon: item.icon, Icon: item.icon,
@@ -443,9 +447,11 @@ export const EffectsConfiguration = ({
} }
const id = deriveIdFromProcessorConfig(config) const id = deriveIdFromProcessorConfig(config)
const isSelected = selectedId === id const isSelected = selectedId === id
const prefix = isSelected ? 'selectedLabel' : 'apply'
const backgroundName = t(`virtual.presets.descriptions.${index}`) const backgroundName = t(`virtual.presets.descriptions.${index}`)
const ariaLabel = `${t(`virtual.presets.${prefix}`)} ${backgroundName}` const ariaLabelPrefix = t(
isSelected ? `virtual.selectedLabel` : `virtual.apply`
)
const ariaLabel = `${ariaLabelPrefix} ${backgroundName}`
return { return {
tooltip: backgroundName, tooltip: backgroundName,
@@ -467,13 +473,22 @@ export const EffectsConfiguration = ({
} }
const id = deriveIdFromProcessorConfig(config) const id = deriveIdFromProcessorConfig(config)
const isSelected = selectedId === id
const ariaLabel = t(
isSelected
? `virtual.personal.selectedLabel`
: `virtual.personal.apply`
)
const ariaDeleteLabel = t('virtual.personal.deleteLabel')
return { return {
tooltip: file.title, tooltip: file.title,
id, id,
config, config,
isSelected: selectedId === id, isSelected,
file, file,
ariaLabel,
ariaDeleteLabel,
} }
}), }),
} }
@@ -552,6 +567,7 @@ export const EffectsConfiguration = ({
[layout === 'vertical' ? 'height' : 'minHeight']: '175px', [layout === 'vertical' ? 'height' : 'minHeight']: '175px',
borderRadius: '8px', borderRadius: '8px',
}} }}
aria-hidden={true}
/> />
) : ( ) : (
<div <div
@@ -664,7 +680,7 @@ export const EffectsConfiguration = ({
})} })}
> >
<H <H
lvl={2} lvl={3}
style={{ style={{
marginBottom: '0.4rem', marginBottom: '0.4rem',
}} }}
@@ -680,6 +696,7 @@ export const EffectsConfiguration = ({
paddingBottom: '0.5rem', paddingBottom: '0.5rem',
flexWrap: 'wrap', flexWrap: 'wrap',
})} })}
role="list"
> >
{createFileMutation.isPending && {createFileMutation.isPending &&
fileBeingUploadedObjectUrlRef.current && ( fileBeingUploadedObjectUrlRef.current && (
@@ -721,13 +738,17 @@ export const EffectsConfiguration = ({
className={ className={
'hoverGroup ' + css({ position: 'relative' }) 'hoverGroup ' + css({ position: 'relative' })
} }
role="listitem"
> >
<div role="group" aria-label={option.file.title}>
<VisualOnlyTooltip tooltip={option.tooltip}> <VisualOnlyTooltip tooltip={option.tooltip}>
<ToggleButton <ToggleButton
variant="bigSquare" variant="bigSquare"
aria-label={option.tooltip} aria-label={option.ariaLabel}
isDisabled={processorOptions.isDisabled} isDisabled={processorOptions.isDisabled}
onChange={getHandleSelectChangeFile(option.file)} onChange={getHandleSelectChangeFile(
option.file
)}
isSelected={option.isSelected} isSelected={option.isSelected}
className={css({ className={css({
bgSize: 'cover', bgSize: 'cover',
@@ -748,6 +769,7 @@ export const EffectsConfiguration = ({
transition: 'opacity 0.2s ease-in-out', transition: 'opacity 0.2s ease-in-out',
}) })
} }
aria-label={option.ariaDeleteLabel}
size={'xs'} size={'xs'}
variant={'tertiary'} variant={'tertiary'}
onClick={() => { onClick={() => {
@@ -764,6 +786,7 @@ export const EffectsConfiguration = ({
<RiDeleteBinLine size={16} /> <RiDeleteBinLine size={16} />
</Button> </Button>
</div> </div>
</div>
) )
)} )}
{!canUploadBackground && {!canUploadBackground &&
@@ -775,9 +798,13 @@ export const EffectsConfiguration = ({
> >
<ToggleButton <ToggleButton
variant="bigSquare" variant="bigSquare"
aria-label={ aria-label={`${t(
uploadNotPossibleSnap.imageBackgroundConfig.label deriveIdFromProcessorConfig(
} uploadNotPossibleSnap.imageBackgroundConfig
) === selectedId
? `virtual.selectedLabel`
: `virtual.apply`
)} ${uploadNotPossibleSnap.imageBackgroundConfig.label}`}
isDisabled={ isDisabled={
processorOptions.isDisabled || processorOptions.isDisabled ||
createFileMutation.isPending createFileMutation.isPending
@@ -857,7 +884,7 @@ export const EffectsConfiguration = ({
})} })}
> >
<H <H
lvl={2} lvl={3}
style={{ style={{
marginBottom: '0.4rem', marginBottom: '0.4rem',
}} }}
@@ -872,9 +899,11 @@ export const EffectsConfiguration = ({
paddingBottom: '0.5rem', paddingBottom: '0.5rem',
flexWrap: 'wrap', flexWrap: 'wrap',
})} })}
role="list"
> >
{processorOptions.virtualBackgrounds.map((option) => ( {processorOptions.virtualBackgrounds.map((option) => (
<VisualOnlyTooltip key={option.id} tooltip={option.tooltip}> <div role="listitem" key={option.id}>
<VisualOnlyTooltip tooltip={option.tooltip}>
<ToggleButton <ToggleButton
variant="bigSquare" variant="bigSquare"
aria-label={option.ariaLabel} aria-label={option.ariaLabel}
@@ -890,6 +919,7 @@ export const EffectsConfiguration = ({
data-attr={`toggle-virtual-preset-${option.index}`} data-attr={`toggle-virtual-preset-${option.index}`}
/> />
</VisualOnlyTooltip> </VisualOnlyTooltip>
</div>
))} ))}
</div> </div>
</div> </div>
@@ -1,14 +1,30 @@
import type { Track, TrackProcessor, ProcessorOptions } from 'livekit-client' import type { Track, TrackProcessor, ProcessorOptions } from 'livekit-client'
import { NoiseSuppressorWorklet_Name } from '@timephy/rnnoise-wasm'
// This is an example how to get the script path using Vite, may be different when using other build tools
// NOTE: `?worker&url` is important (`worker` to generate a working script, `url` to get its url to load it)
import NoiseSuppressorWorklet from '@timephy/rnnoise-wasm/NoiseSuppressorWorklet?worker&url'
// Use Jitsi's approach: maintain a global AudioContext variable // Use Jitsi's approach: maintain a global AudioContext variable
// and suspend/resume it as needed to manage audio state // and suspend/resume it as needed to manage audio state
let audioContext: AudioContext let audioContext: AudioContext
/**
* Lazily load the WASM processor factory.
*
* '@libreaudio/la-call' pulls in a WebAssembly payload, so we defer importing
* it until a processor is actually initialized rather than at module load.
* The import promise is cached so repeated init() calls reuse the same module.
*/
type CreateWasmProcessor =
(typeof import('@libreaudio/la-call'))['createWasmProcessor']
let wasmProcessorPromise: Promise<CreateWasmProcessor> | undefined
function loadWasmProcessor(): Promise<CreateWasmProcessor> {
if (!wasmProcessorPromise) {
wasmProcessorPromise = import('@libreaudio/la-call').then(
(mod) => mod.createWasmProcessor
)
}
return wasmProcessorPromise
}
export interface AudioProcessorInterface extends TrackProcessor<Track.Kind.Audio> { export interface AudioProcessorInterface extends TrackProcessor<Track.Kind.Audio> {
name: string name: string
} }
@@ -20,7 +36,7 @@ export class RnnNoiseProcessor implements AudioProcessorInterface {
private source?: MediaStreamTrack private source?: MediaStreamTrack
private sourceNode?: MediaStreamAudioSourceNode private sourceNode?: MediaStreamAudioSourceNode
private destinationNode?: MediaStreamAudioDestinationNode private destinationNode?: MediaStreamAudioDestinationNode
private noiseSuppressionNode?: AudioWorkletNode private noiseSuppressionNode?: AudioNode
async init(opts: ProcessorOptions<Track.Kind.Audio>) { async init(opts: ProcessorOptions<Track.Kind.Audio>) {
if (!opts.track) { if (!opts.track) {
@@ -35,16 +51,17 @@ export class RnnNoiseProcessor implements AudioProcessorInterface {
await audioContext.resume() await audioContext.resume()
} }
await audioContext.audioWorklet.addModule(NoiseSuppressorWorklet)
this.sourceNode = audioContext.createMediaStreamSource( this.sourceNode = audioContext.createMediaStreamSource(
new MediaStream([this.source]) new MediaStream([this.source])
) )
this.noiseSuppressionNode = new AudioWorkletNode( const createWasmProcessor = await loadWasmProcessor()
audioContext, this.noiseSuppressionNode = await createWasmProcessor(audioContext, {
NoiseSuppressorWorklet_Name intensity: 90,
) })
if (!this.noiseSuppressionNode) {
throw new Error('Failed to create Wasm processor')
}
this.destinationNode = audioContext.createMediaStreamDestination() this.destinationNode = audioContext.createMediaStreamDestination()
@@ -39,6 +39,19 @@ export const GeneralTab = ({ id }: GeneralTabProps) => {
fullWidth: true, fullWidth: true,
}} }}
/> />
<Field
type="switch"
label={t('preferences.autoMuteLargeRoom.label')}
description={t('preferences.autoMuteLargeRoom.description')}
isSelected={userPreferencesSnap.is_auto_mute_large_room_enabled}
onChange={(value) =>
(userPreferencesStore.is_auto_mute_large_room_enabled = value)
}
wrapperProps={{
noMargin: true,
fullWidth: true,
}}
/>
</TabPanel> </TabPanel>
) )
} }
+16 -1
View File
@@ -14,6 +14,7 @@ import { VisualOnlyTooltip } from '@/primitives/VisualOnlyTooltip'
import { useLoginHint } from '@/hooks/useLoginHint' import { useLoginHint } from '@/hooks/useLoginHint'
import { logout } from '@/features/auth/utils/logout' import { logout } from '@/features/auth/utils/logout'
import { useMemo } from 'react'
const Logo = () => ( const Logo = () => (
<img <img
@@ -84,6 +85,16 @@ const LoginHint = () => {
) )
} }
const HIDE_LOGIN_PARAM = 'hideLogin'
const isLoginButtonHidden = () => {
if (typeof window === 'undefined') return false
const value = new URLSearchParams(window.location.search).get(
HIDE_LOGIN_PARAM
)
return value === 'true'
}
export const Header = () => { export const Header = () => {
const { t } = useTranslation() const { t } = useTranslation()
const isHome = useMatchesRoute('home') const isHome = useMatchesRoute('home')
@@ -92,6 +103,9 @@ export const Header = () => {
const isTermsOfService = useMatchesRoute('termsOfService') const isTermsOfService = useMatchesRoute('termsOfService')
const isRoom = useMatchesRoute('room') const isRoom = useMatchesRoute('room')
const { user, isLoggedIn } = useUser() const { user, isLoggedIn } = useUser()
const loginButtonDisabledByUrl = useMemo(() => isLoginButtonHidden(), [])
const userLabel = user?.full_name || user?.email const userLabel = user?.full_name || user?.email
const loggedInTooltip = t('loggedInUserTooltip') const loggedInTooltip = t('loggedInUserTooltip')
const loggedInAriaLabel = userLabel const loggedInAriaLabel = userLabel
@@ -152,7 +166,8 @@ export const Header = () => {
!isHome && !isHome &&
!isLegalTerms && !isLegalTerms &&
!isAccessibility && !isAccessibility &&
!isTermsOfService && ( !isTermsOfService &&
!loginButtonDisabledByUrl && (
<> <>
<LoginButton proConnectHint={false} /> <LoginButton proConnectHint={false} />
<LoginHint /> <LoginHint />
@@ -14,6 +14,10 @@
"auto": "Du hast begonnen zu sprechen deine Hand wird daher automatisch gesenkt.", "auto": "Du hast begonnen zu sprechen deine Hand wird daher automatisch gesenkt.",
"dismiss": "Hand oben lassen" "dismiss": "Hand oben lassen"
}, },
"autoMuteLargeRoom": {
"auto": "Sie haben an einer großen Besprechung teilgenommen. Ihr Mikrofon wurde automatisch stummgeschaltet.",
"dismiss": "Stummschaltung aufheben"
},
"reaction": { "reaction": {
"description": "{{name}} hat mit {{emoji}} reagiert" "description": "{{name}} hat mit {{emoji}} reagiert"
}, },

Some files were not shown because too many files have changed in this diff Show More