element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
Apache License 2.0
10.88k stars 1.92k forks source link

jitsi widget uses jitsi.riot.im when clicking the videocall button instead of jitsi preferred domain (element web) #20021

Closed janonym1 closed 2 years ago

janonym1 commented 2 years ago

Steps to reproduce

Setup: I am using the excellent playbook made by Slavi and have my element/dimension jitsi widgets pointed to my own jitsi-domain with the following settings: element config.json:

jitsi": {
      "preferredDomain": "jitsi.domain.com",
      "externalApiUrl": "https://jitsi.domain.com/libs/external_api.min.js"
    }

I additionally have added the following to my /.well-known/matrix/client:

"im.vector.riot.jitsi": {
       "preferredDomain": "jitsi.domain.com"
    }

I also set the "Jitsi Widget Configuration" within the dimension-web-admin-GUI to:

Jitsi Domain: jitsi.domain.com
Use this domain as the default conference domain: yes
Jitsi Script URL : https://jitsi.domain.com/libs/external_api.min.js

When I manually add a jitsi widget with the sidebar (roominfo -> Edit widgets, bridges & bots -> Jitsi Conference Add) the widget correctly uses my jitsi.domain.com, for example: https://jitsi.domain.com/HomicidalArchScarab.

However, when I click the audio- or videocall button in rooms with more than 2 users, a Jitsi Widget get created that uses riot.im instead of my own jitsi domain, for example: https://jitsi.riot.im/JitsiTtjbowujwtnbcvpjmcjhpidt

This happens to all of the tested browsers (Firefox, Edge, Chrome, Chromium) on Linux and Windows. Did I maybe forget a setting or config somewhere? I also tried it with setting the config.json and /well-known separately but to no avail.

I can send verbose logs if wanted, but I couldnt see anything catchy or out of the ordinary in the console logs or my matrix-dimension and matrix-client-element services.

Outcome

What did you expect?

the audio/videocall button in rooms with more than 2 users using my own jitsi-domain when creating the widget

What happened instead?

the created widget uses jitsi.riot.im instead of my jitsi.domain.com, regardless of my configs

Operating system

Windows, Linux

Browser information

Firefox, Chrome, Chromium, Vivaldi

URL for webapp

chat.domain.com

Application version

element version 1.9.5

Homeserver

matrix.domain.com

Will you send logs?

Yes

Edit: i just discovered the closed issue: https://github.com/vector-im/element-web/issues/19864 I will need to remove add_header Content-Security-Policy "frame-ancestors 'none'"; from my nginx conf to be able to use my own jitsi domain when using the videocall button. I am going to test this out asap

Edit2: unfortunately, the above line does not work in my case. I can still not use my own jitsi-domain in element web when using the videocall button

t3chguy commented 2 years ago

I added

"jitsi": {
        "preferredDomain": "jitsi.domain.com"
    }

And now the video call button uses this (non-functional) domain.

image image

Without access to your specific instance it is difficult to debug further.

janonym1 commented 2 years ago

I removed the well-known setting and just tried the config.json like above and intentionally set it to the non-functional domain jitsi.domain.com. As of now, it still points to jits.riot.im but when using the call button but I know that default_call behaviour is taking some time to change the settings because of some caching. Restartin the client didnt help for now, I will test out different setups.

Do you have some lines added to you well-knowns or did you just change the config.json jitsi.preferredDomain?

t3chguy commented 2 years ago

I'm using a matrix.org test account so nothing in well-known but I have verified that codepath since it was last changed. In the above test I only modified config.json.

janonym1 commented 2 years ago

Okay, so maybe I misunderstood or overlooked something obvious here =D

Since even a "misconfigured" jitsi.domain.com seemingly did not point my widget to the configured domain, I thought I should look deeper into my old settings/configs. I dont know if a kind of "failover" exists but even with a non existing domain it still created the widgets and I still could use the jitsi-widget "normally" but it used riot.jitsi.im

I then reverted to my old setup (as described above) with all the preferredDomains configured in the /.well-known/matrix/client and the config.json. (I also pointed the TURN/STUN server to our own on matrix-synapse and our jitsi setup, but I dont think that changed the outcome).

When I accessed my standalone jitsi-web on jitsi.domain.com (an existing domain this time), I noticed that there were some weird room-names created: something like JitsiDotvsynczgytyofmjpxgjrsx

I looked inside my the jitsi integration manager (where all the existing widgets get listed) and saw, that the "Conference URL" defined there was https://jitsi.riot.im/JitsiDotvsynczgytyofmjpxgjrsx, which had the same suffix/Name as in my jitsi setup!

At this point I looked at my consolse- and network-logs for the browser again, and its uses only my jitsi.domain.com, so it seems to be working correctly! In my last debugging session, I only looked at the Conference URL created inside the integration manager (and not the developer logs itself) and concluded, that no matter what I did, the preferredDomain does not get accepted. However, it just shows as https://jitsi.riot.im/JitsiDotvsynczgytyofmjpxgjrsx inside the integration manager but uses my own jitsi.domain.com correctly (as shown in the console logs)

Maybe I misconfigured something on my first try and it automatically used the jitsi.riot.im as fail-over, because I didn't see a connection to my jitsi.domain.com in the beginning inside the browser logs. However, my own laziness, not to always look at the developer-tools log after a change to my config and only looking inside the integration manager for confirmation was my downfall, so this is clearly my fault!

I still find it confusing though, that the integration manager still shows the link as jitsi.riot.im like https://jitsi.riot.im/JitsiDotvsynczgytyofmjpxgjrsx instead of the correct https://jitsi.domain.com/JitsiDotvsynczgytyofmjpxgjrsx. I assume this is some hardcoded stuff?

Anyways, thanks for the help and sorry for wasting time!

t3chguy commented 2 years ago

I still find it confusing though, that the integration manager still shows the link as jitsi.riot.im like jitsi.riot.im/JitsiDotvsynczgytyofmjpxgjrsx instead of the correct jitsi.domain.com/JitsiDotvsynczgytyofmjpxgjrsx. I assume this is some hardcoded stuff?

Can you share what this looks like out of interest?

janonym1 commented 2 years ago

sure thing! I just did some quick and dirty screenshots + paint. The first screen is what I see in my dimension integration manager, when I click on jitsi widgets and it lists all existing widgets in a matrix room.

The latter is my jitsi meet web, where all my created jitsi sessions also gets listed. In this case, the conferenceURL is https://jitsi.domain.com/JitsiGqztarepcdtfknewmmslhike, which is the same but with a different domain prefix

jits_url_riot_encoding :

t3chguy commented 2 years ago

Interesting, wonder how Dimension manages to scuff that up

janonym1 commented 2 years ago

according to https://github.com/turt2live/matrix-dimension/issues/231 "We default to jitsi.riot.im in cases where the widget was created without a domain to maintain compatibility with Scalar. We should have an option to explicitly change this." So I assume this is an hardcoded fallback option or something similar