feat: WIP element Chat intergration

This commit is contained in:
Nathnael
2026-07-31 06:36:03 +00:00
parent a2c30a3c96
commit 00bd1250ee
31 changed files with 1128 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
# syntax=docker/dockerfile:1
#
# EDR internal chat web client. Unmodified upstream Element Web + our public,
# non-secret config (homeserver URL, branding) and the SSO handoff page.
# Pin the tag; never float on `latest`.
FROM ghcr.io/element-hq/element-web:v1.11.108
COPY config.json /app/config.json
COPY sso.html /app/sso.html

View File

@@ -0,0 +1,17 @@
{
"default_server_config": {
"m.homeserver": {
"base_url": "https://matrix.edr.et",
"server_name": "matrix.edr.et"
}
},
"brand": "EDR Chat",
"permalink_prefix": "https://chat.edr.et",
"disable_guests": true,
"disable_3pid_login": true,
"disable_custom_urls": true,
"default_theme": "light",
"settingDefaults": {
"UIFeature.registration": false
}
}

View File

@@ -0,0 +1,36 @@
<!doctype html>
<!--
Element only honours a `?loginToken=` on `/` if `mx_sso_hs_url` is already
in localStorage (element-web apps/web/src/Lifecycle.ts attemptTokenLogin,
key defined in apps/web/src/BasePlatform.ts). Normally that key is written
by Element itself at the start of an SSO redirect; freight-api's SSO
handoff skips that redirect (it already knows the homeserver), so this
page seeds the key by hand and forwards straight to the login-token URL.
freight-api's chat-sso.service.ts links here as
https://chat.edr.et/sso.html?t=<login_token>&hs=<homeserver base_url>.
`hs` is passed rather than hardcoded so this file doesn't need to change if
MATRIX_PUBLIC_BASEURL ever does.
-->
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Signing in to EDR Chat…</title>
</head>
<body>
<script>
var params = new URLSearchParams(window.location.search);
var token = params.get("t");
var homeserver = params.get("hs");
if (token && homeserver) {
localStorage.setItem("mx_sso_hs_url", homeserver);
window.location.replace(
"/?loginToken=" + encodeURIComponent(token),
);
} else {
document.body.textContent =
"Missing sign-in token. Go back to the EDR backoffice and click Chat again.";
}
</script>
</body>
</html>