Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add jitsi config #12097

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions synapse/config/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,29 @@ def read_config(self, config, **kwargs):
"public_baseurl cannot contain query parameters or a #-fragment"
)

# Jitsi config - retrieve the jitsi server configuraiton - you can specify your own custom jit.si server
jitsi_url = config.get("jitsi_url")
if jitsi_url is None:
jitsi_url = f""
logger.info("Using default jitsi_url %s", jitsi_url)
else:
self.serve_client_wellknown = True
if jitsi_url[-1] != "/":
jitsi_url += "/"
self.jitsi_url = jitsi_url

# check that jitsi_url is valid. Only checking for the domain name
try:
splits = urllib.parse.urlsplit(self.jitsi_url)
except Exception as e:
raise ConfigError(f"Unable to parse URL: {e}", ("jitsi_url",))

if splits.query or splits.fragment:
raise ConfigError(
"jitsi_url cannot contain query parameters or a #-fragment"
)


# Whether to enable user presence.
presence_config = config.get("presence") or {}
self.use_presence = presence_config.get("enabled")
Expand Down Expand Up @@ -811,6 +834,10 @@ def generate_config_section(
#
#public_baseurl: https://example.com/

# Jitsi config - uncomment and specify the custom jitsi domain. Do not include http or https string
# port numbers can be speficied, if needed
#jitsi_url: myjitsi.domain:9090

# Uncomment the following to tell other servers to send federation traffic on
# port 443.
#
Expand Down
6 changes: 6 additions & 0 deletions synapse/rest/well_known.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ def get_well_known(self) -> Optional[JsonDict]:

result = {"m.homeserver": {"base_url": self._config.server.public_baseurl}}

# Jitsi config - Add the json entry for the jitsi_url so that it will be reflected in the /.well-known/matix/client
if self._config.server.jitsi_url:
result["im.vector.riot.jitsi"] = {
"preferredDomain": self._config.server.jitsi_url
}

if self._config.registration.default_identity_server:
result["m.identity_server"] = {
"base_url": self._config.registration.default_identity_server
Expand Down