[GH-3074] Fix issues with media permissions on Linux and Jitsi Meet in embedded mode on all platforms - #3331
[GH-3074] Fix issues with media permissions on Linux and Jitsi Meet in embedded mode on all platforms#3331j0794 wants to merge 1 commit into
Conversation
… mode on all platforms
|
Hello @j0794, Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here. Per the Mattermost Contribution Guide, we need to add you to the list of approved contributors for the Mattermost project. Please help complete the Mattermost contribution license agreement? This is a standard procedure for many open source projects. Please let us know if you have any questions. We are very happy to have you join our growing community! If you're not yet a member, please consider joining our Contributors community channel to meet other contributors and discuss new opportunities with the core team. |
devinbinnie
left a comment
There was a problem hiding this comment.
Code looks okay to me, will defer to @enzowritescode for security review.
Thanks @j0794!
|
@j0794 can you break out the The other code allows for any subdomain to be arbitrarily trusted. In MM-60965 I outlined the security requirements to ensure there wouldn't be any issues with subdomain takeovers. The security requirements that I outlined will definitely take some work, but we don't want to sacrifice on security here. |
| return true; | ||
| } | ||
|
|
||
| const preparsedURL = parseURL(url); |
There was a problem hiding this comment.
Does not meet ticket requirements
|
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
|
@j0794 Do you still intend to finish this up? |
|
Hello! Please, when will be fix ready? 🥹 |
Mattermost Desktop: embedded Jitsi media configurationThis configuration allows the embedded Jitsi instance to reuse camera and microphone permissions granted to the corresponding Mattermost server. Upstream implementation:
Requirements:
Origins must be exact and must not contain a trailing slash, URL path, query parameters, or fragments. macOSCreate the managed preferences file: Use the following contents: <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>TrustedEmbeddedMediaOrigins</key>
<array>
<dict>
<key>serverOrigin</key>
<string>https://mattermost-hostname</string>
<key>embeddedOrigin</key>
<string>https://jitsi-hostname</string>
</dict>
</array>
</dict>
</plist>Install the file and set its ownership and permissions: sudo mkdir -p "/Library/Managed Preferences"
sudo cp Mattermost.Desktop.plist \
"/Library/Managed Preferences/Mattermost.Desktop.plist"
sudo chown root:wheel \
"/Library/Managed Preferences/Mattermost.Desktop.plist"
sudo chmod 644 \
"/Library/Managed Preferences/Mattermost.Desktop.plist"
plutil -lint \
"/Library/Managed Preferences/Mattermost.Desktop.plist"Verify that macOS can read the policy: defaults read \
"/Library/Managed Preferences/Mattermost.Desktop" \
TrustedEmbeddedMediaOriginsFor managed fleets, distribute the same setting through MDM as a managed preference for Mattermost Desktop. After installing or changing the policy, fully quit Mattermost with Also verify that Mattermost is allowed under: Windows: RegistryRun Command Prompt or PowerShell as Administrator: reg add "HKLM\SOFTWARE\Policies\Mattermost\TrustedEmbeddedMediaOrigins" /f
reg add "HKLM\SOFTWARE\Policies\Mattermost\TrustedEmbeddedMediaOrigins" /v "some-jitsii" /t REG_SZ /d "{\"serverOrigin\":\"https://mattermost-hostname\",\"embeddedOrigin\":\"https://jitsi-hostname\"}" /fThe resulting registry entry must be: The value name, such as Verify the policy: reg query "HKLM\SOFTWARE\Policies\Mattermost\TrustedEmbeddedMediaOrigins"If machine-wide administrative access is unavailable, Mattermost also reads the equivalent per-user location: reg add "HKCU\SOFTWARE\Policies\Mattermost\TrustedEmbeddedMediaOrigins" /v "some-jitsi" /t REG_SZ /d "{\"serverOrigin\":\"https://mattermost-hostname\",\"embeddedOrigin\":\"https://jitsi-hostname\"}" /fAfter installing or changing the policy, completely exit Mattermost from the system tray and start it again. Windows: Group PolicyFor domain deployment:
{"serverOrigin":"https://mattermost-hostname","embeddedOrigin":"https://jitsi-hostname"}Apply the policy: gpupdate /forceThen completely exit and restart Mattermost Desktop. Validation
If curl -I https://mattermost-hostname/external_api.js
curl -I https://jitsi-hostname/plugins/jitsi/jitsi_meet_external_api.jsBoth requests should return HTTP 200 with a JavaScript content type. The TLS certificate on |
Summary
systemPreferences.getMediaAccessStatus, which is only implemented on Windows and macOS (https://www.electronjs.org/docs/latest/api/system-preferences#systempreferencesgetmediaaccessstatusmediatype-windows-macos)mattermost.example.comwill also propagate to Jitsi Meetjitsi.example.comin embedded mode, or any other service with the address*.example.comTicket Link
Fixes #3074
https://mattermost.atlassian.net/browse/MM-60965
Checklist
npm run lint:jsfor proper code formattingRun Desktop E2E TestsDevice Information
This PR was tested on: Ubuntu 22.04
Release Note