diff --git a/README.md b/README.md index ddd417e..1ddeb64 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,12 @@ You need to install Node.js (`>= 20.0.0`, prefer using an LTS version) and run After checkout, run `yarn install` to download the required dependencies -> **Warning** Do not use `npm install` when working with this package. +> [!WARNING] +> Do not use `npm install` when working with this package. ### Available Scripts -In the project directory, you can run: +In the project root directory, you can run: - `yarn build`: Build the production version of the modules. - `yarn test`: Watch all files for changes and run tests. diff --git a/e2e/README.md b/e2e/README.md index 199430d..df26842 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -10,16 +10,17 @@ Running the e2e tests requires Docker or Podman to be installed. If using Podman be sure to [set up the `DOCKER_HOST` environment variable](https://node.testcontainers.org/supported-container-runtimes/). +Run `yarn playwright install` or similar to install playwright and download the browser engines. + ### Running Tests -The e2e tests are testing the guest module for Element and for Synapse. +The e2e tests are testing the modules for Element and guest module for Synapse. Make sure to always run `yarn e2e:build` in the root folder before initially running the tests or after changing a component. 1. **Synapse Module**: By default, it uses the image that was built by running `yarn docker:build` in the root folder of this repository. Building the container at least once is required to run the tests. Alternatively, you can set the `MODULE_CONTAINER_IMAGE` environment variable to use a custom container image for the Synapse Guest Module. -2. **Element Module**: It uses the module that is packaged by `yarn build`. - Only run this if there are actual changes in the module to not +2. **Element Modules**: It uses the modules that are packaged by `yarn build`, which is automatically called by `yarn e2e:build`. Afterwards you can run `yarn e2e` to perform the tests. @@ -31,9 +32,12 @@ If you encounter this message, make sure to install the Browsers via `npx playwr ### Available Scripts -In the project directory, you can run: +In the repository root directory, you can run: - `yarn build`: Run all required build steps for the e2e tests to run. -- `yarn lint`: Run eslint on the tests. + +In the repository root or the e2e project directory, you can run: + +- `yarn lint`: Run eslint, scoped to everything or just the tests respectively. - `yarn depcheck`: Check for missing or unused dependencies. - `yarn e2e`: Runs the end-to-end tests in a single browser. Pass `--debug` to enable the debug UI. Pass `--ui` to enable the Playwright UI Mode. diff --git a/e2e/src/deploy/elementWeb/Dockerfile b/e2e/src/deploy/elementWeb/Dockerfile index 6a4bb5c..d7391d6 100644 --- a/e2e/src/deploy/elementWeb/Dockerfile +++ b/e2e/src/deploy/elementWeb/Dockerfile @@ -1,11 +1,11 @@ -FROM node:20-bullseye as builder +FROM node:20-bullseye AS builder -ARG ELEMENT_VERSION="v1.11.84" +ARG ELEMENT_VERSION="master" WORKDIR /src # Clone the release tag from element -RUN git clone --depth 1 --branch $ELEMENT_VERSION https://github.com/vector-im/element-web.git /src +RUN git clone --depth 1 --branch $ELEMENT_VERSION https://github.com/element-hq/element-web.git /src RUN yarn --network-timeout=200000 install diff --git a/e2e/src/deploy/elementWeb/build_config.yaml b/e2e/src/deploy/elementWeb/build_config.yaml index 681efd2..c31864c 100644 --- a/e2e/src/deploy/elementWeb/build_config.yaml +++ b/e2e/src/deploy/elementWeb/build_config.yaml @@ -3,3 +3,4 @@ modules: - 'file:nordeck-element-web-guest-module.tgz' - 'file:nordeck-element-web-opendesk-module.tgz' - 'file:nordeck-element-web-widget-lifecycle-module.tgz' + - 'file:nordeck-element-web-widget-toggles-module.tgz' diff --git a/e2e/src/deploy/elementWeb/config.json b/e2e/src/deploy/elementWeb/config.json index 56b4f5f..e623d69 100644 --- a/e2e/src/deploy/elementWeb/config.json +++ b/e2e/src/deploy/elementWeb/config.json @@ -75,5 +75,10 @@ ] } } + }, + "net.nordeck.element_web.module.widget_toggles": { + "config": { + "types": ["jitsi", "net.nordeck.*"] + } } } diff --git a/e2e/src/deploy/elementWeb/index.ts b/e2e/src/deploy/elementWeb/index.ts index 48d1b42..76433d7 100644 --- a/e2e/src/deploy/elementWeb/index.ts +++ b/e2e/src/deploy/elementWeb/index.ts @@ -22,7 +22,7 @@ let container: StartedTestContainer | undefined; export async function startElementWeb({ homeserverUrl, widgetServerUrl, - version = 'v1.11.84', + version = 'master', }: { homeserverUrl: string; widgetServerUrl: string; diff --git a/e2e/src/deploy/synapse/index.ts b/e2e/src/deploy/synapse/index.ts index 4cc5e69..2bf4734 100644 --- a/e2e/src/deploy/synapse/index.ts +++ b/e2e/src/deploy/synapse/index.ts @@ -27,7 +27,7 @@ function randB64Bytes(numBytes: number): string { } export async function startSynapse({ - containerImage = 'matrixdotorg/synapse:v1.90.0', + containerImage = 'matrixdotorg/synapse:latest', moduleContainerImage = 'nordeck/synapse-guest-module', }: { containerImage?: string; moduleContainerImage?: string } = {}): Promise<{ synapseUrl: string; diff --git a/packages/element-web-widget-lifecycle-module/README.md b/packages/element-web-widget-lifecycle-module/README.md index 966366b..4ba8838 100644 --- a/packages/element-web-widget-lifecycle-module/README.md +++ b/packages/element-web-widget-lifecycle-module/README.md @@ -28,7 +28,8 @@ But these security features can lower the usability especially in more integrate This module was initially created to pre-approve capabilities and permission requests from the widgets if they were added by [NeoDateFix](https://github.com/nordeck/matrix-meetings) so the users are not always asked for permission in every meeting room. It allows you to selectively skip the permission dialogs for widgets that you trust, while they still appear for widgets that were added by third parties. -> ⚠️ We recommend to only approve widgets that you deployed yourselves. These features should protect your users and you should only disable them for widgets that you trust! +> [!WARNING] +> We recommend to only approve widgets that you deployed yourselves. These features should protect your users and you should only disable them for widgets that you trust! ## Requirements diff --git a/packages/synapse-guest-module/README.md b/packages/synapse-guest-module/README.md index 3fb51aa..45f1808 100644 --- a/packages/synapse-guest-module/README.md +++ b/packages/synapse-guest-module/README.md @@ -64,7 +64,7 @@ The module is not published to a python registry, but we provide a docker contai # ... template: spec: -+ # The init container copies the module to he `synapse-modules` volume ++ # The init container copies the module to the `synapse-modules` volume + initContainers: + - image: ghcr.io/nordeck/synapse-guest-module: + name: install-guest-module @@ -91,3 +91,8 @@ The module is not published to a python registry, but we provide a docker contai + name: synapse-modules # ... ``` + +## Ingress/TLS proxy configuration + +The module exposes a new REST API POST endpoint at `/_synapse/client/register_guest`. +Any Ingress or other proxying software used must therefore forward this path to synapse.