Merge branch 'vector-im:develop' into develop

pull/26786/head
Ivaylo Badinov 2023-11-23 19:15:26 +02:00 committed by GitHub
commit eabe5a18d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 11430 additions and 11717 deletions

1
.github/CODEOWNERS vendored
View File

@ -2,3 +2,4 @@
/.github/workflows/** @vector-im/element-web-app-team
/package.json @vector-im/element-web-app-team
/yarn.lock @vector-im/element-web-app-team
/src/i18n/strings

263
.github/labels.yml vendored Normal file
View File

@ -0,0 +1,263 @@
- name: "A-Aliases"
color: "bfd4f2"
- name: "A-Authentication"
color: "bfd4f2"
- name: "A-Autocomplete"
color: "bfd4f2"
- name: "A-Breadcrumbs"
color: "bfd4f2"
- name: "A-Bridge"
color: "bfd4f2"
- name: "A-Broadcast"
description: "Broadcast-style voice messages"
color: "bfd4f2"
- name: "A-Create-Room"
description: "Create room flow, user suggestions, etc."
color: "bfd4f2"
- name: "A-DevTools"
description: "/devtools, show hidden events, etc."
color: "bfd4f2"
- name: "A-Dialogs"
color: "bfd4f2"
- name: "A-Disambiguation"
color: "bfd4f2"
- name: "A-DM-Start"
description: "Creating a DM with another user"
color: "bfd4f2"
- name: "A-E2EE-Dehydration"
color: "8CC59A"
- name: "A-Electron"
color: "bfd4f2"
- name: "A-Element-Call"
description: "Group calls via Element Call"
color: "bfd4f2"
- name: "A-Element-R"
description: "Issues affecting the port of Element's crypto layer to Rust"
color: "bfd4f2"
- name: "A-ELS"
description: "Event List Summary (and Membership ELS, MELS)"
color: "bfd4f2"
- name: "A-Emotes"
color: "bfd4f2"
- name: "A-EMS"
description: "Issues related to EMS"
color: "bfd4f2"
- name: "A-Error-Message"
color: "bfd4f2"
- name: "A-Federation"
color: "bfd4f2"
- name: "A-Feedback-Reporting"
description: "Reporting process for bugs, debug logs (rageshakes), suggestions"
color: "bfd4f2"
- name: "A-File-Download"
color: "bfd4f2"
- name: "A-File-Panel"
color: "bfd4f2"
- name: "A-Identity-Server"
color: "bfd4f2"
- name: "A-Indexing"
description: "Indexing messages via Seshat"
color: "bfd4f2"
- name: "A-IRC-Layout"
color: "bfd4f2"
- name: "A-Jump-To-Date"
description: "Jump to date headers or slash command"
color: "bfd4f2"
- name: "A-Lazy-Loading"
color: "bfd4f2"
- name: "A-Light-Box"
description: "UI when viewing an image"
color: "bfd4f2"
- name: "A-Location-Sharing"
color: "bfd4f2"
- name: "A-Logout"
description: "Logout, sign out, etc."
color: "bfd4f2"
- name: "A-Maths"
description: "Render LaTeX maths in messages"
color: "bfd4f2"
- name: "A-Memory"
description: "Memory leaks, leak hunting tools"
color: "bfd4f2"
- name: "A-Message-Forwarding"
color: "bfd4f2"
- name: "A-Message-Pinning"
color: "bfd4f2"
- name: "A-Message-Previews"
color: "bfd4f2"
- name: "A-Message-Starring"
description: "Saving favourite messages for later"
color: "bfd4f2"
- name: "A-Modules"
description: "Module system related"
color: "bfd4f2"
- name: "A-New-Search-Experience"
description: "The new search dialog available in Labs"
color: "bfd4f2"
- name: "A-Packaging"
description: "Packaging, signing, releasing"
color: "bfd4f2"
- name: "A-Peeking"
color: "bfd4f2"
- name: "A-Picture-in-Picture"
color: "bfd4f2"
- name: "A-Power-Levels"
description: "The permissions that users have in rooms and spaces"
color: "bfd4f2"
- name: "A-Replies"
description: "reply"
color: "bfd4f2"
- name: "A-Session-Mgmt"
description: "Session / device names, management UI, etc."
color: "bfd4f2"
- name: "A-Share"
color: "bfd4f2"
- name: "A-Shortcuts"
description: "Keyboard shortcuts"
color: "bfd4f2"
- name: "A-Sliding-Sync"
description: "Also known as Sync v3 - https://github.com/matrix-org/sliding-sync"
color: "bfd4f2"
- name: "A-Soft-Logout"
description: "https://github.com/vector-im/element-web/issues/10224"
color: "bfd4f2"
- name: "A-Spaces-Settings"
color: "bfd4f2"
- name: "A-SSO"
color: "bfd4f2"
- name: "A-Status-Bar"
description: "Unsent messages warning and 'Connectivity to the server has been lost'"
color: "bfd4f2"
- name: "A-Storage"
description: "Storage layer of the app, including IndexedDB, local storage, etc."
color: "bfd4f2"
- name: "A-Technical-Debt"
color: "bfd4f2"
- name: "A-Testing"
description: "Testing, code coverage, etc."
color: "bfd4f2"
- name: "A-Themes-Custom"
description: "Custom theme variables or support"
color: "bfd4f2"
- name: "A-Themes-Official"
description: "Official themes (light, dark)"
color: "bfd4f2"
- name: "A-Theming"
color: "bfd4f2"
- name: "A-Timeline-Jumpy-Scroll"
description: "Stable timeline dream ✨"
color: "bfd4f2"
- name: "A-Timesheet-1"
description: "Log any time spent on this into the A-Timesheet-1 project"
color: "5319E7"
- name: "A-Toast"
color: "bfd4f2"
- name: "A-Tooltips"
description: "Anything related to tooltips"
color: "bfd4f2"
- name: "A-UI-Customisation"
description: "UIFeatures etc. for customising entire parts of the UI"
color: "bfd4f2"
- name: "A-URL-Previews"
color: "bfd4f2"
- name: "A-User-Menu"
description: "The top left main menu with the user's name and avatar"
color: "bfd4f2"
- name: "A-User-Search"
description: "The start DM or invite to room dialogs (things dealing with `/user_directory/search`)"
color: "bfd4f2"
- name: "A-Video-Rooms"
description: "Persistent group calls"
color: "bfd4f2"
- name: "A-Voice-Messages"
color: "bfd4f2"
- name: "A-Welcome-Page"
color: "bfd4f2"
- name: "backport staging"
description: "Label to automatically backport PR to staging branch"
color: "B60205"
- name: "Dependencies"
description: "Pull requests that update a dependency file"
color: "0366d6"
- name: "Epic"
description: "Issue is at Epic level"
color: "98e6ae"
- name: "Hacktoberfest"
description: "Issues which are suitable for Hacktoberfest PRs: https://hacktoberfest.digitalocean.com/"
color: "ff7518"
- name: "P4"
description: "[OBSOLETE LABEL] Interesting — Not yet scheduled, will accept patches"
color: "d1e5f0"
- name: "spam"
color: "B60205"
- name: "Sponsored"
color: "ffc8f4"
- name: "T-Deprecation"
description: "A pull request that makes something deprecated"
color: "98e6ae"
- name: "T-Other"
description: "Questions, user support, anything else"
color: "98e6ae"
- name: "Team: App"
color: "FFA500"
- name: "X-Blocked"
color: "ff7979"
- name: "X-Cannot-Reproduce"
color: "ff7979"
- name: "X-Command"
description: "Created using the !github command"
color: "ff7979"
- name: "X-Community-Supported-Platform"
description: "This issue occurs in a platform not directly supported by us, but by a community project elsewhere"
color: "ff7979"
- name: "X-Upcoming-Release-Blocker"
description: "This does not affect the current release cycle but will affect the next one"
color: "e99695"
- name: "Z-Actions"
color: "ededed"
- name: "Z-Cache-Confusion"
description: "Related to internal cache (clearing helps / causes the issue)"
color: "ededed"
- name: "Z-Community-PR"
description: "Issue is solved by a community member's PR"
color: "ededed"
- name: "Z-Element-R-Blocker"
description: "A blocker for enabling Element R by default"
color: "ededed"
- name: "Z-Experimental"
color: "ededed"
- name: "Z-Fixed by Element Call"
description: "Issues which can be closed when we move to Element Call"
color: "ededed"
- name: "Z-Flaky-Test"
description: "A test is raising false alarms"
color: "ededed"
- name: "Z-FOSDEM"
description: "Issues in chat.fosdem.org"
color: "ededed"
- name: "Z-Gitter"
description: "Issues relating to or coming out of the Gitter migration, feature parity, etc"
color: "ededed"
- name: "Z-Legacy-Crypto"
description: "Issues affecting the legacy crypto stack"
color: "EEEEEE"
- name: "Z-Maximised-Widgets"
color: "ededed"
- name: "Z-Papercuts"
description: "Visible. Impactful. Predictable to action."
color: "ededed"
- name: "Z-Power-Users"
color: "ededed"
- name: "Z-Rageshake"
description: "Has attached rageshake (not for log submission process)"
color: "ededed"
- name: "Z-RICE"
color: "ededed"
- name: "Z-Soft-Crash"
description: "React soft crash caught by an error boundary"
color: "ededed"
- name: "Z-Spec-Compliance"
description: "An area where Element doesn't correctly implement the spec"
color: "ededed"
- name: "Z-t3chguy"
color: "ededed"

3
.github/release-drafter.yml vendored Normal file
View File

@ -0,0 +1,3 @@
_extends: matrix-org/matrix-react-sdk
version-resolver:
default: patch

View File

@ -31,38 +31,48 @@ jobs:
- name: Prepare
run: |
mkdir -p /tmp/element-web-debian/DEBIAN
cp -R debian/ /tmp/element-web-debian/DEBIAN/
mkdir -p /tmp/element-web-debian/usr/share/element-web/
mkdir -p debian/tmp/DEBIAN
find debian -maxdepth 1 -type f -exec cp "{}" debian/tmp/DEBIAN/ \;
mkdir -p debian/tmp/usr/share/element-web/ debian/tmp/etc/element-web/
tar -xf "element-$VERSION.tar.gz" -C /tmp/element-web/debian/usr/share/element-web --strip-components=1
cp config.sample.json /tmp/element-web-debian/usr/share/element-web/config.json
tar -xf "element-$VERSION.tar.gz" -C debian/tmp/usr/share/element-web --strip-components=1 --no-same-owner --no-same-permissions
mv debian/tmp/usr/share/element-web/config.sample.json debian/tmp/etc/element-web/config.json
ln -s /etc/element-web/config.json debian/tmp/usr/share/element-web/config.json
- name: Write changelog
run: |
VERSION=$(cat package.json | jq -r .version)
TIME=$(date -d "$PUBLISHED_AT" -R)
{
echo "element-web ($VERSION) default; urgency=medium"
echo "$BODY" | sed 's/^##/\n */g;s/^\*/ */g' | perl -pe 's/\[.+?]\((.+?)\)/\1/g'
echo ""
echo " -- $ACTOR <support@element.io> $TIME"
} > debian/tmp/DEBIAN/changelog
env:
ACTOR: ${{ github.actor }}
VERSION: ${{ github.event.release.tag_name }}
BODY: ${{ github.event.release.body }}
PUBLISHED_AT: ${{ github.event.release.published_at }}
- name: Build deb package
run: |
VERSION=$(cat package.json | jq -r .version)
chmod -R u=rw,go=r /tmp/element-web-debian/usr/share/element-web/
dpkg-deb -Zxz --root-owner-group -VVersion=$VERSION --build /tmp/element-web-debian element-web.deb
dpkg-gencontrol -v"$VERSION" -ldebian/tmp/DEBIAN/changelog
dpkg-deb -Zxz --root-owner-group --build debian/tmp element-web.deb
# For now just upload the artifact to github
- uses: actions/upload-artifact@v3
with:
name: debs
path: "*.deb"
name: element-web.deb
path: element-web.deb
retention-days: 14
#- name: Upload incoming deb
# if: github.event.release.prerelease == false
# run: aws s3 cp element-web.deb "s3://$R2_INCOMING_BUCKET" --endpoint-url "$R2_URL" --region auto
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}
#reprepro:
# needs: build
# name: Run reprepro
# if: github.event.release.prerelease == false
# uses: ./.github/workflows/reprepro.yaml
# secrets: inherit
# with:
# incoming: element-web.deb
- name: Publish to packages.element.io
if: github.event.release.prerelease == false
uses: vector-im/packages.element.io@master
with:
file: element-web.deb
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
bucket-api: ${{ vars.CF_R2_S3_API }}
bucket-key-id: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
bucket-access-key: ${{ secrets.CF_R2_TOKEN }}

