Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Merged
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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 9 additions & 5 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
6 changes: 3 additions & 3 deletions e2e/src/deploy/elementWeb/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions e2e/src/deploy/elementWeb/build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
5 changes: 5 additions & 0 deletions e2e/src/deploy/elementWeb/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,10 @@
]
}
}
},
"net.nordeck.element_web.module.widget_toggles": {
"config": {
"types": ["jitsi", "net.nordeck.*"]
}
}
}
2 changes: 1 addition & 1 deletion e2e/src/deploy/elementWeb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let container: StartedTestContainer | undefined;
export async function startElementWeb({
homeserverUrl,
widgetServerUrl,
version = 'v1.11.84',
version = 'master',
}: {
homeserverUrl: string;
widgetServerUrl: string;
Expand Down
2 changes: 1 addition & 1 deletion e2e/src/deploy/synapse/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion packages/element-web-widget-lifecycle-module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion packages/synapse-guest-module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<version>
+ name: install-guest-module
Expand All @@ -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.