-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Enable end-to-end encryption for WebRTC streams. #14005
Conversation
4cb4f69
to
dc73c4f
Compare
Signed-off-by: Joachim Bauch <[email protected]>
src/utils/e2ee/olm.js
Outdated
locateFile: () => { | ||
return generateFilePath('spreed', 'js', wasmFile.split('/').pop()) | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasmFile
is already a link to the file. Why is link generation needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was needed to get the correct URL for the case where the Talk app is not below apps
but custom_apps
. The import returned something like /apps/spreed/js/olm.wasm?v=aab9861f32e2f862a9ba
which then resulted in a 404 error. Generating the path manually fixed it for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current solution doesn't work with Talk Desktop and it will break if bundling config slightly change (there is no guarantee that the file will be in the js
folder root with the same filename)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something similar was done here:
Line 79 in 1d0ce77
const filePath = generateFilePath('spreed', 'img', fileName + fileExtension) |
I figured it would be ok to load the wasm similarly, but happy to do it differently if you give me a hint how ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With image generateFilePath
generates a path to public file spreed/img
.
So it transforms spreed/img/{filename}
to {path}/spreed/img/{filename}
which is always valid for server and covered by Talk Desktop.
But generateFilePath('spreed', 'js', wasmFile)
generates a path to spreed/js/{generatedFilename}
for a generated path after import.
So it transforms some generated by bundler URL from spreed/node_modules/ @matrix-org/olm/olm.wasm
to {path}/spreed/js/{generatedFilename}
.
It only works if this .wasm
files are bundler to /js
root with the same filename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also work without breaking Talk Desktop (but also relies on assets bundling config).
locateFile: () => {
return wasmFile.split('/').pop()
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
locateFile: () => { return wasmFile.split('/').pop() },
This tries to load the file from "https://myserver/call/olm.wasm?v=aab9861f32e2f862a9ba" (which doesn't work).
4a45b79
to
9b2b329
Compare
Signed-off-by: Joachim Bauch <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
9b2b329
to
6a540ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a rough look and it works (and doesnt with a not reloaded tab/desktop client), so merging for now to be able to test this.
ποΈ UI Checklist
π§ Tasks
π Checklist
π οΈ API Checklist
π§ Tasks
π Checklist
docs/
has been updated or is not required