View File

@ -91,7 +91,7 @@ jobs:
running-workflow-name: "Build & Deploy develop.element.io"
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
check-regexp: ^((?!SonarCloud|SonarQube|issue|board|label).)*$
check-regexp: ^((?!SonarCloud|SonarQube|issue|board|label|Release).)*$
# We keep the latest develop.tar.gz on R2 instead of relying on the github artifact uploaded earlier
# as the expires after 24h and requires auth to download.

View File

@ -12,11 +12,24 @@ jobs:
name: Docker Buildx
runs-on: ubuntu-latest
environment: dockerhub
strategy:
fail-fast: false
matrix:
include:
- variant: vanilla
# Variant we ship to aid ESS in providing a build on the OpenCoDE platform including specific modules
- variant: opendesk
flavor: suffix=-opendesk,onlatest=true
prepare: mv variants/openDesk/* .
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for docker-package to be able to calculate the version
- name: Prepare
if: matrix.prepare
run: ${{ matrix.prepare }}
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3
@ -42,6 +55,7 @@ jobs:
type=ref,event=tag
flavor: |
latest=${{ contains(github.ref_name, '-rc.') && 'false' || 'auto' }}
${{ matrix.flavor }}
- name: Build and push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5
@ -53,6 +67,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
- name: Update repo description
if: matrix.variant == 'vanilla'
uses: peter-evans/dockerhub-description@dc67fad7001ef9e8e3c124cb7a64e16d0a63d864 # v3
continue-on-error: true
with:

View File

@ -9,7 +9,7 @@ jobs:
name: Tidy closed issues
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
id: main
with:
# PAT needed as the GITHUB_TOKEN won't be able to see cross-references from other orgs (matrix-org)
@ -141,7 +141,7 @@ jobs:
});
}
}
- uses: actions/github-script@v6
- uses: actions/github-script@v7
name: Close duplicate as Not Planned
if: steps.main.outputs.closeAsNotPlanned
with:

View File

@ -1,6 +1,8 @@
name: Localazy Download
on:
workflow_dispatch: {}
schedule:
- cron: "0 6 * * 1,3,5" # Every Monday, Wednesday and Friday at 6am UTC
jobs:
download:
uses: matrix-org/matrix-web-i18n/.github/workflows/localazy_download.yaml@main

View File

@ -13,7 +13,7 @@ jobs:
URL: "https://github.com/pulls?q=is%3Apr+is%3Aopen+repo%3Amatrix-org%2Fmatrix-js-sdk+repo%3Amatrix-org%2Fmatrix-react-sdk+repo%3Avector-im%2Felement-web+repo%3Avector-im%2Felement-desktop+review-requested%3A%40me+sort%3Aupdated-desc+"
RELEASE_BLOCKERS_URL: "https://github.com/pulls?q=is%3Aopen+repo%3Amatrix-org%2Fmatrix-js-sdk+repo%3Amatrix-org%2Fmatrix-react-sdk+repo%3Avector-im%2Felement-web+repo%3Avector-im%2Felement-desktop+sort%3Aupdated-desc+label%3AX-Release-Blocker+"
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
env:
HS_URL: ${{ secrets.BETABOT_HS_URL }}
ROOM_ID: ${{ secrets.ROOM_ID }}

21
.github/workflows/release-drafter.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Release Drafter
on:
push:
branches: [staging]
workflow_dispatch:
inputs:
previous-version:
description: What release to use as a base for release note purposes
required: false
type: string
concurrency: ${{ github.workflow }}
jobs:
draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@e64b19c4c46173209ed9f2e5a2f4ca7de89a0e86 # v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
disable-autolabeler: true
previous-version: ${{ inputs.previous-version }}

15
.github/workflows/release-gitflow.yml vendored Normal file
View File

@ -0,0 +1,15 @@
# Gitflow merge-back master->develop
name: Merge master -> develop
on:
push:
branches: [master]
concurrency: ${{ github.repository }}-${{ github.workflow }}
jobs:
merge:
uses: matrix-org/matrix-js-sdk/.github/workflows/release-gitflow.yml@develop
secrets:
ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
with:
dependencies: |
matrix-react-sdk
matrix-js-sdk

39
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Release Process
on:
workflow_dispatch:
inputs:
mode:
description: What type of release
required: true
default: rc
type: choice
options:
- rc
- final
matrix-react-sdk:
description: React SDK version to use (current|X.Y.Z)
required: false
default: current
type: string
matrix-js-sdk:
description: JS SDK version to use (current|X.Y.Z)
required: false
default: current
type: string
concurrency: ${{ github.workflow }}
jobs:
release:
uses: matrix-org/matrix-js-sdk/.github/workflows/release-action.yml@develop
secrets:
ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
with:
final: ${{ inputs.mode == 'final' }}
include-changes: matrix-react-sdk
gpg-fingerprint: ${{ vars.GPG_FINGERPRINT }}
asset-path: dist/*.tar.gz
expected-asset-count: 3
dependencies: |
matrix-react-sdk=${{ inputs.matrix-react-sdk }}
matrix-js-sdk=${{ inputs.matrix-js-sdk }}

View File

@ -64,6 +64,23 @@ jobs:
- name: Run Linter
run: "yarn run lint:style"
workflow_lint:
name: "Workflow Lint"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: "yarn"
# Does not need branch matching as only analyses this layer
- name: Install Deps
run: "yarn install --frozen-lockfile"
- name: Run Linter
run: "yarn lint:workflows"
analyse_dead_code:
name: "Analyse Dead Code"
runs-on: ubuntu-latest

16
.github/workflows/sync-labels.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: Sync labels
on:
workflow_dispatch: {}
push:
branches:
- develop
paths:
- .github/labels.yml
jobs:
sync-labels:
uses: vector-im/element-meta/.github/workflows/sync-labels.yml@develop
with:
LABELS: |
.github/labels.yml
secrets:
ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}

View File

@ -3,6 +3,10 @@ name: Move labelled issues to correct projects
on:
issues:
types: [labeled]
workflow_call:
secrets:
ELEMENT_BOT_TOKEN:
required: true
jobs:
apply_Z-Labs_label:
@ -23,7 +27,7 @@ jobs:
contains(github.event.issue.labels.*.name, 'A-Element-Call') ||
contains(github.event.issue.labels.*.name, 'A-Element-R')
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
@ -40,7 +44,7 @@ jobs:
contains(github.event.issue.labels.*.name, 'good first issue') ||
contains(github.event.issue.labels.*.name, 'Hacktoberfest')
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({

View File

@ -60,7 +60,7 @@ jobs:
contains(github.event.issue.labels.*.name, 'A-Element-Call')) &&
contains(github.event.issue.labels.*.name, 'Z-Labs')
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
script: |
github.rest.issues.removeLabel({

31
.github/workflows/update-jitsi.yml vendored Normal file
View File

@ -0,0 +1,31 @@
# Re-fetches the Jitsi SDK and opens a PR to update it if it's different from what's in the repository
name: Update Jitsi
on:
workflow_dispatch: {}
schedule:
- cron: "0 3 * * 0" # 3am every Sunday
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: "yarn"
- name: Install Deps
run: "yarn install --frozen-lockfile"
- name: Fetch Jitsi
run: "yarn update:jitsi"
- name: Create Pull Request
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5
with:
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
branch: actions/jitsi-update
delete-branch: true
title: Jitsi Update
labels: |
T-Task

View File

@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
environment: Matrix
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
env:
HS_URL: ${{ secrets.BETABOT_HS_URL }}
LOBBY_ROOM_ID: ${{ secrets.ROOM_ID }}

View File

@ -23,6 +23,11 @@ electron/pub
src/vector/index.html
src/vector/modernizr.js
/docs/lib
/book
/debian/tmp
# This file is owned, parsed, and generated by allchange, which doesn't comply with prettier
/CHANGELOG.md
# Downloaded and already minified
res/jitsi_external_api.min.js

17684
CHANGELOG.md

File diff suppressed because it is too large Load Diff

View File

@ -41,29 +41,9 @@ The easiest way to test Element is to just use the hosted copy at <https://app.e
The `develop` branch is continuously deployed to <https://develop.element.io>
for those who like living dangerously.
To host your own copy of Element, the quickest bet is to use a pre-built
released version of Element:
To host your own instance of Element see [Installing Element Web](docs/install.md).
1. Download the latest version from <https://github.com/vector-im/element-web/releases>
1. Untar the tarball on your web server
1. Move (or symlink) the `element-x.x.x` directory to an appropriate name
1. Configure the correct caching headers in your webserver (see below)
1. Configure the app by copying `config.sample.json` to `config.json` and
modifying it. See the [configuration docs](docs/config.md) for details.
1. Enter the URL into your browser and log into Element!
Releases are signed using gpg and the OpenPGP standard, and can be checked against the public key located
at <https://packages.riot.im/element-release-key.asc>.
Note that for the security of your chats will need to serve Element
over HTTPS. Major browsers also do not allow you to use VoIP/video
chats over HTTP, as WebRTC is only usable over HTTPS.
There are some exceptions like when using localhost, which is
considered a [secure context](https://developer.mozilla.org/docs/Web/Security/Secure_Contexts)
and thus allowed.
To install Element as a desktop application, see [Running as a desktop
app](#running-as-a-desktop-app) below.
To install Element as a desktop application, see [Running as a desktop app](#running-as-a-desktop-app) below.
# Important Security Notes
@ -161,61 +141,7 @@ To build it yourself, follow the instructions at <https://github.com/vector-im/e
Many thanks to @aviraldg for the initial work on the Electron integration.
Other options for running as a desktop app:
- @asdf:matrix.org points out that you can use nativefier and it just works(tm)
```bash
yarn global add nativefier
nativefier https://app.element.io/
```
The [configuration docs](docs/config.md#desktop-app-configuration) show how to
override the desktop app's default settings if desired.
# Running from Docker
The Docker image can be used to serve element-web as a web server. The easiest way to use
it is to use the prebuilt image:
```bash
docker run -p 80:80 vectorim/element-web
```
To supply your own custom `config.json`, map a volume to `/app/config.json`. For example,
if your custom config was located at `/etc/element-web/config.json` then your Docker command
would be:
```bash
docker run -p 80:80 -v /etc/element-web/config.json:/app/config.json vectorim/element-web
```
To build the image yourself:
```bash
git clone https://github.com/vector-im/element-web.git element-web
cd element-web
git checkout master
docker build .
```
If you're building a custom branch, or want to use the develop branch, check out the appropriate
element-web branch and then run:
```bash
docker build -t \
--build-arg USE_CUSTOM_SDKS=true \
--build-arg REACT_SDK_REPO="https://github.com/matrix-org/matrix-react-sdk.git" \
--build-arg REACT_SDK_BRANCH="develop" \
--build-arg JS_SDK_REPO="https://github.com/matrix-org/matrix-js-sdk.git" \
--build-arg JS_SDK_BRANCH="develop" \
.
```
# Running in Kubernetes
The provided element-web docker image can also be run from within a Kubernetes cluster.
See the [Kubernetes example](docs/kubernetes.md) for more details.
The [configuration docs](docs/config.md#desktop-app-configuration) show how to override the desktop app's default settings if desired.
# config.json

View File

@ -18,6 +18,7 @@ create-missing = false
# Remove the numbers that appear before each item in the sidebar, as they can
# get quite messy as we nest deeper
no-section-label = true
additional-css = ["docs/lib/custom.css"]
# The source code URL of the repository
git-repository-url = "https://github.com/vector-im/element-web"

2
debian/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/files
/tmp

2
debian/conffiles vendored
View File

@ -1 +1 @@
/usr/share/element-web/config.json
/etc/element-web/config.json

13
debian/control vendored
View File

@ -1,12 +1,13 @@
Package: element-web
License: Apache-2.0
Vendor: support@element.io
Architecture: all
Source: element-web
Maintainer: support@element.io
Recommends: element-io-archive-keyring
Section: web
Priority: optional
Homepage: https://element.io/
Version: ${Version}
Package: element-web
Architecture: all
Recommends: httpd, element-io-archive-keyring
Description:
A feature-rich client for Matrix.org
This package contains the web-based client that can be served through a web
server.

View File

@ -9,6 +9,7 @@
# Setup
- [Install](install.md)
- [Config](config.md)
- [Custom home page](custom-home.md)
- [Kubernetes](kubernetes.md)
@ -37,3 +38,4 @@
- [Jitsi](jitsi-dev.md)
- [Feature flags](feature-flags.md)
- [OIDC and delegated authentication](oidc.md)
- [Release Process](release.md)

78
docs/install.md Normal file
View File

@ -0,0 +1,78 @@
# Installing Element Web
**Familiarise yourself with the [Important Security Notes](../README.md#important-security-notes) before starting, they apply to all installation methods.**
_Note: that for the security of your chats will need to serve Element over HTTPS.
Major browsers also do not allow you to use VoIP/video chats over HTTP, as WebRTC is only usable over HTTPS.
There are some exceptions like when using localhost, which is considered a [secure context](https://developer.mozilla.org/docs/Web/Security/Secure_Contexts) and thus allowed._
## Release tarball
1. Download the latest version from <https://github.com/vector-im/element-web/releases>
1. Untar the tarball on your web server
1. Move (or symlink) the `element-x.x.x` directory to an appropriate name
1. Configure the correct caching headers in your webserver (see below)
1. Configure the app by copying `config.sample.json` to `config.json` and
modifying it. See the [configuration docs](docs/config.md) for details.
1. Enter the URL into your browser and log into Element!
Releases are signed using gpg and the OpenPGP standard,
and can be checked against the public key located at <https://packages.element.io/element-release-key.asc>.
## Debian package
Element Web is now also available as a Debian package for Debian and Ubuntu based systems.
```shell
sudo apt install -y wget apt-transport-https
sudo wget -O /usr/share/keyrings/element-io-archive-keyring.gpg https://packages.element.io/debian/element-io-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/element-io-archive-keyring.gpg] https://packages.element.io/debian/ default main" | sudo tee /etc/apt/sources.list.d/element-io.list
sudo apt update
sudo apt install element-web
```
Configure the app by modifying `/etc/element-web/config.json`. See the [configuration docs](docs/config.md) for details.
## Docker
The Docker image can be used to serve element-web as a web server. The easiest way to use
it is to use the prebuilt image:
```bash
docker run -p 80:80 vectorim/element-web
```
To supply your own custom `config.json`, map a volume to `/app/config.json`. For example,
if your custom config was located at `/etc/element-web/config.json` then your Docker command
would be:
```bash
docker run -p 80:80 -v /etc/element-web/config.json:/app/config.json vectorim/element-web
```
To build the image yourself:
```bash
git clone https://github.com/vector-im/element-web.git element-web
cd element-web
git checkout master
docker build .
```
If you're building a custom branch, or want to use the develop branch, check out the appropriate
element-web branch and then run:
```bash
docker build -t \
--build-arg USE_CUSTOM_SDKS=true \
--build-arg REACT_SDK_REPO="https://github.com/matrix-org/matrix-react-sdk.git" \
--build-arg REACT_SDK_BRANCH="develop" \
--build-arg JS_SDK_REPO="https://github.com/matrix-org/matrix-js-sdk.git" \
--build-arg JS_SDK_BRANCH="develop" \
.
```
## Kubernetes
The provided element-web docker image can also be run from within a Kubernetes cluster.
See the [Kubernetes example](docs/kubernetes.md) for more details.

View File

@ -120,6 +120,15 @@ This feature allows users to place and join native [MSC3401](https://github.com/
If you're enabling this at the deployment level, you may also want to reference the docs for the `element_call` config section.
## Disable per-sender encryption for Element Call (`feature_disable_call_per_sender_encryption`)
The default for embedded Element Call in Element Web is per-participant encryption.
This labs flag disables encryption for embedded Element Call in encrypted rooms.
Under the hood this stops Element Web from adding the `perParticipantE2EE` flag for the Element Call widget url.
This is useful while we experiment with encryption and to make calling compatible with platforms that don't use encryption yet.
## Rich text in room topics (`feature_html_topic`) [In Development]
Enables rendering of MD / HTML in room topics.

14
docs/lib/custom.css Normal file
View File

@ -0,0 +1,14 @@
/* Prevent collapsible headings from wrapping onto two lines eagerly */
summary > h1,
summary > h2,
summary > h3,
summary > h4,
summary > h5,
summary > h6 {
display: inline-block;
}
/* Prevent longer checkbox lists from wrapping eagerly */
input + p {
display: inline;
}

268
docs/release.md Normal file
View File

@ -0,0 +1,268 @@
> Tip: Paste this into the browser console to make the checkboxes on this page tickable. (Bear in mind that your ticks will be lost if you reload though.)
>
> ```
> document.querySelectorAll("input[type='checkbox']").forEach(i => {i.disabled = false;})
> ```
<details><summary><h1>Branches</h1></summary><blockquote>
#### develop
The develop branch holds the very latest and greatest code we have to offer, as such it may be less stable. It corresponds to the develop.element.io CD platform.
#### staging
The staging branch corresponds to the very latest release regardless of whether it is an RC or not. Deployed to staging.element.io manually.
#### master
The master branch is the most stable as it is the very latest non-RC release. Deployed to app.element.io manually.
</blockquote></details>
<details><summary><h1>Versions</h1></summary><blockquote>
The matrix-js-sdk follows semver, the matrix-react-sdk loosely follows semver, most releases for both will bump the minor version number.
Breaking changes will bump the major version number.
Element Web & Element Desktop do not follow semver and always have matching version numbers. The patch version number is normally incremented for every release.
</blockquote></details>
<details><summary><h1>Release Types</h1></summary><blockquote>
#### Release candidate
A normal release begins with a Release Candidate on the Tick phase of the release cycle,
and may contain as many further RCs as are needed before the Tock phase of cycle.
Each subsequent RC may add additional commits via any of the means of preparation.
A normal release is the most typical run-of-the-mill release,
with at least one RC (Release Candidate) followed by a FINAL release.
The typical cadence for these is every 2 weeks we'll do a new initial RC,
then the following week we'll do that release cycle's FINAL release with sometimes more RCs in between, as needed.
#### Final
A normal release culminates with a Final release on the Tock phase of the cycle.
This may be merely shipping the very latest RC with an adjusted version number,
but can also include (hopefully small) additional changes present on `staging` if they are deemed safe to skip an RC.
### Hotfix / Security
This is an accelerated type of release which sits somewhere between RC and Final.
They tend to contain few patches delta from the previous release but also skip any form of RC
and in the case of Security the patch lands on GitHub only moments prior.
For all intents and purposes they are the same as a Final release but with a different purpose.
</blockquote></details>
<details><summary><h1>Release Blockers</h1></summary><blockquote>
You should become release rabbit on the day after the last full release.
For that week, it's your job to keep an eye on the Releases room and see whether any issues marked `X-Release-Blocker` are opened,
or were already open. You should chase people to fix them, so that on RC day you can make the release.
If release-blocking issues are still open, you need to delay the release until they are fixed or reclassified.
There are two labels for tracking release blockers.
#### X-Release-Blocker
This label applied to an issue means we cannot ship a release affected by the specific issue.
This means we cannot cut branches for an RC but security & hotfix releases may still be fine.
#### X-Upcoming-Release-Blocker
This label applied to an issue means that the next (read: not current) release cycle will be affected by the specific issue.
This label will automagically convert to `X-Release-Blocker` at the conclusion of a full release.
</blockquote></details>
<details><summary><h1>Repositories</h1></summary><blockquote>
This release process revolves around our four main repositories:
- [Element Desktop](https://github.com/vector-im/element-desktop/)
- [Element Web](https://github.com/vector-im/element-web/)
- [Matrix React SDK](https://github.com/matrix-org/matrix-react-sdk/)
- [Matrix JS SDK](https://github.com/matrix-org/matrix-js-sdk/)
We own other repositories, but they have more ad-hoc releases and are not part of the bi-weekly cycle:
- https://github.com/matrix-org/matrix-web-i18n/
- https://github.com/matrix-org/matrix-react-sdk-module-api
</blockquote></details>
<details><summary><h1>Prerequisites</h1></summary><blockquote>
- You must be part of the 2 Releasers GitHub groups:
- <https://github.com/orgs/vector-im/teams/element-web-releasers>
- <https://github.com/orgs/matrix-org/teams/element-web-releasers>
- You will need access to the **VPN** ([docs](https://gitlab.matrix.org/new-vector/internal/-/wikis/SRE/Tailscale)) to be able to follow the instructions under Deploy below.
- You will need the ability to **SSH** in to the production machines to be able to follow the instructions under Deploy below. Ensure that your SSH key has a non-empty passphrase, and you registered your SSH key with Ops. Log a ticket at https://github.com/matrix-org/matrix-ansible-private and ask for:
- Two-factor authentication to be set up on your SSH key. (This is needed to get access to production).
- SSH access to `horme` (staging.element.io and app.element.io)
- Permission to sudo on horme as the user `element`
- You need "**jumphost**" configuration in your local `~/.ssh/config`. This should have been set up as part of your onboarding.
</blockquote></details>
<details><summary><h1>Overview</h1></summary><blockquote>
```mermaid
flowchart TD
P[[Prepare staging branches]]
P --> R1
subgraph Releasing
R1[[Releasing matrix-js-sdk]]
R2[[Releasing matrix-react-sdk]]
R3[[Releasing element-web]]
R4[[Releasing element-desktop]]
R1 --> R2 --> R3 --> R4
end
R4 --> D1
subgraph Deploying
D1[\Deploy staging.element.io/]
D2[\Check dockerhub/]
D3[\Deploy app.element.io/]
D4[\Check desktop package/]
D1 --> D2 --> D
D{FINAL?}
D -->|Yes| D3 --> D4
end
D -->|No| H1
D4 --> H1
subgraph Housekeeping
H1[\Update topics/]
H2[\Announce/]
H3[\Archive done column/]
H4[\Add diary entry/]
H5[\Renovate/]
H1 --> H2 --> H
H{FINAL?}
H -->|Yes| H3 --> H4 --> DONE
H -->|No| H5
end
DONE([You are done!])
H5 --> DONE
```
</blockquote></details>
---
# Preparation
The goal of this stage is to get the code you want to ship onto the `staging` branch.
There are multiple ways to accomplish this depending on the type of release you need to perform.
For the first RC in a given release cycle the easiest way to prepare branches is using the
[Cut branches automation](https://github.com/vector-im/element-web/actions/workflows/release_prepare.yml) -
this will take `develop` and merge it into the `staging` on the chosen repositories.
For subsequent RCs, if you need to include a change you may PR it directly to the `staging` branch or rely on the
backport automation via labelling a PR to `develop` with `backport staging` which will cause a new PR to be opened
which backports the requested change to the `staging` branch.
For security, you may wish to merge the security advisory private fork or apply the patches manually and then push them directly to `staging`.
It is worth noting that at the end of the Final/Hotfix/Security release `staging` is merged to `master` which is merged back into `develop` -
this means that any commit which goes to `staging` will eventually make its way back to the default branch.
- [ ] The staging branch is prepared
# Releasing
Shortly after concluding the preparation stage (or pushing any changes to `staging` in general);
a draft release will be automatically made on the 4 project repositories with suggested changelogs and version numbers.
Review the draft releases created, check the version number makes sense and that the changelog contains everything you'd expect to.
_Note: we should add a step here to write summaries atop the changelogs manually, or via AI_
### Matrix JS SDK
The first stop is the matrix-js-sdk; kick off a release using [the automation](https://github.com/matrix-org/matrix-js-sdk/actions/workflows/release.yml) - making sure to select the right type of release. For anything other than an RC: choose final. You should not need to ever switch off either of the Publishing options.
- [ ] matrix-js-sdk has been released & published to npm
### Matrix React SDK
The next stop is matrix-react-sdk; kick off a release using [the automation](https://github.com/matrix-org/matrix-react-sdk/actions/workflows/release.yml) - making sure to select the right type of release. For anything other than an RC: choose final. In the JS SDK version field enter the version of the JS SDK you wish to use, for typical releases including all the layers this would be the version released in the stage above.
- [ ] matrix-react-sdk has been released & published to npm
### Element Web
The next stop is element-web; kick off a release using [the automation](https://github.com/vector-im/element-web/actions/workflows/release.yml) - making sure to select the right type of release. For anything other than an RC: choose final. In the SDK version fields enter the versions you wish to use, for typical releases including all the layers this would be the versions released in the stages above.
- [ ] Element Web has been released
### Element Desktop
The next stop is element-desktop; kick off a release using [the automation](https://github.com/vector-im/element-desktop/actions/workflows/release.yml) - making sure to select the right type of release. For anything other than an RC: choose final. In the JS SDK version field enter the version of the JS SDK you wish to use, for typical releases including all the layers this would be the version released in the stage above.
- [ ] Element Desktop has been released
# Deploying
We ship the SDKs to npm, this happens as part of the release process.
We ship Element Web to dockerhub, `*.element.io`, and packages.element.io.
We ship Element Desktop to packages.element.io.
- [ ] Check that element-web has shipped to dockerhub
- [ ] Deploy staging.element.io. [See docs.](https://handbook.element.io/books/element-web-team/page/deploying-appstagingelementio)
- [ ] Test staging.element.io
For final releases additionally do these steps:
- [ ] Deploy app.element.io. [See docs.](https://handbook.element.io/books/element-web-team/page/deploying-appstagingelementio)
- [ ] Test app.element.io
- [ ] Ensure Element Web package has shipped to packages.element.io
- [ ] Ensure Element Desktop packages have shipped to packages.element.io
# Housekeeping
We have some manual housekeeping to do in order to prepare for the next release.
- [ ] Update topics using [the automation](https://github.com/vector-im/element-web/actions/workflows/update-topics.yaml). It will autodetect the current latest version. Don't forget the date you supply should be e.g. September 5th (including the "th") for the script to work.
- [ ] Announce the release in [#element-web-announcements:matrix.org](https://matrix.to/#/#element-web-announcements:matrix.org)
<details><summary>(show)</summary>
With wording like:
> Element Web v1.11.24 is here!
>
> This version adds ... and fixes bugs ...
>
> Check it out at app.element.io, in Element Desktop, or from Docker Hub. Changelog and more details at https://github.com/vector-im/element-web/releases/tag/v1.11.24
</details>
For the first RC of a given release cycle do these steps:
- [ ] Go to the [matrix-js-sdk Renovate dashboard](https://github.com/matrix-org/matrix-js-sdk/issues/2406) and click the checkbox to create/update its PRs.
- [ ] Go to the [matrix-react-sdk Renovate dashboard](https://github.com/matrix-org/matrix-react-sdk/issues/9667) and click the checkbox to create/update its PRs.
- [ ] Go to the [element-web Renovate dashboard](https://github.com/vector-im/element-web/issues/22941) and click the checkbox to create/update its PRs.
- [ ] Go to the [element-desktop Renovate dashboard](https://github.com/vector-im/element-desktop/issues/465) and click the checkbox to create/update its PRs.
- [ ] Later, check back and merge the PRs that succeeded to build. The ones that failed will get picked up by the [maintainer](https://docs.google.com/document/d/1V5VINWXATMpz9UBw4IKmVVB8aw3CxM0Jt7igtHnDfSk/edit#).
For final releases additionally do these steps:
- [ ] Archive done column on the [team board](https://github.com/orgs/vector-im/projects/67/views/34) _Note: this should be automated_
- [ ] Add entry to the [milestones diary](https://docs.google.com/document/d/1cpRFJdfNCo2Ps6jqzQmatzbYEToSrQpyBug0aP_iwZE/edit#heading=h.6y55fw4t283z). The document says only to add significant releases, but we add all of them just in case.

View File

@ -47,10 +47,6 @@ We are aiming for a set of common strings to be shared then some more localised
4. Otherwise, try to group keys logically and nest where appropriate, such as `keyboard_` for strings relating to keyboard shortcuts.
5. Ensure your translation keys do not include `.` or `|` or ` `. Try to balance string length against descriptiveness.
## matrix-react-sdk is still undergoing migration to translation keys
If you are fortunate enough to be modifying not yet migrated strings please treat them as a new string using instructions below.
## Adding new strings
1. Check if the import `import { _t } from 'matrix-react-sdk/src/languageHandler';` is present. If not add it to the other import statements. Also import `_td` if needed.

View File

@ -29,3 +29,8 @@ A special case is `%(count)s` as this is also used to determine which pluralisat
These things are markup tags, they encapsulate sections of translations to be marked up, with links, buttons, emphasis and such.
You must keep these markers surrounding the equivalent string in your language that needs to be marked up.
### When will my translations be available?
We automatically pull changes from Localazy 3 times a week, so your translations should be available at https://develop.element.io
within a few days of you submitting them and them being approved. They will then also be included in the following release cycle.

View File

@ -40,9 +40,9 @@ const config: Config = {
"waveWorker\\.min\\.js": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"context-filter-polyfill": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"FontManager.ts": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/FontManager.js",
"workers/(.+)\\.worker\\.ts": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/workerMock.js",
"workers/(.+)Factory": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/workerFactoryMock.js",
"^!!raw-loader!.*": "jest-raw-loader",
"RecorderWorklet": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"recorderWorkletFactory": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/empty.js",
"^fetch-mock$": "<rootDir>/node_modules/fetch-mock",
},
transformIgnorePatterns: ["/node_modules/(?!matrix-js-sdk).+$", "/node_modules/(?!matrix-react-sdk).+$"],

View File

@ -1,6 +1,6 @@
{
"name": "element-web",
"version": "1.11.47",
"version": "1.11.50",
"description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.",
"repository": {
@ -37,19 +37,18 @@
"clean": "rimraf lib webapp",
"build": "yarn clean && yarn build:genfiles && yarn build:bundle",
"build-stats": "yarn clean && yarn build:genfiles && yarn build:bundle-stats",
"build:jitsi": "ts-node scripts/build-jitsi.ts",
"build:res": "ts-node scripts/copy-res.ts",
"build:genfiles": "yarn build:res && yarn build:jitsi && yarn build:module_system",
"build:genfiles": "yarn build:res && yarn build:module_system",
"build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js",
"build:bundle": "webpack --progress --mode production",
"build:bundle-stats": "webpack --progress --mode production --json > webpack-stats.json",
"build:module_system": "tsc --project ./tsconfig.module_system.json && node ./lib/module_system/scripts/install.js",
"build:module_system": "ts-node --project ./tsconfig.module_system.json module_system/scripts/install.ts",
"dist": "scripts/package.sh",
"start": "yarn build:module_system && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js\"",
"start": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n modules,res \"yarn build:module_system\" \"yarn build:res\" && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js\"",
"start:https": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js --https\"",
"start:res": "yarn build:jitsi && ts-node scripts/copy-res.ts -w",
"start:js": "webpack serve --output-path webapp --mode development",
"lint": "yarn lint:types && yarn lint:js && yarn lint:style",
"start:res": "ts-node scripts/copy-res.ts -w",
"start:js": "webpack serve --output-path webapp --output-filename=bundles/_dev_/[name].js --output-chunk-filename=bundles/_dev_/[name].js --mode development",
"lint": "yarn lint:types && yarn lint:js && yarn lint:style && yarn lint:workflows",
"lint:js": "yarn lint:js:src && yarn lint:js:module_system",
"lint:js:src": "eslint --max-warnings 0 src test && prettier --check .",
"lint:js:module_system": "eslint --max-warnings 0 --config .eslintrc-module_system.js module_system",
@ -60,10 +59,12 @@
"lint:types:src": "tsc --noEmit --jsx react",
"lint:types:module_system": "tsc --noEmit --project ./tsconfig.module_system.json",
"lint:style": "stylelint \"res/css/**/*.pcss\"",
"lint:workflows": "find .github/workflows -type f \\( -iname '*.yaml' -o -iname '*.yml' \\) | xargs -I {} sh -c 'echo \"Linting {}\"; action-validator \"{}\"'",
"test": "jest",
"coverage": "yarn test --coverage",
"analyse:unused-exports": "ts-node ./scripts/analyse_unused_exports.ts",
"analyse:webpack-bundles": "webpack-bundle-analyzer webpack-stats.json webapp"
"analyse:webpack-bundles": "webpack-bundle-analyzer webpack-stats.json webapp",
"update:jitsi": "curl -s https://meet.element.io/libs/external_api.min.js > ./res/jitsi_external_api.min.js"
},
"resolutions": {
"@types/react-dom": "17.0.21",
@ -71,7 +72,7 @@
},
"dependencies": {
"@matrix-org/olm": "3.2.15",
"@matrix-org/react-sdk-module-api": "^2.1.0",
"@matrix-org/react-sdk-module-api": "^2.2.1",
"gfm.css": "^1.1.2",
"jsrsasign": "^10.5.25",
"katex": "^0.16.0",
@ -84,6 +85,8 @@
"ua-parser-js": "^1.0.0"
},
"devDependencies": {
"@action-validator/cli": "^0.5.3",
"@action-validator/core": "^0.5.3",
"@babel/core": "^7.12.10",
"@babel/eslint-parser": "^7.12.10",
"@babel/eslint-plugin": "^7.12.10",
@ -103,13 +106,12 @@
"@babel/runtime": "^7.12.5",
"@casualbot/jest-sonar-reporter": "2.2.7",
"@principalstudio/html-webpack-inject-preload": "^1.2.7",
"@sentry/webpack-plugin": "^2.0.0",
"@sentry/webpack-plugin": "^2.7.1",
"@svgr/webpack": "^5.5.0",
"@testing-library/react": "^12.1.5",
"@types/jest": "^29.0.0",
"@types/jitsi-meet": "^2.0.2",
"@types/jsrsasign": "^10.5.4",
"@types/loader-utils": "^2.0.4",
"@types/lodash": "^4.14.197",
"@types/node": "^16",
"@types/node-fetch": "^2.6.4",
@ -121,12 +123,15 @@
"allchange": "^1.0.6",
"babel-jest": "^29.0.0",
"babel-loader": "^8.2.2",
"buffer": "^6.0.3",
"chokidar": "^3.5.1",
"concurrently": "^8.0.0",
"cpx": "1.5.0",
"copy-webpack-plugin": "^11.0.0",
"cronstrue": "^2.41.0",
"css-loader": "^4",
"css-minimizer-webpack-plugin": "^5.0.1",
"dotenv": "^16.0.2",
"eslint": "8.52.0",
"eslint": "8.53.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-deprecate": "0.8.4",
@ -135,27 +140,23 @@
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-unicorn": "^49.0.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"fake-indexeddb": "^5.0.0",
"fetch-mock": "9.11.0",
"fetch-mock-jest": "^1.5.1",
"file-loader": "^6.0.0",
"fs-extra": "^11.0.0",
"html-webpack-plugin": "^4.5.2",
"html-webpack-plugin": "^5.5.3",
"jest": "^29.0.0",
"jest-canvas-mock": "2.5.2",
"jest-environment-jsdom": "^29.0.0",
"jest-mock": "^29.0.0",
"jest-raw-loader": "^1.0.1",
"json-loader": "^0.5.7",
"loader-utils": "^3.0.0",
"matrix-mock-request": "^2.5.0",
"matrix-web-i18n": "^3.1.3",
"mini-css-extract-plugin": "^1",
"mini-css-extract-plugin": "^2.7.6",
"minimist": "^1.2.6",
"mkdirp": "^3.0.0",
"modernizr": "^3.12.0",
"node-fetch": "^2.6.7",
"optimize-css-assets-webpack-plugin": "^6.0.0",
"postcss": "^8.4.31",
"postcss-easings": "^2.0.0",
"postcss-hexrgba": "2.0.1",
@ -167,27 +168,27 @@
"postcss-scss": "^4.0.4",
"postcss-simple-vars": "^5.0.2",
"prettier": "2.8.8",
"process": "^0.11.10",
"proxy-agent": "^6.3.0",
"raw-loader": "^4.0.2",
"rimraf": "^5.0.0",
"semver": "^7.5.2",
"setimmediate": "^1.0.5",
"string-replace-loader": "3",
"style-loader": "2",
"stylelint": "^15.10.1",
"stylelint-config-standard": "^34.0.0",
"stylelint-scss": "^5.0.0",
"terser-webpack-plugin": "^4.0.0",
"terser-webpack-plugin": "^5.3.9",
"ts-node": "^10.9.1",
"ts-prune": "^0.10.3",
"typescript": "5.2.2",
"webpack": "^4.47.0",
"util": "^0.12.5",
"webpack": "^5.89.0",
"webpack-bundle-analyzer": "^4.8.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"worker-loader": "^3.0.0",
"worklet-loader": "^2.0.0",
"yaml": "^2.3.3",
"cronstrue": "^2.41.0"
"yaml": "^2.3.3"
},
"@casualbot/jest-sonar-reporter": {
"outputDirectory": "coverage",

View File

@ -0,0 +1,45 @@
/*
Copyright 2023 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Inspired by https://github.com/reklawnos/worklet-loader which doesn't
// formally support Webpack 5
const SingleEntryPlugin = require("webpack/lib/SingleEntryPlugin");
module.exports = function () {};
module.exports.pitch = function pitch(request) {
const cb = this.async();
const filename = "recorder.worklet.js";
const compiler = this._compilation.createChildCompiler("worker", {
filename,
chunkFilename: `[id].${filename}`,
namedChunkFilename: null,
});
new SingleEntryPlugin(this.context, `!!${request}`, "main").apply(compiler);
compiler.runAsChild((err, entries, compilation) => {
if (err) {
return cb(err);
}
if (entries[0]) {
return cb(null, `module.exports = __webpack_public_path__ + ${JSON.stringify(entries[0].files[0])};`);
}
return cb(null, null);
});
};

3
res/jitsi_external_api.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,219 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note:
This project was originally contributed to the community under the MIT license and with the following notice:
The MIT License (MIT)
Copyright (c) 2013 ESTOS GmbH
Copyright (c) 2013 BlueJimp SARL
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,30 +0,0 @@
// This is a JS script so that the directory is created in-process on Windows.
// If the script isn't run in-process, there's a risk of it racing or never running
// due to file associations in Windows.
// Sorry.
import * as fs from "node:fs";
import * as path from "node:path";
import { mkdirpSync } from "mkdirp";
import fetch from "node-fetch";
import { ProxyAgent } from "proxy-agent";
console.log("Making webapp directory");
mkdirpSync("webapp");
// curl -s https://meet.element.io/libs/external_api.min.js > ./webapp/jitsi_external_api.min.js
console.log("Downloading Jitsi script");
const fname = path.join("webapp", "jitsi_external_api.min.js");
fetch("https://meet.element.io/libs/external_api.min.js", {
agent: new ProxyAgent(),
})
.then((res) => {
const stream = fs.createWriteStream(fname);
return new Promise<void>((resolve, reject) => {
res.body.pipe(stream);
res.body.on("error", (err) => reject(err));
res.body.on("finish", () => resolve());
});
})
.then(() => console.log("Done with Jitsi download"));

View File

@ -6,8 +6,7 @@ import parseArgs from "minimist";
import * as chokidar from "chokidar";
import * as fs from "node:fs";
import _ from "lodash";
import { Cpx } from "cpx";
import * as loaderUtils from "loader-utils";
import { util } from "webpack";
import { Translations } from "matrix-web-i18n";
const REACT_I18N_BASE_PATH = "node_modules/matrix-react-sdk/src/i18n/strings/";
@ -16,29 +15,6 @@ const INCLUDE_LANGS = [...new Set([...fs.readdirSync(I18N_BASE_PATH), ...fs.read
.filter((fn) => fn.endsWith(".json"))
.map((f) => f.slice(0, -5));
// cpx includes globbed parts of the filename in the destination, but excludes
// common parents. Hence, "res/{a,b}/**": the output will be "dest/a/..." and
// "dest/b/...".
const COPY_LIST: [
sourceGlob: string,
outputPath: string,
opts?: {
directwatch?: 1;
},
][] = [
["res/apple-app-site-association", "webapp"],
["res/manifest.json", "webapp"],
["res/sw.js", "webapp"],
["res/welcome.html", "webapp"],
["res/welcome/**", "webapp/welcome"],
["res/themes/**", "webapp/themes"],
["res/vector-icons/**", "webapp/vector-icons"],
["res/decoder-ring/**", "webapp/decoder-ring"],
["node_modules/matrix-react-sdk/res/media/**", "webapp/media"],
["node_modules/@matrix-org/olm/olm_legacy.js", "webapp", { directwatch: 1 }],
["./config.json", "webapp", { directwatch: 1 }],
["contribute.json", "webapp"],
];
const argv = parseArgs(process.argv.slice(2), {});
const watch = argv.w;
@ -60,53 +36,13 @@ if (!fs.existsSync("webapp/i18n/")) {
fs.mkdirSync("webapp/i18n/");
}
function next(i: number, err?: Error): void {
errCheck(err);
if (i >= COPY_LIST.length) {
return;
}
const ent = COPY_LIST[i];
const source = ent[0];
const dest = ent[1];
const opts = ent[2] || {};
const cpx = new Cpx(source, dest);
const logWatch = (path: string) => {
if (verbose) {
cpx.on("copy", (event) => {
console.log(`Copied: ${event.srcPath} --> ${event.dstPath}`);
});
cpx.on("remove", (event) => {
console.log(`Removed: ${event.path}`);
});
console.log(`Watching: ${path}`);
}
};
const cb = (err?: Error): void => {
next(i + 1, err);
};
if (watch) {
if (opts.directwatch) {
// cpx -w creates a watcher for the parent of any files specified,
// which in the case of config.json is '.', which inevitably takes
// ages to crawl. So we create our own watcher on the files
// instead.
const copy = (): void => {
cpx.copy(errCheck);
};
chokidar.watch(source).on("add", copy).on("change", copy).on("ready", cb).on("error", errCheck);
} else {
cpx.on("watch-ready", cb);
cpx.on("watch-error", cb);
cpx.watch();
}
} else {
cpx.copy(cb);
}
}
function genLangFile(lang: string, dest: string): string {
function prepareLangFile(lang: string, dest: string): [filename: string, json: string] {
const reactSdkFile = REACT_I18N_BASE_PATH + lang + ".json";
const riotWebFile = I18N_BASE_PATH + lang + ".json";
@ -124,15 +60,17 @@ function genLangFile(lang: string, dest: string): string {
const json = JSON.stringify(translations, null, 4);
const jsonBuffer = Buffer.from(json);
const digest = loaderUtils.getHashDigest(jsonBuffer, null, "hex", 7);
const digest = util.createHash("xxhash64").update(jsonBuffer).digest("hex").slice(0, 7);
const filename = `${lang}.${digest}.json`;
return [filename, json];
}
function genLangFile(dest: string, filename: string, json: string) {
fs.writeFileSync(dest + filename, json);
if (verbose) {
console.log("Generated language file: " + filename);
}
return filename;
}
function genLangList(langFileMap: Record<string, string>): void {
@ -175,29 +113,38 @@ function watchLanguage(lang: string, dest: string, langFileMap: Record<string, s
clearTimeout(makeLangDebouncer);
}
makeLangDebouncer = setTimeout(() => {
const filename = genLangFile(lang, dest);
const [filename, json] = prepareLangFile(lang, dest);
genLangFile(dest, filename, json);
langFileMap[lang] = filename;
genLangList(langFileMap);
}, 500);
};
[reactSdkFile, riotWebFile].forEach(function (f) {
chokidar.watch(f).on("add", makeLang).on("change", makeLang).on("error", errCheck);
chokidar
.watch(f, { ignoreInitial: true })
.on("ready", () => {
logWatch(f);
})
.on("add", makeLang)
.on("change", makeLang)
.on("error", errCheck);
});
}
// language resources
const I18N_DEST = "webapp/i18n/";
const I18N_FILENAME_MAP = INCLUDE_LANGS.reduce<Record<string, string>>((m, l) => {
const filename = genLangFile(l, I18N_DEST);
const [filename, json] = prepareLangFile(l, I18N_DEST);
if (!watch) {
genLangFile(I18N_DEST, filename, json);
}
m[l] = filename;
return m;
}, {});
genLangList(I18N_FILENAME_MAP);
if (watch) {
INCLUDE_LANGS.forEach((l) => watchLanguage(l, I18N_DEST, I18N_FILENAME_MAP));
} else {
genLangList(I18N_FILENAME_MAP);
}
// non-language resources
next(0);

43
src/@types/cpx.d.ts vendored
View File

@ -1,43 +0,0 @@
/*
Copyright 2023 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
declare module "cpx" {
export class Cpx {
public constructor(source: string, outDir: string, options?: object);
public on(eventName: "copy", fn: (event: { srcPath: string; dstPath: string }) => void): void;
public on(eventName: "remove", fn: (event: { path: string }) => void): void;
public on(eventName: "watch-ready", fn: () => void): void;
public on(eventName: "watch-error", fn: (error: Error) => void): void;
/**
* Copy all files that matches `this.source` pattern to `this.outDir`.
*
* @param {function} [cb = null] - A callback function.
* @returns {void}
*/
public copy(cb: Function | null): void;
/**
* Copy all files that matches `this.source` pattern to `this.outDir`.
* And watch changes in `this.base`, and copy only the file every time.
*
* @returns {void}
* @throws {Error} This had been watching already.
*/
public watch(): void;
}
}

View File

@ -1,28 +0,0 @@
/*
Copyright 2023 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import * as LoaderUtils from "loader-utils";
declare module "loader-utils" {
export function getHashDigest(
buffer: Buffer,
hashType: null,
digestType: LoaderUtils.DigestType,
maxLength: number,
): string;
}
export as namespace Cpx;

View File

@ -9,6 +9,7 @@
"auth": {
"sso_complete_in_browser_dialog_title": "Přejděte do prohlížeče a dokončete přihlášení"
},
"desktop_default_device_name": "%(brand)s Desktop: %(platformName)s",
"download_completed": "Stahování dokončeno",
"error": {
"app_launch_unexpected_error": "Neočekávaná chyba při přípravě aplikace. Podrobnosti najdete v konzoli.",

View File

@ -9,6 +9,7 @@
"auth": {
"sso_complete_in_browser_dialog_title": "Sisselogimiseks ava oma brauser"
},
"desktop_default_device_name": "%(brand)s töölaud: %(platformName)s",
"download_completed": "Allalaadimine on lõpetatud",
"error": {
"app_launch_unexpected_error": "Rakenduse ettevalmistamisel tekkis ootamatu viga. Täpsema teabe leiad konsoolist.",

View File

@ -14,6 +14,7 @@
"error": {
"app_launch_unexpected_error": "Váratlan hiba történt az alkalmazás előkészítésénél. A részletekért lásd a konzolt.",
"cannot_load_config": "A konfigurációs fájlt nem sikerült betölteni: frissítse az oldalt és próbálja meg újra.",
"invalid_configuration_mixed_server": "Érvénytelen konfiguráció: a default_hs_url nem adható meg a default_server_name vagy a default_server_config kulcsokkal együtt",
"invalid_configuration_no_server": "Érvénytelen konfiguráció: nincs megadva alapértelmezett kiszolgáló.",
"invalid_json": "Az Element érvénytelen JSON-t tartalmazó konfigurációval rendelkezik. Javítsa és töltse újra az oldalt.",
"invalid_json_detail": "A feldolgozó algoritmus üzenete: %(message)s",

View File

@ -9,6 +9,7 @@
"auth": {
"sso_complete_in_browser_dialog_title": "Vai nel tuo browser per completare l'accesso"
},
"desktop_default_device_name": "%(brand)s Desktop: %(platformName)s",
"download_completed": "Scaricamento completato",
"error": {
"app_launch_unexpected_error": "Errore inaspettato preparando l'app. Vedi la console per i dettagli.",

View File

@ -14,6 +14,7 @@
"error": {
"app_launch_unexpected_error": "Неожиданная ошибка при подготовке приложения. Подробности см. в консоли.",
"cannot_load_config": "Не удалось загрузить файл конфигурации. Попробуйте обновить страницу.",
"invalid_configuration_mixed_server": "Неверная конфигурация: нельзя указать default_hs_url вместе с default_server_name или default_server_config",
"invalid_configuration_no_server": "Неверная конфигурация: сервер по умолчанию не указан.",
"invalid_json": "Конфигурация Element содержит неверный JSON. Исправьте проблему и обновите страницу.",
"invalid_json_detail": "Сообщение из парсера: %(message)s",

View File

@ -14,6 +14,7 @@
"error": {
"app_launch_unexpected_error": "准备软件时出现意外错误,详细信息请查看控制台。",
"cannot_load_config": "无法加载配置文件:请刷新页面以重试。",
"invalid_configuration_mixed_server": "配置无效:无法与 default_server_name 或 default_server_config 一起指定 default_hs_url",
"invalid_configuration_no_server": "配置无效:没有指定默认服务器。",
"invalid_json": "Element 配置文件中包含无效的 JSON。请改正错误并重新加载页面。",
"invalid_json_detail": "来自解析器的消息:%(message)s",

View File

@ -49,11 +49,10 @@
<% }
} %>
<% for (var i=0; i < htmlWebpackPlugin.tags.headTags.length; i++) {
var tag = htmlWebpackPlugin.tags.headTags[i];
var path = tag.attributes && tag.attributes.href;
if (path.includes("/Inter/")) { %>
<link rel="preload" as="font" href=".<%= path %>" crossorigin="anonymous"/>
<% for (const tag of htmlWebpackPlugin.tags.headTags) {
let path = tag.attributes && tag.attributes.href;
if (path && path.includes("/Inter/")) { %>
<link rel="preload" as="font" href="<%= path %>" crossorigin="anonymous"/>
<% }
} %>

View File

@ -25,6 +25,9 @@ import { extractErrorMessageFromError } from "matrix-react-sdk/src/components/vi
import { parseQsFromFragment } from "./url_utils";
import "./modernizr";
// Make setImmediate available in bundle
import "setimmediate";
// Require common CSS here; this will make webpack process it into bundle.css.
// Our own CSS (which is themed) is imported via separate webpack entry points
// in webpack.config.js

View File

@ -4,7 +4,7 @@
"emitDecoratorMetadata": false,
"resolveJsonModule": true,
"esModuleInterop": true,
"module": "commonjs",
"module": "es2022",
"moduleResolution": "node",
"target": "es2016",
"noUnusedLocals": true,
@ -28,6 +28,9 @@
"./scripts/*.ts"
],
"ts-node": {
"files": true
"files": true,
"moduleTypes": {
"*": "cjs"
}
}
}

View File

@ -0,0 +1 @@
https://gitlab.opencode.de/bmi/souveraener_arbeitsplatz

View File

@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: 2023 Bundesministerium des Innern und für Heimat, PG ZenDiS "Projektgruppe für Aufbau ZenDiS"
# SPDX-License-Identifier: Apache-2.0
---
# The modules to install. See ./docs/modules.md for more information on
# what modules are.
#
# The values of this are provided to `yarn add` for inclusion.
modules:
- "@nordeck/element-web-guest-module@1.0.0"
- "@nordeck/element-web-widget-lifecycle-module@1.0.1"

View File

@ -0,0 +1,3 @@
{
"src/customisations/ComponentVisibility.ts": "node_modules/@nordeck/element-web-guest-module/customisations/ComponentVisibility.ts"
}

View File

@ -0,0 +1,2 @@
# SPDX-FileCopyrightText: 2023 Bundesministerium des Innern und für Heimat, PG ZenDiS "Projektgruppe für Aufbau ZenDiS"
# SPDX-License-Identifier: Apache-2.0

View File

@ -6,10 +6,11 @@ const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const HtmlWebpackInjectPreload = require("@principalstudio/html-webpack-inject-preload");
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
const crypto = require("crypto");
const CopyWebpackPlugin = require("copy-webpack-plugin");
// XXX: mangle Crypto::createHash to replace md4 with sha256, output.hashFunction is insufficient as multiple bits
// of webpack hardcode md4. The proper fix it to upgrade to webpack 5.
@ -80,7 +81,15 @@ function parseOverridesToReplacements(overrides) {
// because the input is effectively defined by the person running the build, we don't
// need to do anything special to protect against regex overrunning, etc.
new RegExp(oldPath.replace(/\//g, "[\\/\\\\]").replace(/\./g, "\\.")),
path.resolve(__dirname, newPath),
function (resource) {
resource.request = path.resolve(__dirname, newPath);
resource.createData.resource = path.resolve(__dirname, newPath);
// Starting with Webpack 5 we also need to set the context as otherwise replacing
// files in e.g. matrix-react-sdk with files from element-web will try to resolve
// them within matrix-react-sdk (https://github.com/webpack/webpack/issues/17716)
resource.context = path.dirname(resource.request);
resource.createData.context = path.dirname(resource.createData.resource);
},
);
});
}
@ -146,14 +155,6 @@ module.exports = (env, argv) => {
bail: true,
node: {
// Mock out the NodeFS module: The opus decoder imports this wrongly.
fs: "empty",
net: "empty",
tls: "empty",
crypto: "empty",
},
entry: {
bundle: "./src/vector/index.ts",
mobileguide: "./src/vector/mobile_guide/index.ts",
@ -191,14 +192,23 @@ module.exports = (env, argv) => {
},
},
// This fixes duplicate files showing up in chrome with sourcemaps enabled.
// See https://github.com/webpack/webpack/issues/7128 for more info.
namedModules: false,
// Readable IDs for better debugging
moduleIds: "named",
// Minification is normally enabled by default for webpack in production mode, but
// we use a CSS optimizer too and need to manage it ourselves.
minimize: enableMinification,
minimizer: enableMinification ? [new TerserPlugin({}), new OptimizeCSSAssetsPlugin({})] : [],
minimizer: enableMinification
? [
new TerserPlugin({
// Already minified and includes an auto-generated license comment
// that the plugin would otherwise pointlessly extract into a separate
// file. We add the actual license using CopyWebpackPlugin below.
exclude: "jitsi_external_api.min.js",
}),
new CssMinimizerPlugin(),
]
: [],
// Set the value of `process.env.NODE_ENV` for libraries like React
// See also https://v4.webpack.js.org/configuration/optimization/#optimizationnodeenv
@ -241,6 +251,20 @@ module.exports = (env, argv) => {
// Define a variable so the i18n stuff can load
"$webapp": path.resolve(__dirname, "webapp"),
},
fallback: {
// Mock out the NodeFS module: The opus decoder imports this wrongly.
"fs": false,
"net": false,
"tls": false,
"crypto": false,
// Polyfill needed by counterpart
"util": require.resolve("util/"),
// Polyfill needed by matrix-js-sdk/src/crypto
"buffer": require.resolve("buffer/"),
// Polyfill needed by sentry
"process/browser": require.resolve("process/browser"),
},
},
module: {
@ -267,15 +291,6 @@ module.exports = (env, argv) => {
replace: getThemesImports(),
},
},
{
test: /\.worker\.ts$/,
loader: "worker-loader",
options: {
// Prevent bundling workers since CSP forbids loading them
// from another origin.
filename: "[hash].worker.js",
},
},
{
test: /\.(ts|js)x?$/,
include: (f) => {
@ -451,22 +466,17 @@ module.exports = (env, argv) => {
},
},
{
// Special case the recorder worklet as it can't end up HMR'd, but the worker-loader
// isn't good enough for us. Note that the worklet-loader is listed as "do not use",
// however it seems to work fine for our purposes.
// Ideally we should use the built-in worklet support in Webpack 5 with the syntax
// described in https://github.com/webpack/webpack.js.org/issues/6869. However, this
// doesn't currently appear to work with our public path setup. So we handle this
// with a custom loader instead.
test: /RecorderWorklet\.ts$/,
type: "javascript/auto",
use: [
// executed last -> first, for some reason.
{
loader: "worklet-loader",
options: {
// Override name so we know what it is in the output.
name: "recorder-worklet.[hash:7].js",
},
loader: path.resolve("./recorder-worklet-loader.js"),
},
{
// TS -> JS because the worklet-loader won't do this for us.
loader: "babel-loader",
},
],
@ -708,7 +718,34 @@ module.exports = (env, argv) => {
console.log(`::warning title=Sentry error::${err.message}`);
},
}),
new webpack.EnvironmentPlugin(["VERSION"]),
new CopyWebpackPlugin({
patterns: [
"res/apple-app-site-association",
"res/jitsi_external_api.min.js",
"res/jitsi_external_api.min.js.LICENSE.txt",
"res/manifest.json",
"res/sw.js",
"res/welcome.html",
{ from: "welcome/**", context: path.resolve(__dirname, "res") },
{ from: "themes/**", context: path.resolve(__dirname, "res") },
{ from: "vector-icons/**", context: path.resolve(__dirname, "res") },
{ from: "decoder-ring/**", context: path.resolve(__dirname, "res") },
{ from: "media/**", context: path.resolve(__dirname, "node_modules/matrix-react-sdk/res/") },
"node_modules/@matrix-org/olm/olm_legacy.js",
{ from: "config.json", noErrorOnMissing: true },
"contribute.json",
],
}),
// Automatically load buffer & process modules as we use them without explicitly
// importing them
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
process: "process/browser",
}),
].filter(Boolean),
output: {
@ -728,6 +765,15 @@ module.exports = (env, argv) => {
// configuration for the webpack-dev-server
devServer: {
client: {
overlay: {
// Only show overlay on build errors as anything more can get annoying quickly
errors: true,
warnings: false,
runtimeErrors: false,
},
},
static: {
// Where to serve static assets from
directory: "./webapp",

3792
yarn.lock

File diff suppressed because it is too large Load Diff