Merge branch 'develop' into t3chguy/fix/d1728

This commit is contained in:
Michael Telatynski 2024-11-04 12:16:28 +00:00 committed by GitHub
commit 4fade2453c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
91 changed files with 5545 additions and 4046 deletions

View File

@ -1,22 +0,0 @@
module.exports = {
plugins: ["matrix-org"],
extends: [".eslintrc.js"],
parserOptions: {
project: ["hak/tsconfig.json"],
},
overrides: [
{
files: ["hak/**/*.ts"],
extends: ["plugin:matrix-org/typescript"],
rules: {
// Things we do that break the ideal style
"prefer-promise-reject-errors": "off",
"quotes": "off",
"@typescript-eslint/no-explicit-any": "off",
// We're okay with assertion errors when we ask for them
"@typescript-eslint/no-non-null-assertion": "off",
},
},
],
};

View File

@ -1,22 +0,0 @@
module.exports = {
plugins: ["matrix-org"],
extends: [".eslintrc.js"],
parserOptions: {
project: ["scripts/tsconfig.json"],
},
overrides: [
{
files: ["scripts/**/*.ts"],
extends: ["plugin:matrix-org/typescript"],
rules: {
// Things we do that break the ideal style
"prefer-promise-reject-errors": "off",
"quotes": "off",
"@typescript-eslint/no-explicit-any": "off",
// We're okay with assertion errors when we ask for them
"@typescript-eslint/no-non-null-assertion": "off",
},
},
],
};

View File

@ -1,22 +0,0 @@
module.exports = {
plugins: ["matrix-org"],
extends: [".eslintrc.js"],
parserOptions: {
project: ["playwright/tsconfig.json"],
},
overrides: [
{
files: ["playwright/**/*.ts"],
extends: ["plugin:matrix-org/typescript"],
rules: {
// Things we do that break the ideal style
"prefer-promise-reject-errors": "off",
"quotes": "off",
"@typescript-eslint/no-explicit-any": "off",
// We're okay with assertion errors when we ask for them
"@typescript-eslint/no-non-null-assertion": "off",
},
},
],
};

88
.eslintrc.cjs Normal file
View File

@ -0,0 +1,88 @@
module.exports = {
plugins: ["matrix-org", "n"],
extends: ["plugin:matrix-org/javascript"],
parserOptions: {
ecmaVersion: 2021,
project: ["tsconfig.json"],
},
env: {
es6: true,
node: true,
// we also have some browser code (ie. the preload script)
browser: true,
},
// NOTE: These rules are frozen and new rules should not be added here.
// New changes belong in https://github.com/matrix-org/eslint-plugin-matrix-org/
rules: {
"quotes": "off",
"indent": "off",
"prefer-promise-reject-errors": "off",
"no-async-promise-executor": "off",
"n/file-extension-in-import": ["error", "always"],
"unicorn/prefer-node-protocol": ["error"],
},
overrides: [
{
files: ["src/**/*.ts"],
extends: ["plugin:matrix-org/typescript"],
rules: {
// Things we do that break the ideal style
"prefer-promise-reject-errors": "off",
"quotes": "off",
"@typescript-eslint/no-explicit-any": "off",
// We're okay with assertion errors when we ask for them
"@typescript-eslint/no-non-null-assertion": "off",
},
},
{
files: ["hak/**/*.ts"],
extends: ["plugin:matrix-org/typescript"],
parserOptions: {
project: ["hak/tsconfig.json"],
},
rules: {
// Things we do that break the ideal style
"prefer-promise-reject-errors": "off",
"quotes": "off",
"@typescript-eslint/no-explicit-any": "off",
// We're okay with assertion errors when we ask for them
"@typescript-eslint/no-non-null-assertion": "off",
},
},
{
files: ["scripts/**/*.ts"],
extends: ["plugin:matrix-org/typescript"],
parserOptions: {
project: ["scripts/tsconfig.json"],
},
rules: {
// Things we do that break the ideal style
"prefer-promise-reject-errors": "off",
"quotes": "off",
"@typescript-eslint/no-explicit-any": "off",
// We're okay with assertion errors when we ask for them
"@typescript-eslint/no-non-null-assertion": "off",
},
},
{
files: ["playwright/**/*.ts"],
extends: ["plugin:matrix-org/typescript"],
parserOptions: {
project: ["playwright/tsconfig.json"],
},
rules: {
// Things we do that break the ideal style
"prefer-promise-reject-errors": "off",
"quotes": "off",
"@typescript-eslint/no-explicit-any": "off",
// We're okay with assertion errors when we ask for them
"@typescript-eslint/no-non-null-assertion": "off",
},
},
],
};

View File

@ -1,37 +0,0 @@
module.exports = {
plugins: ["matrix-org"],
extends: ["plugin:matrix-org/javascript"],
parserOptions: {
ecmaVersion: 2021,
project: ["tsconfig.json"],
},
env: {
es6: true,
node: true,
// we also have some browser code (ie. the preload script)
browser: true,
},
// NOTE: These rules are frozen and new rules should not be added here.
// New changes belong in https://github.com/matrix-org/eslint-plugin-matrix-org/
rules: {
"quotes": "off",
"indent": "off",
"prefer-promise-reject-errors": "off",
"no-async-promise-executor": "off",
},
overrides: [
{
files: ["src/**/*.ts"],
extends: ["plugin:matrix-org/typescript"],
rules: {
// Things we do that break the ideal style
"prefer-promise-reject-errors": "off",
"quotes": "off",
"@typescript-eslint/no-explicit-any": "off",
// We're okay with assertion errors when we ask for them
"@typescript-eslint/no-non-null-assertion": "off",
},
},
],
};

View File

@ -1 +1,5 @@
blank_issues_enabled: false blank_issues_enabled: false
contact_links:
- name: Bug report for the Element flatpak app
url: https://github.com/flathub/im.riot.Riot/issues
about: Please file bugs with the Flatpak application on the respective repository.

View File

@ -5,4 +5,4 @@
- [ ] Ensure your code works with manual testing. - [ ] Ensure your code works with manual testing.
- [ ] New or updated `public`/`exported` symbols have accurate [TSDoc](https://tsdoc.org/) documentation. - [ ] New or updated `public`/`exported` symbols have accurate [TSDoc](https://tsdoc.org/) documentation.
- [ ] Linter and other CI checks pass. - [ ] Linter and other CI checks pass.
- [ ] Sign-off given on the changes (see [CONTRIBUTING.md](https://github.com/vector-im/element-web/blob/develop/CONTRIBUTING.md)). - [ ] I have licensed the changes to Element by completing the [Contributor License Agreement (CLA)](https://cla-assistant.io/element-hq/element-desktop)

View File

@ -10,7 +10,7 @@ on:
jobs: jobs:
backport: backport:
name: Backport name: Backport
runs-on: ubuntu-latest runs-on: ubuntu-24.04
# Only react to merged PRs for security reasons. # Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: > if: >

View File

@ -99,7 +99,7 @@ jobs:
- macos - macos
- linux - linux
- windows - windows
runs-on: ubuntu-latest runs-on: ubuntu-24.04
name: ${{ needs.prepare.outputs.deploy == 'true' && 'Deploy' || 'Deploy (dry-run)' }} name: ${{ needs.prepare.outputs.deploy == 'true' && 'Deploy' || 'Deploy (dry-run)' }}
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
environment: ${{ needs.prepare.outputs.deploy == 'true' && 'packages.element.io' || '' }} environment: ${{ needs.prepare.outputs.deploy == 'true' && 'packages.element.io' || '' }}
@ -252,7 +252,7 @@ jobs:
deploy-ess: deploy-ess:
needs: deploy needs: deploy
runs-on: ubuntu-latest runs-on: ubuntu-24.04
name: Deploy builds to ESS name: Deploy builds to ESS
if: needs.prepare.outputs.deploy == 'true' && github.event_name == 'release' if: needs.prepare.outputs.deploy == 'true' && github.event_name == 'release'
env: env:

View File

@ -53,7 +53,7 @@ jobs:
matrix: matrix:
include: include:
- name: macOS Universal - name: macOS Universal
os: macos-latest os: macos-14
artifact: macos artifact: macos
executable: "/Users/runner/Applications/Element.app/Contents/MacOS/Element" executable: "/Users/runner/Applications/Element.app/Contents/MacOS/Element"
# We need to mount the DMG and copy the app to the Applications folder as a mounted DMG is # We need to mount the DMG and copy the app to the Applications folder as a mounted DMG is
@ -63,31 +63,31 @@ jobs:
rsync -a /Volumes/Element/Element.app ~/Applications/ && rsync -a /Volumes/Element/Element.app ~/Applications/ &&
hdiutil detach /Volumes/Element hdiutil detach /Volumes/Element
- name: "Linux (amd64) (sqlcipher: system)" - name: "Linux (amd64) (sqlcipher: system)"
os: ubuntu-latest os: ubuntu-22.04
artifact: linux-amd64-sqlcipher-system artifact: linux-amd64-sqlcipher-system
executable: "/opt/Element/element-desktop" executable: "/opt/Element/element-desktop"
prepare_cmd: "sudo apt install ./dist/*.deb" prepare_cmd: "sudo apt-get -qq update && sudo apt install ./dist/*.deb"
- name: "Linux (amd64) (sqlcipher: static)" - name: "Linux (amd64) (sqlcipher: static)"
os: ubuntu-latest os: ubuntu-22.04
artifact: linux-amd64-sqlcipher-static artifact: linux-amd64-sqlcipher-static
executable: "/opt/Element/element-desktop" executable: "/opt/Element/element-desktop"
prepare_cmd: "sudo apt install ./dist/*.deb" prepare_cmd: "sudo apt-get -qq update && sudo apt install ./dist/*.deb"
- name: "Linux (arm64) (sqlcipher: system)" - name: "Linux (arm64) (sqlcipher: system)"
os: dind-l-arm64 os: dind-l-arm64
artifact: linux-arm64-sqlcipher-system artifact: linux-arm64-sqlcipher-system
executable: "/opt/Element/element-desktop" executable: "/opt/Element/element-desktop"
prepare_cmd: "sudo apt install -y ./dist/*.deb" prepare_cmd: "sudo apt-get -qq update && sudo apt install -y ./dist/*.deb"
- name: "Linux (arm64) (sqlcipher: static)" - name: "Linux (arm64) (sqlcipher: static)"
os: dind-l-arm64 os: dind-l-arm64
artifact: linux-arm64-sqlcipher-static artifact: linux-arm64-sqlcipher-static
executable: "/opt/Element/element-desktop" executable: "/opt/Element/element-desktop"
prepare_cmd: "sudo apt install -y ./dist/*.deb" prepare_cmd: "sudo apt-get -qq update && sudo apt install -y ./dist/*.deb"
- name: Windows (x86) - name: Windows (x86)
os: windows-latest os: windows-2022
artifact: win-ia32 artifact: win-ia32
executable: "./dist/win-ia32-unpacked/Element.exe" executable: "./dist/win-ia32-unpacked/Element.exe"
- name: Windows (x64) - name: Windows (x64)
os: windows-latest os: windows-2022
artifact: win-x64 artifact: win-x64
executable: "./dist/win-unpacked/Element.exe" executable: "./dist/win-unpacked/Element.exe"
name: Test ${{ matrix.name }} name: Test ${{ matrix.name }}
@ -97,6 +97,9 @@ jobs:
- name: Install Yarn - name: Install Yarn
if: runner.environment == 'self-hosted' if: runner.environment == 'self-hosted'
run: | run: |
# Sanity check that the arch is arm64 as we expect
[[ $(uname -p) == "aarch64" ]] || exit 1
sudo apt-get -qq update sudo apt-get -qq update
sudo apt-get install -y curl sudo apt-get install -y curl
curl -fsSL --create-dirs -o $HOME/bin/yarn https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn-1.22.19.js curl -fsSL --create-dirs -o $HOME/bin/yarn https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn-1.22.19.js
@ -131,6 +134,12 @@ jobs:
# We need sudo on Linux as it is installed in /opt/ # We need sudo on Linux as it is installed in /opt/
RUN_AS: ${{ runner.os == 'Linux' && 'sudo' || '' }} RUN_AS: ${{ runner.os == 'Linux' && 'sudo' || '' }}
- name: Workaround macOS GHA permission issues
if: runner.os == 'macOS'
run: |
sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR IGNORE INTO access VALUES ('kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159,NULL,NULL,'UNUSED',1687786159);"
sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR IGNORE INTO access VALUES ('kTCCServiceMicrophone','/opt/off/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159,NULL,NULL,'UNUSED',1687786159);"
- name: Run tests - name: Run tests
uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a
timeout-minutes: 5 timeout-minutes: 5

View File

@ -26,7 +26,7 @@ jobs:
# We build the hak files on native infrastructure as matrix-seshat fails to cross-compile properly # We build the hak files on native infrastructure as matrix-seshat fails to cross-compile properly
# https://github.com/matrix-org/seshat/issues/135 # https://github.com/matrix-org/seshat/issues/135
hak: hak:
runs-on: ${{ inputs.arch == 'arm64' && 'dind-l-arm64' || 'ubuntu-latest' }} runs-on: ${{ inputs.arch == 'arm64' && 'dind-l-arm64' || 'ubuntu-22.04' }}
env: env:
HAK_DOCKER_IMAGE: ghcr.io/element-hq/element-desktop-dockerbuild HAK_DOCKER_IMAGE: ghcr.io/element-hq/element-desktop-dockerbuild
outputs: outputs:
@ -38,6 +38,9 @@ jobs:
- name: Install missing tools - name: Install missing tools
if: runner.environment == 'self-hosted' if: runner.environment == 'self-hosted'
run: | run: |
# Sanity check that the arch is arm64 as we expect
[[ $(uname -p) == "aarch64" ]] || exit 1
sudo apt-get -qq update sudo apt-get -qq update
# curl for yarn download, git for tj-actions/changed-files, zstd for actions/cache # curl for yarn download, git for tj-actions/changed-files, zstd for actions/cache
sudo apt-get install -y curl git zstd sudo apt-get install -y curl git zstd
@ -109,14 +112,14 @@ jobs:
- name: "Get modified files" - name: "Get modified files"
id: changed_files id: changed_files
if: steps.cache.outputs.cache-hit != 'true' && github.event_name == 'pull_request' if: steps.cache.outputs.cache-hit != 'true' && github.event_name == 'pull_request'
uses: tj-actions/changed-files@d6babd6899969df1a11d14c368283ea4436bca78 # v44 uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c # v45
with: with:
files: | files: |
dockerbuild/** dockerbuild/**
# This allows contributors to test changes to the dockerbuild image within a pull request # This allows contributors to test changes to the dockerbuild image within a pull request
- name: Build docker image - name: Build docker image
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5 uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
if: steps.changed_files.outputs.any_modified == 'true' if: steps.changed_files.outputs.any_modified == 'true'
with: with:
context: dockerbuild context: dockerbuild
@ -141,11 +144,11 @@ jobs:
./scripts/glibc-check.sh $filename ./scripts/glibc-check.sh $filename
done done
env: env:
MAX_VER: 2.28 # buster-era glibc MAX_VER: 2.31 # bullseye-era glibc
build: build:
needs: hak needs: hak
runs-on: ubuntu-latest runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@ -86,7 +86,7 @@ jobs:
run: | run: |
yarn build:universal --publish never yarn build:universal --publish never
env: env:
ED_NOTARYTOOL_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CSC_KEY_PASSWORD }} CSC_KEY_PASSWORD: ${{ secrets.APPLE_CSC_KEY_PASSWORD }}

View File

@ -45,7 +45,7 @@ jobs:
prepare: prepare:
name: Prepare name: Prepare
environment: ${{ inputs.nightly && 'packages.element.io' || '' }} environment: ${{ inputs.nightly && 'packages.element.io' || '' }}
runs-on: ubuntu-latest runs-on: ubuntu-24.04
outputs: outputs:
nightly-version: ${{ steps.versions.outputs.nightly }} nightly-version: ${{ steps.versions.outputs.nightly }}
steps: steps:
@ -65,7 +65,8 @@ jobs:
# We split this out to save the build_* scripts having to do it to make use of `hashFiles` in the cache action # We split this out to save the build_* scripts having to do it to make use of `hashFiles` in the cache action
- name: Generate cache hash files - name: Generate cache hash files
run: | run: |
yarn run --silent electron --version > electronVersion # Add --no-sandbox as otherwise it fails because the helper isn't setuid root. It's only getting the version.
yarn run --silent electron --no-sandbox --version > electronVersion
cat package.json | jq -c .hakDependencies | sha1sum > hakHash cat package.json | jq -c .hakDependencies | sha1sum > hakHash
find hak -type f -print0 | xargs -0 sha1sum >> hakHash find hak -type f -print0 | xargs -0 sha1sum >> hakHash
find scripts/hak -type f -print0 | xargs -0 sha1sum >> hakHash find scripts/hak -type f -print0 | xargs -0 sha1sum >> hakHash
@ -126,8 +127,7 @@ jobs:
BUNDLE_HASH=$(npx asar l webapp.asar | grep /bundles/ | head -n 1 | sed 's|.*/||') BUNDLE_HASH=$(npx asar l webapp.asar | grep /bundles/ | head -n 1 | sed 's|.*/||')
WEBAPP_VERSION=$(./scripts/get-version.ts) WEBAPP_VERSION=$(./scripts/get-version.ts)
WEB_VERSION=${WEBAPP_VERSION:0:12} WEB_VERSION=${WEBAPP_VERSION:0:12}
REACT_VERSION=${WEBAPP_VERSION:19:12} JS_VERSION=${WEBAPP_VERSION:16:12}
JS_VERSION=${WEBAPP_VERSION:35:12}
echo "### Nightly build ${{ steps.versions.outputs.nightly }}" >> $GITHUB_STEP_SUMMARY echo "### Nightly build ${{ steps.versions.outputs.nightly }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY
@ -135,7 +135,6 @@ jobs:
echo "| ----------- | ------- |" >> $GITHUB_STEP_SUMMARY echo "| ----------- | ------- |" >> $GITHUB_STEP_SUMMARY
echo "| Bundle Hash | $BUNDLE_HASH |" >> $GITHUB_STEP_SUMMARY echo "| Bundle Hash | $BUNDLE_HASH |" >> $GITHUB_STEP_SUMMARY
echo "| Element Web | [$WEB_VERSION](https://github.com/element-hq/element-web/commit/$WEB_VERSION) |" >> $GITHUB_STEP_SUMMARY echo "| Element Web | [$WEB_VERSION](https://github.com/element-hq/element-web/commit/$WEB_VERSION) |" >> $GITHUB_STEP_SUMMARY
echo "| React SDK | [$REACT_VERSION](https://github.com/matrix-org/matrix-react-sdk/commit/$REACT_VERSION) |" >> $GITHUB_STEP_SUMMARY
echo "| JS SDK | [$JS_VERSION](https://github.com/matrix-org/matrix-js-sdk/commit/$JS_VERSION) |" >> $GITHUB_STEP_SUMMARY echo "| JS SDK | [$JS_VERSION](https://github.com/matrix-org/matrix-js-sdk/commit/$JS_VERSION) |" >> $GITHUB_STEP_SUMMARY
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4

View File

@ -2,7 +2,7 @@
# Due to this extra care must be taken to only ever run all build_* scripts against the same branch to ensure # Due to this extra care must be taken to only ever run all build_* scripts against the same branch to ensure
# the correct cache scoping, and additional care must be taken to not run untrusted actions on the develop branch. # the correct cache scoping, and additional care must be taken to not run untrusted actions on the develop branch.
# window-latest by default uses the pwsh shell which breaks codeSigningCert in the workflow # Windows GHA runner by default uses the pwsh shell which breaks codeSigningCert in the workflow
defaults: defaults:
run: run:
shell: powershell shell: powershell
@ -30,7 +30,7 @@ on:
description: "Whether to sign & notarise the build, requires 'packages.element.io' environment" description: "Whether to sign & notarise the build, requires 'packages.element.io' environment"
jobs: jobs:
build: build:
runs-on: windows-latest runs-on: windows-2022
environment: ${{ inputs.sign && 'packages.element.io' || '' }} environment: ${{ inputs.sign && 'packages.element.io' || '' }}
env: env:
SIGNTOOL_PATH: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0/x86/signtool.exe" SIGNTOOL_PATH: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0/x86/signtool.exe"

View File

@ -12,7 +12,7 @@ env:
jobs: jobs:
build: build:
name: Docker Build name: Docker Build
runs-on: ubuntu-latest runs-on: ubuntu-24.04
permissions: permissions:
contents: read contents: read
packages: write packages: write
@ -20,15 +20,15 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3 uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3 uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
with: with:
install: true install: true
- name: Log in to the Container registry - name: Log in to the Container registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 uses: docker/login-action@06895751d15a223ec091bea144ad5c7f50d228d0
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
username: ${{ github.actor }} username: ${{ github.actor }}
@ -43,7 +43,7 @@ jobs:
type=ref,event=branch type=ref,event=branch
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5 uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
with: with:
context: dockerbuild context: dockerbuild
push: true push: true

View File

@ -3,8 +3,6 @@ on:
push: push:
branches: [staging] branches: [staging]
workflow_dispatch: {} workflow_dispatch: {}
repository_dispatch:
types: [upstream-release-notify]
concurrency: ${{ github.workflow }} concurrency: ${{ github.workflow }}
jobs: jobs:
draft: draft:

View File

@ -20,14 +20,13 @@ jobs:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
with: with:
final: ${{ inputs.mode == 'final' }} final: ${{ inputs.mode == 'final' }}
include-changes: element-hq/element-web@$VERSION
gpg-fingerprint: ${{ vars.GPG_FINGERPRINT }} gpg-fingerprint: ${{ vars.GPG_FINGERPRINT }}
expected-asset-count: 1 expected-asset-count: 1
check: check:
name: Post release checks name: Post release checks
needs: release needs: release
runs-on: ubuntu-latest runs-on: ubuntu-24.04
steps: steps:
- name: Wait for desktop packaging - name: Wait for desktop packaging
uses: t3chguy/wait-on-check-action@18541021811b56544d90e0f073401c2b99e249d6 # fork uses: t3chguy/wait-on-check-action@18541021811b56544d90e0f073401c2b99e249d6 # fork

View File

@ -6,7 +6,7 @@ on:
jobs: jobs:
ts_lint: ts_lint:
name: "Typescript Syntax Check" name: "Typescript Syntax Check"
runs-on: ubuntu-latest runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -30,7 +30,7 @@ jobs:
js_lint: js_lint:
name: "ESLint" name: "ESLint"
runs-on: ubuntu-latest runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -48,7 +48,7 @@ jobs:
workflow_lint: workflow_lint:
name: "Workflow Lint" name: "Workflow Lint"
runs-on: ubuntu-latest runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -66,7 +66,7 @@ jobs:
analyse_dead_code: analyse_dead_code:
name: "Analyse Dead Code" name: "Analyse Dead Code"
runs-on: ubuntu-latest runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@ -6,7 +6,7 @@ on:
jobs: jobs:
automate-project-columns-next: automate-project-columns-next:
runs-on: ubuntu-latest runs-on: ubuntu-24.04
steps: steps:
- uses: actions/add-to-project@main - uses: actions/add-to-project@main
with: with:

1
.gitignore vendored
View File

@ -17,3 +17,4 @@ node_modules/
yarn-error.log yarn-error.log
/hak/**/*.js /hak/**/*.js
/scripts/hak/**/*.js /scripts/hak/**/*.js
.DS_Store

View File

@ -1,3 +1,347 @@
Changes in [1.11.83](https://github.com/element-hq/element-desktop/releases/tag/v1.11.83) (2024-10-29)
======================================================================================================
## ✨ Features
* [Backport staging] Enable Element Call by default on release instances ([#1954](https://github.com/element-hq/element-desktop/pull/1954)). Contributed by @RiotRobot.
* Enable Element Call by default on release instances ([#28314](https://github.com/element-hq/element-web/pull/28314)). Contributed by @t3chguy.
Changes in [1.11.82](https://github.com/element-hq/element-desktop/releases/tag/v1.11.82) (2024-10-22)
======================================================================================================
## ✨ Features
* Add monochrome tray icon ([#1804](https://github.com/element-hq/element-desktop/pull/1804)). Contributed by @SakiiCode.
* Deduplicate more icons using Compound Design Tokens ([#132](https://github.com/element-hq/matrix-react-sdk/pull/132)). Contributed by @t3chguy.
* Always show link new device flow even if unsupported ([#147](https://github.com/element-hq/matrix-react-sdk/pull/147)). Contributed by @t3chguy.
* Update design of files list in right panel ([#144](https://github.com/element-hq/matrix-react-sdk/pull/144)). Contributed by @t3chguy.
* Remove feature\_dehydration ([#138](https://github.com/element-hq/matrix-react-sdk/pull/138)). Contributed by @florianduros.
* Upgrade emojibase-bindings and remove local handling of emoticon variations ([#127](https://github.com/element-hq/matrix-react-sdk/pull/127)). Contributed by @langleyd.
* Add support for rendering media captions ([#43](https://github.com/element-hq/matrix-react-sdk/pull/43)). Contributed by @tulir.
* Replace composer icons with Compound variants ([#123](https://github.com/element-hq/matrix-react-sdk/pull/123)). Contributed by @t3chguy.
* Tweak default right panel size to be 320px except for maximised widgets at 420px ([#110](https://github.com/element-hq/matrix-react-sdk/pull/110)). Contributed by @t3chguy.
* Add a pinned message badge under a pinned message ([#118](https://github.com/element-hq/matrix-react-sdk/pull/118)). Contributed by @florianduros.
* Ditch right panel tabs and re-add close button ([#99](https://github.com/element-hq/matrix-react-sdk/pull/99)). Contributed by @t3chguy.
* Force verification even for refreshed clients ([#44](https://github.com/element-hq/matrix-react-sdk/pull/44)). Contributed by @dbkr.
* Update emoji text, border and background colour in timeline ([#119](https://github.com/element-hq/matrix-react-sdk/pull/119)). Contributed by @florianduros.
* Disable ICE fallback based on well-known configuration ([#111](https://github.com/element-hq/matrix-react-sdk/pull/111)). Contributed by @t3chguy.
* Remove legacy room header and promote beta room header ([#105](https://github.com/element-hq/matrix-react-sdk/pull/105)). Contributed by @t3chguy.
* Respect `io.element.jitsi` `useFor1To1Calls` in well-known ([#112](https://github.com/element-hq/matrix-react-sdk/pull/112)). Contributed by @t3chguy.
* Use Compound close icon in favour of mishmash of x/close icons ([#108](https://github.com/element-hq/matrix-react-sdk/pull/108)). Contributed by @t3chguy.
## 🐛 Bug Fixes
* Correct typo in option documentation ([#28148](https://github.com/element-hq/element-web/pull/28148)). Contributed by @AndrewKvalheim.
* Revert #124 and #135 ([#139](https://github.com/element-hq/matrix-react-sdk/pull/139)). Contributed by @dbkr.
* Add aria-label to e2e icon ([#136](https://github.com/element-hq/matrix-react-sdk/pull/136)). Contributed by @florianduros.
* Fix bell icons on room list hover being black squares ([#135](https://github.com/element-hq/matrix-react-sdk/pull/135)). Contributed by @dbkr.
* Fix vertical overflow on the mobile register screen ([#137](https://github.com/element-hq/matrix-react-sdk/pull/137)). Contributed by @langleyd.
* Allow to unpin redacted event ([#98](https://github.com/element-hq/matrix-react-sdk/pull/98)). Contributed by @florianduros.
Changes in [1.11.81](https://github.com/element-hq/element-desktop/releases/tag/v1.11.81) (2024-10-15)
======================================================================================================
This release fixes High severity vulnerability CVE-2024-47771 / GHSA-963w-49j9-gxj6.
Changes in [1.11.80](https://github.com/element-hq/element-desktop/releases/tag/v1.11.80) (2024-10-08)
======================================================================================================
## ✨ Features
* enable Element Call on desktop nightly ([#1873](https://github.com/element-hq/element-desktop/pull/1873)). Contributed by @fkwp.
* Add doc for 'force\_verification config option ([#28035](https://github.com/element-hq/element-web/pull/28035)). Contributed by @dbkr.
* Roll back change to device isolation mode ([#104](https://github.com/element-hq/matrix-react-sdk/pull/104)). Contributed by @richvdh.
* Remove right panel toggling behaviour on room header buttons ([#100](https://github.com/element-hq/matrix-react-sdk/pull/100)). Contributed by @t3chguy.
* Improve error display for messages sent from insecure devices ([#93](https://github.com/element-hq/matrix-react-sdk/pull/93)). Contributed by @richvdh.
* Add labs option to exclude unverified devices ([#92](https://github.com/element-hq/matrix-react-sdk/pull/92)). Contributed by @richvdh.
* Improve contrast for timestamps, date separators \& spotlight trigger ([#91](https://github.com/element-hq/matrix-react-sdk/pull/91)). Contributed by @t3chguy.
* Open room settings on room header avatar click ([#88](https://github.com/element-hq/matrix-react-sdk/pull/88)). Contributed by @t3chguy.
* Use `strong` over `b` for improved a11y semantics ([#41](https://github.com/element-hq/matrix-react-sdk/pull/41)). Contributed by @t3chguy.
* Grant Element Call widget capabilities for "raise hand" feature ([#82](https://github.com/element-hq/matrix-react-sdk/pull/82)). Contributed by @AndrewFerr.
* Mobile registration optimizations and tests ([#62](https://github.com/element-hq/matrix-react-sdk/pull/62)). Contributed by @langleyd.
* Ignore chat effect when older than 48h ([#48](https://github.com/element-hq/matrix-react-sdk/pull/48)). Contributed by @florianduros.
## 🐛 Bug Fixes
* Update native OIDC callback url to be RFC8252 compliant ([#28096](https://github.com/element-hq/element-web/pull/28096)). Contributed by @t3chguy.
* Update icons to include transparency ([#28040](https://github.com/element-hq/element-web/pull/28040)). Contributed by @t3chguy.
* Fix default\_widget\_container\_height in sample config ([#28034](https://github.com/element-hq/element-web/pull/28034)). Contributed by @dbkr.
* Fix untranslated keys being rendered in `/help` dialog ([#90](https://github.com/element-hq/matrix-react-sdk/pull/90)). Contributed by @t3chguy.
* Ensure timeline search results are visible even in video rooms ([#96](https://github.com/element-hq/matrix-react-sdk/pull/96)). Contributed by @t3chguy.
* Pop right panel timeline when unmaximising widget to avoid double timeline ([#94](https://github.com/element-hq/matrix-react-sdk/pull/94)). Contributed by @t3chguy.
* Fix accessible label on left panel spotlight trigger ([#87](https://github.com/element-hq/matrix-react-sdk/pull/87)). Contributed by @t3chguy.
* Crypto: fix display of device key ([#86](https://github.com/element-hq/matrix-react-sdk/pull/86)). Contributed by @richvdh.
Changes in [1.11.79](https://github.com/element-hq/element-desktop/releases/tag/v1.11.79) (2024-10-01)
======================================================================================================
* No changes
## ✨ Features
* [Backport staging] Allow joining calls and video rooms without enabling the labs flags ([#106](https://github.com/element-hq/matrix-react-sdk/pull/106)). Contributed by @RiotRobot.
Changes in [1.11.78](https://github.com/element-hq/element-desktop/releases/tag/v1.11.78) (2024-09-24)
======================================================================================================
* No changes
## ✨ Features
* Add Release announcement for the pinning message list ([#46](https://github.com/element-hq/matrix-react-sdk/pull/46)). Contributed by @florianduros.
* Unlabs feature pinning ([#22](https://github.com/element-hq/matrix-react-sdk/pull/22)). Contributed by @florianduros.
* Add mobile registration ([#42](https://github.com/element-hq/matrix-react-sdk/pull/42)). Contributed by @langleyd.
* Add support for `org.matrix.cross_signing_reset` UIA stage flow ([#34](https://github.com/element-hq/matrix-react-sdk/pull/34)). Contributed by @t3chguy.
* Add timezone to user profile ([#20](https://github.com/element-hq/matrix-react-sdk/pull/20)). Contributed by @Half-Shot.
* Add config option to force verification ([#29](https://github.com/element-hq/matrix-react-sdk/pull/29)). Contributed by @dbkr.
* Reduce pinned message banner size ([#28](https://github.com/element-hq/matrix-react-sdk/pull/28)). Contributed by @florianduros.
* Enable message pinning labs by default ([#25](https://github.com/element-hq/matrix-react-sdk/pull/25)). Contributed by @florianduros.
* Remove release announcement of the new header ([#23](https://github.com/element-hq/matrix-react-sdk/pull/23)). Contributed by @florianduros.
## 🐛 Bug Fixes
* Fix timeout type ([#40](https://github.com/element-hq/matrix-react-sdk/pull/40)). Contributed by @dbkr.
* Fix huge usage bandwidth and performance issue of pinned message banner. ([#37](https://github.com/element-hq/matrix-react-sdk/pull/37)). Contributed by @florianduros.
* Reverse order of pinned message list ([#19](https://github.com/element-hq/matrix-react-sdk/pull/19)). Contributed by @florianduros.
Changes in [1.11.77](https://github.com/element-hq/element-desktop/releases/tag/v1.11.77) (2024-09-10)
======================================================================================================
## Licensing
matrix-react-sdk is being forked by Element at https://github.com/element-hq/matrix-react-sdk. Contributions are licensed to Element under a CLA and made available under an AGPLv3.0 or GPLv3.0 license at your choice.
You can read more about this here:
https://matrix.org/blog/2024/08/heart-of-matrix/
https://element.io/blog/sustainable-licensing-at-element-with-agpl/
The Matrix.org Foundation copy of the project will be archived. We don't expect any changes are needed by system administrators. Any updates will be communicated via our usual announcements channels and we are striving to make this as seamless as possible.
## ✨ Features
* Add docs for widget container height option ([#27922](https://github.com/element-hq/element-web/pull/27922)). Contributed by @dbkr.
* Allow user to set timezone ([#12775](https://github.com/matrix-org/matrix-react-sdk/pull/12775)). Contributed by @Timshel.
* Implement download\_file in widget driver ([#12931](https://github.com/matrix-org/matrix-react-sdk/pull/12931)). Contributed by @weeman1337.
* Sort the pinning message list in the same order than the banner. By timeline order. ([#12937](https://github.com/matrix-org/matrix-react-sdk/pull/12937)). Contributed by @florianduros.
* Display pinned messages on a banner at the top of a room ([#12917](https://github.com/matrix-org/matrix-react-sdk/pull/12917)). Contributed by @florianduros.
* Add a config option to control the default widget container height ([#12893](https://github.com/matrix-org/matrix-react-sdk/pull/12893)). Contributed by @dbkr.
* RTE drafts ([#12674](https://github.com/matrix-org/matrix-react-sdk/pull/12674)). Contributed by @langleyd.
* Add thread information in pinned message list ([#12902](https://github.com/matrix-org/matrix-react-sdk/pull/12902)). Contributed by @florianduros.
* Add Pin/Unpin action in quick access of the message action bar ([#12897](https://github.com/matrix-org/matrix-react-sdk/pull/12897)). Contributed by @florianduros.
## 🐛 Bug Fixes
* Fix read receipt animation ([#12923](https://github.com/matrix-org/matrix-react-sdk/pull/12923)). Contributed by @dbkr.
* Display the indicator even with one message in pinned message banner ([#12946](https://github.com/matrix-org/matrix-react-sdk/pull/12946)). Contributed by @florianduros.
* Always display last pinned message on the banner ([#12945](https://github.com/matrix-org/matrix-react-sdk/pull/12945)). Contributed by @florianduros.
* The pinned message banner or list are triggering 🎉 effect. ([#12944](https://github.com/matrix-org/matrix-react-sdk/pull/12944)). Contributed by @florianduros.
* Fix reply message truncation on 2 lines ([#12929](https://github.com/matrix-org/matrix-react-sdk/pull/12929)). Contributed by @florianduros.
* Fix pin/unpin slowness and non refresh from the message action bar ([#12934](https://github.com/matrix-org/matrix-react-sdk/pull/12934)). Contributed by @florianduros.
* Ignore desktop for minimum browser support. ([#12928](https://github.com/matrix-org/matrix-react-sdk/pull/12928)). Contributed by @florianduros.
Changes in [1.11.76](https://github.com/element-hq/element-desktop/releases/tag/v1.11.76) (2024-08-27)
======================================================================================================
## ✨ Features
* Message Pinning: rework the message pinning list in the right panel ([#12825](https://github.com/matrix-org/matrix-react-sdk/pull/12825)). Contributed by @florianduros.
* Tweak UIA postMessage check to work cross-origin ([#12878](https://github.com/matrix-org/matrix-react-sdk/pull/12878)). Contributed by @t3chguy.
* Delayed events (Futures) / MSC4140 for call widget ([#12714](https://github.com/matrix-org/matrix-react-sdk/pull/12714)). Contributed by @AndrewFerr.
* Stop the ongoing ring if another device joins the call session. ([#12866](https://github.com/matrix-org/matrix-react-sdk/pull/12866)). Contributed by @toger5.
* Rich text Editor: Auto-replace plain text emoticons with emoji ([#12828](https://github.com/matrix-org/matrix-react-sdk/pull/12828)). Contributed by @langleyd.
* Clean up editor drafts for unknown rooms ([#12850](https://github.com/matrix-org/matrix-react-sdk/pull/12850)). Contributed by @langleyd.
* Rename general user settings to account ([#12841](https://github.com/matrix-org/matrix-react-sdk/pull/12841)). Contributed by @dbkr.
* Update settings tab icons ([#12867](https://github.com/matrix-org/matrix-react-sdk/pull/12867)). Contributed by @dbkr.
* Disable jump to read receipt button instead of hiding when nothing to jump to ([#12863](https://github.com/matrix-org/matrix-react-sdk/pull/12863)). Contributed by @t3chguy.
## 🐛 Bug Fixes
* Ensure elements on Login page are disabled when in-flight ([#12895](https://github.com/matrix-org/matrix-react-sdk/pull/12895)). Contributed by @t3chguy.
* Hide pinned messages when grouped in timeline when feature pinning is disabled ([#12888](https://github.com/matrix-org/matrix-react-sdk/pull/12888)). Contributed by @florianduros.
* Add chat button on new room header for maximised widgets ([#12882](https://github.com/matrix-org/matrix-react-sdk/pull/12882)). Contributed by @t3chguy.
* Show spinner whilst initial search request is in progress ([#12883](https://github.com/matrix-org/matrix-react-sdk/pull/12883)). Contributed by @t3chguy.
* Fix user menu font ([#12879](https://github.com/matrix-org/matrix-react-sdk/pull/12879)). Contributed by @florianduros.
* Allow selecting text in the right panel topic ([#12870](https://github.com/matrix-org/matrix-react-sdk/pull/12870)). Contributed by @t3chguy.
* Add missing presence indicator to new room header ([#12865](https://github.com/matrix-org/matrix-react-sdk/pull/12865)). Contributed by @t3chguy.
* Fix permissions in release tarballs ([#27904](https://github.com/element-hq/element-web/pull/27904)). Contributed by @t3chguy.
## 🧰 Maintenance
* Update dependencies for MSC4157 ([#27906](https://github.com/element-hq/element-web/pull/27906)). Contributed by @AndrewFerr.
Changes in [1.11.75](https://github.com/element-hq/element-desktop/releases/tag/v1.11.75) (2024-08-20)
======================================================================================================
# Security
- Fixes for [CVE-2024-42369](https://nvd.nist.gov/vuln/detail/CVE-2024-42369) / [GHSA-vhr5-g3pm-49fm](https://github.com/matrix-org/matrix-js-sdk/security/advisories/GHSA-vhr5-g3pm-49fm).
Changes in [1.11.74](https://github.com/element-hq/element-desktop/releases/tag/v1.11.74) (2024-08-13)
======================================================================================================
## ✨ Features
* Update unsupported browser react component to new designs ([#27857](https://github.com/element-hq/element-web/pull/27857)). Contributed by @t3chguy.
* Invite dialog: display MXID on its own line ([#11756](https://github.com/matrix-org/matrix-react-sdk/pull/11756)). Contributed by @AndrewFerr.
* Align RoomSummaryCard styles with Figma ([#12793](https://github.com/matrix-org/matrix-react-sdk/pull/12793)). Contributed by @t3chguy.
* Extract Extensions into their own right panel tab ([#12844](https://github.com/matrix-org/matrix-react-sdk/pull/12844)). Contributed by @t3chguy.
* Remove topic from new room header and expand right panel topic ([#12842](https://github.com/matrix-org/matrix-react-sdk/pull/12842)). Contributed by @t3chguy.
* Rework how the onboarding notifications task works ([#12839](https://github.com/matrix-org/matrix-react-sdk/pull/12839)). Contributed by @t3chguy.
* Update toast styles to match Figma ([#12833](https://github.com/matrix-org/matrix-react-sdk/pull/12833)). Contributed by @t3chguy.
* Warn users on unsupported browsers before they lack features ([#12830](https://github.com/matrix-org/matrix-react-sdk/pull/12830)). Contributed by @t3chguy.
* Add sign out button to settings profile section ([#12666](https://github.com/matrix-org/matrix-react-sdk/pull/12666)). Contributed by @dbkr.
* Remove MatrixRTC realted import ES lint exceptions using a index.ts for matrixrtc ([#12780](https://github.com/matrix-org/matrix-react-sdk/pull/12780)). Contributed by @toger5.
* Fix unwanted ringing of other devices even though the user is already connected to the call. ([#12742](https://github.com/matrix-org/matrix-react-sdk/pull/12742)). Contributed by @toger5.
* Acknowledge `DeviceMute` widget actions ([#12790](https://github.com/matrix-org/matrix-react-sdk/pull/12790)). Contributed by @toger5.
## 🐛 Bug Fixes
* Update Element icons ([#27900](https://github.com/element-hq/element-web/pull/27900)). Contributed by @t3chguy.
* Fix Jitsi by updating device mute updates over postMessage API ([#27858](https://github.com/element-hq/element-web/pull/27858)). Contributed by @t3chguy.
* Fix formatting of rich text emotes ([#12862](https://github.com/matrix-org/matrix-react-sdk/pull/12862)). Contributed by @dbkr.
* Fixed custom emotes background color #27745 ([#12798](https://github.com/matrix-org/matrix-react-sdk/pull/12798)). Contributed by @asimdelvi.
* Ignore permalink\_prefix when serializing pills ([#11726](https://github.com/matrix-org/matrix-react-sdk/pull/11726)). Contributed by @herkulessi.
* Deflake the chat export test ([#12854](https://github.com/matrix-org/matrix-react-sdk/pull/12854)). Contributed by @dbkr.
* Fix alignment of RTL messages ([#12837](https://github.com/matrix-org/matrix-react-sdk/pull/12837)). Contributed by @dbkr.
* Handle media download errors better ([#12848](https://github.com/matrix-org/matrix-react-sdk/pull/12848)). Contributed by @t3chguy.
* Make micIcon display on primary ([#11908](https://github.com/matrix-org/matrix-react-sdk/pull/11908)). Contributed by @kdanielm.
* Fix compound typography font component issues ([#12826](https://github.com/matrix-org/matrix-react-sdk/pull/12826)). Contributed by @t3chguy.
* Allow Chrome page translator to translate messages in rooms ([#11113](https://github.com/matrix-org/matrix-react-sdk/pull/11113)). Contributed by @lukaszpolowczyk.
Changes in [1.11.73](https://github.com/element-hq/element-desktop/releases/tag/v1.11.73) (2024-08-06)
======================================================================================================
Fixes for CVE-2024-42347 / GHSA-f83w-wqhc-cfp4
Changes in [1.11.72](https://github.com/element-hq/element-desktop/releases/tag/v1.11.72) (2024-07-30)
======================================================================================================
## ✨ Features
* Support authenticated media downloads in Desktop too ([#1757](https://github.com/element-hq/element-desktop/pull/1757)). Contributed by @turt2live.
* Polyfill Intl.Segmenter for wider web browser compatibility ([#27803](https://github.com/element-hq/element-web/pull/27803)). Contributed by @dbkr.
* Enable audio/webaudio Modernizr rule ([#27772](https://github.com/element-hq/element-web/pull/27772)). Contributed by @t3chguy.
* Add release announcement for the new room header ([#12802](https://github.com/matrix-org/matrix-react-sdk/pull/12802)). Contributed by @MidhunSureshR.
* Default the room header to on ([#12803](https://github.com/matrix-org/matrix-react-sdk/pull/12803)). Contributed by @MidhunSureshR.
* Update Thread Panel to match latest designs ([#12797](https://github.com/matrix-org/matrix-react-sdk/pull/12797)). Contributed by @t3chguy.
* Close any open modals on logout ([#12777](https://github.com/matrix-org/matrix-react-sdk/pull/12777)). Contributed by @dbkr.
* Iterate design of right panel empty state ([#12796](https://github.com/matrix-org/matrix-react-sdk/pull/12796)). Contributed by @t3chguy.
* Update styling of UserInfo right panel card ([#12788](https://github.com/matrix-org/matrix-react-sdk/pull/12788)). Contributed by @t3chguy.
* Accessibility: Add Landmark navigation ([#12190](https://github.com/matrix-org/matrix-react-sdk/pull/12190)). Contributed by @akirk.
* Let Element Call widget receive m.room.create ([#12710](https://github.com/matrix-org/matrix-react-sdk/pull/12710)). Contributed by @AndrewFerr.
* Let Element Call widget set session memberships ([#12713](https://github.com/matrix-org/matrix-react-sdk/pull/12713)). Contributed by @AndrewFerr.
* Update right panel base card styling to match Compound ([#12768](https://github.com/matrix-org/matrix-react-sdk/pull/12768)). Contributed by @t3chguy.
* Align `widget_build_url_ignore_dm` with call behaviour switch between 1:1 and Widget ([#12760](https://github.com/matrix-org/matrix-react-sdk/pull/12760)). Contributed by @t3chguy.
* Move integrations switch ([#12733](https://github.com/matrix-org/matrix-react-sdk/pull/12733)). Contributed by @dbkr.
* Element-R: Report events with withheld keys separately to Posthog. ([#12755](https://github.com/matrix-org/matrix-react-sdk/pull/12755)). Contributed by @richvdh.
## 🐛 Bug Fixes
* Fix Docker tooling for building native components ([#1779](https://github.com/element-hq/element-desktop/pull/1779)). Contributed by @t3chguy.
* Add a modernizr check for WebAssembly support ([#27776](https://github.com/element-hq/element-web/pull/27776)). Contributed by @dbkr.
* Test for lack of WebAssembly support ([#12792](https://github.com/matrix-org/matrix-react-sdk/pull/12792)). Contributed by @dbkr.
* Fix stray 'account' heading ([#12791](https://github.com/matrix-org/matrix-react-sdk/pull/12791)). Contributed by @dbkr.
* Add test for the unsupported browser screen ([#12787](https://github.com/matrix-org/matrix-react-sdk/pull/12787)). Contributed by @dbkr.
* Fix HTML export test ([#12778](https://github.com/matrix-org/matrix-react-sdk/pull/12778)). Contributed by @dbkr.
* Fix HTML export missing a bunch of Compound variables ([#12774](https://github.com/matrix-org/matrix-react-sdk/pull/12774)). Contributed by @t3chguy.
* Fix inability to change accent colour consistently in custom theming ([#12772](https://github.com/matrix-org/matrix-react-sdk/pull/12772)). Contributed by @t3chguy.
* Fix edge case of landing on 3pid email link with registration disabled ([#12771](https://github.com/matrix-org/matrix-react-sdk/pull/12771)). Contributed by @t3chguy.
Changes in [1.11.71](https://github.com/element-hq/element-desktop/releases/tag/v1.11.71) (2024-07-16)
======================================================================================================
## ✨ Features
* Add Modernizr rule for Intl.Segmenter ([#27677](https://github.com/element-hq/element-web/pull/27677)). Contributed by @t3chguy.
* Add tabs to the right panel ([#12672](https://github.com/matrix-org/matrix-react-sdk/pull/12672)). Contributed by @MidhunSureshR.
* Promote new room header from labs to Beta ([#12739](https://github.com/matrix-org/matrix-react-sdk/pull/12739)). Contributed by @t3chguy.
* Redesign room search interface ([#12677](https://github.com/matrix-org/matrix-react-sdk/pull/12677)). Contributed by @t3chguy.
* Move language settings to 'preferences' ([#12723](https://github.com/matrix-org/matrix-react-sdk/pull/12723)). Contributed by @dbkr.
* New layout selector ui in user settings ([#12676](https://github.com/matrix-org/matrix-react-sdk/pull/12676)). Contributed by @florianduros.
* Prevent Element appearing in system media controls ([#10995](https://github.com/matrix-org/matrix-react-sdk/pull/10995)). Contributed by @SuperKenVery.
* Move the account management button ([#12663](https://github.com/matrix-org/matrix-react-sdk/pull/12663)). Contributed by @dbkr.
* Disable profile controls if the HS doesn't allow them to be set ([#12652](https://github.com/matrix-org/matrix-react-sdk/pull/12652)). Contributed by @dbkr.
* New theme ui in user settings ([#12576](https://github.com/matrix-org/matrix-react-sdk/pull/12576)). Contributed by @florianduros.
* Adjust room header hover transition from 300ms to 200ms ([#12703](https://github.com/matrix-org/matrix-react-sdk/pull/12703)). Contributed by @t3chguy.
* Split out email \& phone number settings to separate components \& move discovery to privacy tab ([#12670](https://github.com/matrix-org/matrix-react-sdk/pull/12670)). Contributed by @dbkr.
## 🐛 Bug Fixes
* Ensure we do not load matrix-react-sdk is a manner which can white-screen ([#27685](https://github.com/element-hq/element-web/pull/27685)). Contributed by @t3chguy.
* Fix incoming call toast crash due to audio refactor ([#12737](https://github.com/matrix-org/matrix-react-sdk/pull/12737)). Contributed by @t3chguy.
* Improve new room header accessibility ([#12725](https://github.com/matrix-org/matrix-react-sdk/pull/12725)). Contributed by @t3chguy.
* Fix closing all modals ([#12728](https://github.com/matrix-org/matrix-react-sdk/pull/12728)). Contributed by @dbkr.
* Fix close button on forgot password flow ([#12732](https://github.com/matrix-org/matrix-react-sdk/pull/12732)). Contributed by @dbkr.
* Don't consider textual characters to be emoji ([#12582](https://github.com/matrix-org/matrix-react-sdk/pull/12582)). Contributed by @robintown.
* Clear autocomplete input on selection accept ([#12709](https://github.com/matrix-org/matrix-react-sdk/pull/12709)). Contributed by @dbkr.
* Fix `Match system theme` toggle ([#12719](https://github.com/matrix-org/matrix-react-sdk/pull/12719)). Contributed by @florianduros.
Changes in [1.11.70](https://github.com/element-hq/element-desktop/releases/tag/v1.11.70) (2024-07-08)
======================================================================================================
## ✨ Features
* Tighten macOS entitlements ([#1731](https://github.com/element-hq/element-desktop/pull/1731)). Contributed by @t3chguy.
* Add SSO redirect option for login page ([#27576](https://github.com/element-hq/element-web/pull/27576)). Contributed by @bartvdbraak.
* Use stable endpoints for MSC3916 ([#27558](https://github.com/element-hq/element-web/pull/27558)). Contributed by @turt2live.
* Switch to Rust crypto stack for all logins ([#12630](https://github.com/matrix-org/matrix-react-sdk/pull/12630)). Contributed by @richvdh.
* Hide voip buttons in group rooms in environments with widgets disabled ([#12664](https://github.com/matrix-org/matrix-react-sdk/pull/12664)). Contributed by @t3chguy.
* Minor tweaks to UserSettings dialog ([#12651](https://github.com/matrix-org/matrix-react-sdk/pull/12651)). Contributed by @florianduros.
* Hide voice call button when redundant ([#12639](https://github.com/matrix-org/matrix-react-sdk/pull/12639)). Contributed by @t3chguy.
* Improve accessibility of the room summary card ([#12586](https://github.com/matrix-org/matrix-react-sdk/pull/12586)). Contributed by @t3chguy.
* Show tooltips on narrow tabbed views ([#12624](https://github.com/matrix-org/matrix-react-sdk/pull/12624)). Contributed by @dbkr.
* Update gfm.css to github-markdown-css ([#12613](https://github.com/matrix-org/matrix-react-sdk/pull/12613)). Contributed by @t3chguy.
* Cache e2eStatus to avoid concerning unencrypted flicker when changing rooms ([#12606](https://github.com/matrix-org/matrix-react-sdk/pull/12606)). Contributed by @t3chguy.
* Tweak copy for user verification toast ([#12605](https://github.com/matrix-org/matrix-react-sdk/pull/12605)). Contributed by @t3chguy.
* Support s tags for strikethrough for Matrix v1.10 ([#12604](https://github.com/matrix-org/matrix-react-sdk/pull/12604)). Contributed by @t3chguy.
## 🐛 Bug Fixes
* Switch debs to use the SQLCipher static version ([#1001](https://github.com/element-hq/element-desktop/pull/1001)). Contributed by @MatMaul.
* Fix "Unable to restore session" error ([#4299](https://github.com/matrix-org/matrix-js-sdk/pull/4299)).
* Fix error when sending encrypted messages in large rooms ([#4297](https://github.com/matrix-org/matrix-js-sdk/pull/4297)).
* Remove redundant copy in deactive uia modal ([#12668](https://github.com/matrix-org/matrix-react-sdk/pull/12668)). Contributed by @t3chguy.
* Fix high contrast theme in settings ([#12649](https://github.com/matrix-org/matrix-react-sdk/pull/12649)). Contributed by @florianduros.
* Fix background on live location sharing footer ([#12629](https://github.com/matrix-org/matrix-react-sdk/pull/12629)). Contributed by @t3chguy.
* Remove outdated iframe sandbox attribute ([#12633](https://github.com/matrix-org/matrix-react-sdk/pull/12633)). Contributed by @t3chguy.
* Remove stray setState which caused encryption state shields to flicker ([#12632](https://github.com/matrix-org/matrix-react-sdk/pull/12632)). Contributed by @t3chguy.
* Fix stray background colour on markdown body ([#12628](https://github.com/matrix-org/matrix-react-sdk/pull/12628)). Contributed by @t3chguy.
* Fix widgets not being cleaned up correctly. ([#12616](https://github.com/matrix-org/matrix-react-sdk/pull/12616)). Contributed by @toger5.
* Add in-progress view to display name EditInPlace ([#12609](https://github.com/matrix-org/matrix-react-sdk/pull/12609)). Contributed by @dbkr.
* Fix config override of other settings levels ([#12593](https://github.com/matrix-org/matrix-react-sdk/pull/12593)). Contributed by @langleyd.
* Don't show 'saved' on display name save error ([#12600](https://github.com/matrix-org/matrix-react-sdk/pull/12600)). Contributed by @dbkr.
Changes in [1.11.69](https://github.com/element-hq/element-desktop/releases/tag/v1.11.69) (2024-06-18)
======================================================================================================
## ✨ Features
* Change avatar setting component to use a menu ([#12585](https://github.com/matrix-org/matrix-react-sdk/pull/12585)). Contributed by @dbkr.
* New user profile UI in User Settings ([#12548](https://github.com/matrix-org/matrix-react-sdk/pull/12548)). Contributed by @dbkr.
* MSC4108 support OIDC QR code login ([#12370](https://github.com/matrix-org/matrix-react-sdk/pull/12370)). Contributed by @t3chguy.
## 🐛 Bug Fixes
* Fix image upload preview size ([#12612](https://github.com/matrix-org/matrix-react-sdk/pull/12612)). Contributed by @RiotRobot.
* Fix screen sharing in recent Chrome (https://github.com/matrix-org/matrix-js-sdk/pull/4243).
* Fix roving tab index crash `compareDocumentPosition` ([#12594](https://github.com/matrix-org/matrix-react-sdk/pull/12594)). Contributed by @t3chguy.
* Keep dialog glass border on narrow screens ([#12591](https://github.com/matrix-org/matrix-react-sdk/pull/12591)). Contributed by @dbkr.
* Add missing a11y label to dismiss onboarding button in room list ([#12587](https://github.com/matrix-org/matrix-react-sdk/pull/12587)). Contributed by @t3chguy.
* Add hover / active state on avatar setting upload button ([#12590](https://github.com/matrix-org/matrix-react-sdk/pull/12590)). Contributed by @dbkr.
* Fix EditInPlace button styles ([#12589](https://github.com/matrix-org/matrix-react-sdk/pull/12589)). Contributed by @dbkr.
* Fix incorrect assumptions about required fields in /search response ([#12575](https://github.com/matrix-org/matrix-react-sdk/pull/12575)). Contributed by @t3chguy.
* Fix display of no avatar in avatar setting controls ([#12558](https://github.com/matrix-org/matrix-react-sdk/pull/12558)). Contributed by @dbkr.
* Element-R: pass pickleKey in as raw key for indexeddb encryption ([#12543](https://github.com/matrix-org/matrix-react-sdk/pull/12543)). Contributed by @richvdh.
Changes in [1.11.68](https://github.com/element-hq/element-desktop/releases/tag/v1.11.68) (2024-06-04) Changes in [1.11.68](https://github.com/element-hq/element-desktop/releases/tag/v1.11.68) (2024-06-04)
====================================================================================================== ======================================================================================================
Updates to Electron 30 Updates to Electron 30

5
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,5 @@
# Contributing code to element-desktop
Everyone is welcome to contribute code to element-desktop, provided that they are willing to license their contributions to Element under a [Contributor License Agreement](https://cla-assistant.io/element-hq/element-desktop) (CLA). This ensures that their contribution will be made available under an OSI-approved open-source license, currently licensed under Affero General Public License v3 (AGPLv3) or General Public License v3 (GPLv3) at your choice.
element-desktop follows the same pattern as element-web, please find more contributing guidelines at https://github.com/vector-im/element-web/blob/develop/CONTRIBUTING.md

201
LICENSE
View File

@ -1,201 +0,0 @@
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.

661
LICENSE-AGPL-3.0 Normal file
View File

@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

674
LICENSE-GPL-3.0 Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -143,6 +143,10 @@ $PROFILE` in which case it becomes `Element-$PROFILE`, or it is using one of
the above created by a pre-1.7 install, in which case it will be `Riot` or the above created by a pre-1.7 install, in which case it will be `Riot` or
`Riot-$PROFILE`. `Riot-$PROFILE`.
You may also specify a different path entirely for the `config.json` file by
providing the `--config $YOUR_CONFIG_JSON_FILE` to the process, or via the
`ELEMENT_DESKTOP_CONFIG_JSON` environment variable.
# Translations # Translations
To add a new translation, head to the [translating doc](https://github.com/vector-im/element-web/blob/develop/docs/translating.md). To add a new translation, head to the [translating doc](https://github.com/vector-im/element-web/blob/develop/docs/translating.md).

View File

@ -1,11 +1,12 @@
# Docker image to facilitate building Element Desktop's native bits using a glibc version with broader compatibility # Docker image to facilitate building Element Desktop's native bits using a glibc version (2.31)
FROM rust:buster # with broader compatibility, down to Debian bullseye & Ubuntu focal.
FROM rust:bullseye
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
RUN curl --proto "=https" -L https://yarnpkg.com/latest.tar.gz | tar xvz && mv yarn-* /yarn && ln -s /yarn/bin/yarn /usr/bin/yarn RUN curl --proto "=https" -L https://yarnpkg.com/latest.tar.gz | tar xvz && mv yarn-* /yarn && ln -s /yarn/bin/yarn /usr/bin/yarn
RUN apt-get -qq update && apt-get -qq dist-upgrade && \ RUN apt-get -qq update && apt-get -y -qq dist-upgrade && \
apt-get -qq install --no-install-recommends \ apt-get -y -qq install --no-install-recommends \
# tclsh is required for building SQLite as part of SQLCipher # tclsh is required for building SQLite as part of SQLCipher
tcl \ tcl \
# libsecret-1-dev is required even for prebuild keytar # libsecret-1-dev is required even for prebuild keytar
@ -18,7 +19,9 @@ RUN ln -s /usr/bin/python3 /usr/bin/python & ln -s /usr/bin/pip3 /usr/bin/pip
ENV DEBUG_COLORS true ENV DEBUG_COLORS true
ENV FORCE_COLOR true ENV FORCE_COLOR true
ENV NODE_VERSION 18.19.0 WORKDIR /project
ENV NODE_VERSION 20.15.1
ARG TARGETOS ARG TARGETOS
ARG TARGETARCH ARG TARGETARCH
COPY setup.sh /setup.sh COPY setup.sh /setup.sh

View File

@ -2,7 +2,7 @@
## Requirements to build native modules ## Requirements to build native modules
We rely on Github Actions `windows-latest` plus a few extra utilities as per [the workflow](https://github.com/vector-im/element-desktop/blob/develop/.github/workflows/build_windows.yaml). We rely on Github Actions `windows-2022` plus a few extra utilities as per [the workflow](https://github.com/vector-im/element-desktop/blob/develop/.github/workflows/build_windows.yaml).
If you want to build native modules, make sure that the following tools are installed on your system. If you want to build native modules, make sure that the following tools are installed on your system.

View File

@ -12,9 +12,6 @@ import { flipFuses, FuseVersion, FuseV1Options } from "@electron/fuses";
* Passes $ED_SIGNTOOL_THUMBPRINT and $ED_SIGNTOOL_SUBJECT_NAME to * Passes $ED_SIGNTOOL_THUMBPRINT and $ED_SIGNTOOL_SUBJECT_NAME to
* build.win.signingHashAlgorithms and build.win.certificateSubjectName respectively if specified. * build.win.signingHashAlgorithms and build.win.certificateSubjectName respectively if specified.
* *
* On macOS:
* Passes $ED_NOTARYTOOL_TEAM_ID to build.mac.notarize.notarize if specified
*
* On Linux: * On Linux:
* Replaces spaces in the product name with dashes as spaces in paths can cause issues * Replaces spaces in the product name with dashes as spaces in paths can cause issues
* Removes libsqlcipher0 recommended dependency if env SQLCIPHER_BUNDLED is asserted. * Removes libsqlcipher0 recommended dependency if env SQLCIPHER_BUNDLED is asserted.
@ -138,6 +135,8 @@ const config: Writable<Configuration> = {
"Replaces: riot-desktop (<< 1.7.0), riot-web (<< 1.7.0)", "Replaces: riot-desktop (<< 1.7.0), riot-web (<< 1.7.0)",
"--deb-field", "--deb-field",
"Breaks: riot-desktop (<< 1.7.0), riot-web (<< 1.7.0)", "Breaks: riot-desktop (<< 1.7.0), riot-web (<< 1.7.0)",
"--deb-pre-depends",
"libc6 (>= 2.31)",
], ],
}, },
mac: { mac: {
@ -177,16 +176,6 @@ if (process.env.ED_SIGNTOOL_SUBJECT_NAME && process.env.ED_SIGNTOOL_THUMBPRINT)
config.win.certificateSha1 = process.env.ED_SIGNTOOL_THUMBPRINT; config.win.certificateSha1 = process.env.ED_SIGNTOOL_THUMBPRINT;
} }
/**
* Allow specifying macOS notary team id via env var
* @param {string} process.env.ED_NOTARYTOOL_TEAM_ID
*/
if (process.env.ED_NOTARYTOOL_TEAM_ID) {
config.mac.notarize = {
teamId: process.env.ED_NOTARYTOOL_TEAM_ID,
};
}
/** /**
* Allow specifying nightly version via env var * Allow specifying nightly version via env var
* @param {string} process.env.ED_NIGHTLY * @param {string} process.env.ED_NIGHTLY

View File

@ -23,7 +23,7 @@
"uisi_autorageshake_app": "element-auto-uisi", "uisi_autorageshake_app": "element-auto-uisi",
"show_labs_settings": true, "show_labs_settings": true,
"room_directory": { "room_directory": {
"servers": ["matrix.org", "gitter.im", "libera.chat"] "servers": ["matrix.org", "gitter.im"]
}, },
"enable_presence_by_hs_url": { "enable_presence_by_hs_url": {
"https://matrix.org": false, "https://matrix.org": false,
@ -51,9 +51,9 @@
"features": { "features": {
"threadsActivityCentre": true, "threadsActivityCentre": true,
"feature_spotlight": true, "feature_spotlight": true,
"feature_group_calls": true,
"feature_video_rooms": true, "feature_video_rooms": true,
"feature_element_call_video_rooms": true, "feature_element_call_video_rooms": true
"feature_new_room_decoration_ui": true
}, },
"setting_defaults": { "setting_defaults": {
"RustCrypto.staged_rollout_percent": 100 "RustCrypto.staged_rollout_percent": 100

View File

@ -22,7 +22,7 @@
"bug_report_endpoint_url": "https://element.io/bugreports/submit", "bug_report_endpoint_url": "https://element.io/bugreports/submit",
"uisi_autorageshake_app": "element-auto-uisi", "uisi_autorageshake_app": "element-auto-uisi",
"room_directory": { "room_directory": {
"servers": ["matrix.org", "gitter.im", "libera.chat"] "servers": ["matrix.org", "gitter.im"]
}, },
"show_labs_settings": false, "show_labs_settings": false,
"enable_presence_by_hs_url": { "enable_presence_by_hs_url": {
@ -47,5 +47,13 @@
"map_style_url": "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx", "map_style_url": "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx",
"setting_defaults": { "setting_defaults": {
"RustCrypto.staged_rollout_percent": 60 "RustCrypto.staged_rollout_percent": 60
},
"features": {
"feature_video_rooms": true,
"feature_group_calls": true,
"feature_element_call_video_rooms": true
},
"element_call": {
"url": "https://call.element.io"
} }
} }

View File

@ -1,44 +1,26 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C. Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 path from "path"; import path from "node:path";
import childProcess from "child_process";
import HakEnv from "../../scripts/hak/hakEnv"; import type HakEnv from "../../scripts/hak/hakEnv.js";
import { DependencyInfo } from "../../scripts/hak/dep"; import type { DependencyInfo } from "../../scripts/hak/dep.js";
export default async function buildKeytar(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> { export default async function buildKeytar(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const env = hakEnv.makeGypEnv(); const env = hakEnv.makeGypEnv();
console.log("Running yarn with env", env); console.log("Running yarn with env", env);
await new Promise<void>((resolve, reject) => { await hakEnv.spawn(
const proc = childProcess.spawn( path.join(moduleInfo.nodeModuleBinDir, "node-gyp"),
path.join(moduleInfo.nodeModuleBinDir, "node-gyp" + (hakEnv.isWin() ? ".cmd" : "")), ["rebuild", "--arch", hakEnv.getTargetArch()],
["rebuild", "--arch", hakEnv.getTargetArch()], {
{ cwd: moduleInfo.moduleBuildDir,
cwd: moduleInfo.moduleBuildDir, env,
env, },
stdio: "inherit", );
// We need shell mode on Windows to be able to launch `.cmd` executables
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
shell: hakEnv.isWin(),
},
);
proc.on("exit", (code) => {
code ? reject(code) : resolve();
});
});
} }

View File

@ -1,39 +1,15 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C. Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 childProcess from "child_process"; import type HakEnv from "../../scripts/hak/hakEnv.js";
import type { DependencyInfo } from "../../scripts/hak/dep.js";
import HakEnv from "../../scripts/hak/hakEnv";
import { DependencyInfo } from "../../scripts/hak/dep";
export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> { export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const tools = [["python", "--version"]]; // node-gyp uses python for reasons beyond comprehension // node-gyp uses python for reasons beyond comprehension
await hakEnv.checkTools([["python", "--version"]]);
for (const tool of tools) {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(tool[0], tool.slice(1), {
stdio: ["ignore"],
});
proc.on("exit", (code) => {
if (code !== 0) {
reject("Can't find " + tool);
} else {
resolve();
}
});
});
}
} }

View File

@ -1,23 +1,13 @@
/* /*
Copyright 2020-2021 The Matrix.org Foundation C.I.C. Copyright 2024 New Vector Ltd.
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 childProcess from "child_process"; import type HakEnv from "../../scripts/hak/hakEnv.js";
import type { DependencyInfo } from "../../scripts/hak/dep.js";
import HakEnv from "../../scripts/hak/hakEnv";
import { DependencyInfo } from "../../scripts/hak/dep";
export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> { export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const env = hakEnv.makeGypEnv(); const env = hakEnv.makeGypEnv();
@ -27,30 +17,18 @@ export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
} }
console.log("Running yarn install"); console.log("Running yarn install");
await new Promise<void>((resolve, reject) => { await hakEnv.spawn("yarn", ["install"], {
const proc = childProcess.spawn("yarn" + (hakEnv.isWin() ? ".cmd" : ""), ["install"], { cwd: moduleInfo.moduleBuildDir,
cwd: moduleInfo.moduleBuildDir, env,
env, shell: true,
shell: true,
stdio: "inherit",
});
proc.on("exit", (code) => {
code ? reject(code) : resolve();
});
}); });
const buildTarget = hakEnv.wantsStaticSqlCipher() ? "build-bundled" : "build"; const buildTarget = hakEnv.wantsStaticSqlCipher() ? "build-bundled" : "build";
console.log("Running yarn build"); console.log("Running yarn build");
await new Promise<void>((resolve, reject) => { await hakEnv.spawn("yarn", ["run", buildTarget], {
const proc = childProcess.spawn("yarn" + (hakEnv.isWin() ? ".cmd" : ""), ["run", buildTarget], { cwd: moduleInfo.moduleBuildDir,
cwd: moduleInfo.moduleBuildDir, env,
env, shell: true,
shell: true,
stdio: "inherit",
});
proc.on("exit", (code) => {
code ? reject(code) : resolve();
});
}); });
} }

View File

@ -1,27 +1,20 @@
/* /*
Copyright 2020-2021 The Matrix.org Foundation C.I.C. Copyright 2024 New Vector Ltd.
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 childProcess from "child_process"; import childProcess from "node:child_process";
import fsProm from "fs/promises"; import fsProm from "node:fs/promises";
import HakEnv from "../../scripts/hak/hakEnv"; import type HakEnv from "../../scripts/hak/hakEnv.js";
import { DependencyInfo } from "../../scripts/hak/dep"; import type { Tool } from "../../scripts/hak/hakEnv.js";
import type { DependencyInfo } from "../../scripts/hak/dep.js";
export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> { export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const tools = [ const tools: Tool[] = [
["rustc", "--version"], ["rustc", "--version"],
["python", "--version"], // node-gyp uses python for reasons beyond comprehension ["python", "--version"], // node-gyp uses python for reasons beyond comprehension
]; ];
@ -33,21 +26,7 @@ export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
} else { } else {
tools.push(["make", "--version"]); tools.push(["make", "--version"]);
} }
await hakEnv.checkTools(tools);
for (const tool of tools) {
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(tool[0], tool.slice(1), {
stdio: ["ignore"],
});
proc.on("exit", (code) => {
if (code !== 0) {
reject("Can't find " + tool);
} else {
resolve();
}
});
});
}
// Ensure Rust target exists (nb. we avoid depending on rustup) // Ensure Rust target exists (nb. we avoid depending on rustup)
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {

View File

@ -2,13 +2,10 @@
"compilerOptions": { "compilerOptions": {
"moduleResolution": "node", "moduleResolution": "node",
"esModuleInterop": true, "esModuleInterop": true,
"target": "es2016", "target": "es2022",
"sourceMap": false, "sourceMap": false,
"strict": true, "strict": true,
"lib": ["es2020"] "lib": ["es2022"]
}, },
"include": ["../scripts/@types/*.d.ts", "./**/*.ts"], "include": ["../scripts/@types/*.d.ts", "./**/*.ts"]
"ts-node": {
"transpileOnly": true
}
} }

View File

@ -2,7 +2,8 @@
"name": "element-desktop", "name": "element-desktop",
"productName": "Element", "productName": "Element",
"main": "lib/electron-main.js", "main": "lib/electron-main.js",
"version": "1.11.68", "exports": "./lib/electron-main.js",
"version": "1.11.83",
"description": "A feature-rich client for Matrix.org", "description": "A feature-rich client for Matrix.org",
"author": "Element", "author": "Element",
"homepage": "https://element.io", "homepage": "https://element.io",
@ -10,7 +11,8 @@
"type": "git", "type": "git",
"url": "https://github.com/vector-im/element-desktop" "url": "https://github.com/vector-im/element-desktop"
}, },
"license": "Apache-2.0", "license": "AGPL-3.0-only OR GPL-3.0-only",
"type": "module",
"files": [], "files": [],
"engines": { "engines": {
"node": ">=18.0.0" "node": ">=18.0.0"
@ -21,20 +23,12 @@
"i18n:lint": "prettier --log-level=silent --write src/i18n/strings/ --ignore-path /dev/null", "i18n:lint": "prettier --log-level=silent --write src/i18n/strings/ --ignore-path /dev/null",
"i18n:diff": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && yarn i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json", "i18n:diff": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && yarn i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
"mkdirs": "mkdirp packages deploys", "mkdirs": "mkdirp packages deploys",
"fetch": "yarn run mkdirs && ts-node scripts/fetch-package.ts", "fetch": "yarn run mkdirs && tsx scripts/fetch-package.ts",
"asar-webapp": "asar p webapp webapp.asar", "asar-webapp": "asar p webapp webapp.asar",
"start": "yarn run build:ts && yarn run build:res && electron .", "start": "yarn run build:ts && yarn run build:res && electron .",
"lint": "yarn lint:types && yarn lint:js && yarn lint:workflows", "lint": "yarn lint:types && yarn lint:js && yarn lint:workflows",
"lint:js": "yarn lint:js:src && yarn lint:js:test && yarn lint:js:scripts && yarn lint:js:hak && prettier --check .", "lint:js": "eslint --max-warnings 0 src hak playwright scripts && prettier --check .",
"lint:js:src": "eslint --max-warnings 0 src", "lint:js-fix": "eslint --fix --max-warnings 0 src hak playwright scripts && prettier --log-level=warn --write .",
"lint:js:test": "eslint --max-warnings 0 --config .eslintrc-test.js playwright",
"lint:js:scripts": "eslint --max-warnings 0 --config .eslintrc-scripts.js scripts",
"lint:js:hak": "eslint --max-warnings 0 --config .eslintrc-hak.js hak",
"lint:js-fix": "yarn lint:js-fix:src &&yarn lint:js-fix:test && yarn lint:js-fix:scripts && yarn lint:js-fix:hak && prettier --log-level=warn --write .",
"lint:js-fix:src": "eslint --fix --max-warnings 0 src",
"lint:js-fix:test": "eslint --fix --max-warnings 0 --config .eslintrc-test.js playwright",
"lint:js-fix:scripts": "eslint --fix --max-warnings 0 --config .eslintrc-scripts.js scripts",
"lint:js-fix:hak": "eslint --fix --max-warnings 0 --config .eslintrc-hak.js hak",
"lint:types": "yarn lint:types:src && yarn lint:types:test && yarn lint:types:scripts && yarn lint:types:hak", "lint:types": "yarn lint:types:src && yarn lint:types:test && yarn lint:types:scripts && yarn lint:types:hak",
"lint:types:src": "tsc --noEmit", "lint:types:src": "tsc --noEmit",
"lint:types:test": "tsc --noEmit -p playwright/tsconfig.json", "lint:types:test": "tsc --noEmit -p playwright/tsconfig.json",
@ -49,13 +43,13 @@
"build:universal": "yarn run build:ts && yarn run build:res && electron-builder --universal", "build:universal": "yarn run build:ts && yarn run build:res && electron-builder --universal",
"build": "yarn run build:ts && yarn run build:res && electron-builder", "build": "yarn run build:ts && yarn run build:res && electron-builder",
"build:ts": "tsc", "build:ts": "tsc",
"build:res": "ts-node scripts/copy-res.ts", "build:res": "tsx scripts/copy-res.ts",
"docker:setup": "docker build --platform linux/amd64 -t element-desktop-dockerbuild dockerbuild", "docker:setup": "docker build --platform linux/amd64 -t element-desktop-dockerbuild dockerbuild",
"docker:build:native": "scripts/in-docker.sh yarn run hak", "docker:build:native": "scripts/in-docker.sh yarn run hak",
"docker:build": "scripts/in-docker.sh yarn run build", "docker:build": "scripts/in-docker.sh yarn run build",
"docker:install": "scripts/in-docker.sh yarn install", "docker:install": "scripts/in-docker.sh yarn install",
"clean": "rimraf webapp.asar dist packages deploys lib", "clean": "rimraf webapp.asar dist packages deploys lib",
"hak": "ts-node scripts/hak/index.ts", "hak": "tsx scripts/hak/index.ts",
"test": "playwright test", "test": "playwright test",
"test:open": "yarn test --ui", "test:open": "yarn test --ui",
"test:screenshots:build": "docker build playwright -t element-desktop-playwright --platform linux/amd64", "test:screenshots:build": "docker build playwright -t element-desktop-playwright --platform linux/amd64",
@ -66,12 +60,11 @@
"auto-launch": "^5.0.5", "auto-launch": "^5.0.5",
"counterpart": "^0.18.6", "counterpart": "^0.18.6",
"electron-clear-data": "^1.0.5", "electron-clear-data": "^1.0.5",
"electron-store": "^8.0.2", "electron-store": "^10.0.0",
"electron-window-state": "^5.0.3", "electron-window-state": "^5.0.3",
"minimist": "^1.2.6", "minimist": "^1.2.6",
"node-fetch": "^2",
"png-to-ico": "^2.1.1", "png-to-ico": "^2.1.1",
"uuid": "^10.0.0" "uuid": "^11.0.0"
}, },
"devDependencies": { "devDependencies": {
"@action-validator/cli": "^0.6.0", "@action-validator/cli": "^0.6.0",
@ -79,52 +72,50 @@
"@babel/core": "^7.18.10", "@babel/core": "^7.18.10",
"@babel/preset-env": "^7.18.10", "@babel/preset-env": "^7.18.10",
"@babel/preset-typescript": "^7.18.6", "@babel/preset-typescript": "^7.18.6",
"@electron/asar": "^3.2.3", "@electron/asar": "3.2.15",
"@electron/fuses": "^1.7.0", "@electron/fuses": "^1.7.0",
"@mapbox/node-pre-gyp": "^1.0.11", "@mapbox/node-pre-gyp": "^1.0.11",
"@playwright/test": "1.44.1", "@playwright/test": "1.48.2",
"@stylistic/eslint-plugin": "^2.9.0",
"@types/auto-launch": "^5.0.1", "@types/auto-launch": "^5.0.1",
"@types/counterpart": "^0.18.1", "@types/counterpart": "^0.18.1",
"@types/minimist": "^1.2.1", "@types/minimist": "^1.2.1",
"@types/mkdirp": "^2.0.0", "@types/node": "18.19.59",
"@types/node": "18.19.34",
"@types/pacote": "^11.1.1", "@types/pacote": "^11.1.1",
"@types/tar": "^6.1.3",
"@types/uuid": "^9.0.2",
"@types/yargs": "^17.0.32", "@types/yargs": "^17.0.32",
"@typescript-eslint/eslint-plugin": "^7.0.0", "@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^7.0.0", "@typescript-eslint/parser": "^8.0.0",
"app-builder-lib": "24.13.3", "app-builder-lib": "25.1.8",
"chokidar": "^3.5.2", "chokidar": "^4.0.0",
"detect-libc": "^2.0.0", "detect-libc": "^2.0.0",
"electron": "^31.0.0", "electron": "^33.0.0",
"electron-builder": "24.13.3", "electron-builder": "25.1.8",
"electron-builder-squirrel-windows": "24.13.3", "electron-builder-squirrel-windows": "25.1.8",
"electron-devtools-installer": "^3.2.0", "electron-devtools-installer": "^3.2.0",
"eslint": "^8.26.0", "eslint": "^8.26.0",
"eslint-config-google": "^0.14.0", "eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^9.0.0", "eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.25.4", "eslint-plugin-import": "^2.25.4",
"eslint-plugin-matrix-org": "^1.0.0", "eslint-plugin-matrix-org": "^2.0.1",
"eslint-plugin-unicorn": "^53.0.0", "eslint-plugin-n": "^17.12.0",
"find-npm-prefix": "^1.0.2", "eslint-plugin-unicorn": "^56.0.0",
"glob": "^10.0.0", "glob": "^11.0.0",
"knip": "^5.0.0", "knip": "^5.0.0",
"matrix-web-i18n": "^3.2.1", "matrix-web-i18n": "^3.2.1",
"mkdirp": "^3.0.0", "mkdirp": "^3.0.0",
"pacote": "^18.0.0", "pacote": "^20.0.0",
"prettier": "^3.0.0", "prettier": "^3.0.0",
"rimraf": "^5.0.0", "rimraf": "^6.0.0",
"tar": "^6.2.1", "tar": "^7.0.0",
"ts-node": "^10.9.1", "tsx": "^4.19.2",
"typescript": "5.4.5" "typescript": "5.5.4"
}, },
"hakDependencies": { "hakDependencies": {
"matrix-seshat": "^4.0.0", "matrix-seshat": "^4.0.0",
"keytar": "^7.9.0" "keytar": "^7.9.0"
}, },
"resolutions": { "resolutions": {
"@types/node": "18.19.34", "@types/node": "18.19.59",
"config-file-ts": "0.2.8-rc1" "config-file-ts": "0.2.8-rc1"
} }
} }

View File

@ -1,17 +1,9 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { defineConfig } from "@playwright/test"; import { defineConfig } from "@playwright/test";
@ -29,5 +21,5 @@ export default defineConfig({
reporter: [["html", { outputFolder: "playwright/html-report" }]], reporter: [["html", { outputFolder: "playwright/html-report" }]],
snapshotDir: "playwright/snapshots", snapshotDir: "playwright/snapshots",
snapshotPathTemplate: "{snapshotDir}/{testFilePath}/{arg}-{platform}{ext}", snapshotPathTemplate: "{snapshotDir}/{testFilePath}/{arg}-{platform}{ext}",
timeout: 10 * 1000, timeout: 30 * 1000,
}); });

View File

@ -1,8 +1,8 @@
FROM mcr.microsoft.com/playwright:v1.44.1-jammy FROM mcr.microsoft.com/playwright:v1.48.2-jammy
WORKDIR /work/element-desktop WORKDIR /work/element-desktop
RUN apt-get update && apt-get -y install xvfb RUN apt-get update && apt-get -y install xvfb && apt-get purge -y --auto-remove && rm -rf /var/lib/apt/lists/*
USER 1000:1000 USER 1000:1000

View File

@ -0,0 +1,44 @@
/*
Copyright 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/
import { resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";
import { test, expect } from "../../element-desktop-test.js";
const __dirname = dirname(fileURLToPath(import.meta.url));
test.describe("App config options", () => {
test.describe("Should load custom config via env", () => {
test.slow();
test.use({
extraEnv: {
ELEMENT_DESKTOP_CONFIG_JSON: resolve(__dirname, "../..", "fixtures/custom-config.json"),
},
});
test("should launch and use configured homeserver", async ({ page }) => {
await page.locator("#matrixchat").waitFor();
await page.locator(".mx_Welcome").waitFor();
await expect(page).toHaveURL("vector://vector/webapp/#/welcome");
await page.getByText("Sign in").click();
await page.getByText("matrix.example.org", { exact: true }).waitFor();
});
});
test.describe("Should load custom config via argument", () => {
test.slow();
test.use({
extraArgs: ["--config", resolve(__dirname, "../..", "fixtures/custom-config.json")],
});
test("should launch and use configured homeserver", async ({ page }) => {
await page.locator("#matrixchat").waitFor();
await page.locator(".mx_Welcome").waitFor();
await expect(page).toHaveURL("vector://vector/webapp/#/welcome");
await page.getByText("Sign in").click();
await page.getByText("matrix.example.org", { exact: true }).waitFor();
});
});
});

View File

@ -1,20 +1,12 @@
/* /*
Copyright 2022 - 2023 The Matrix.org Foundation C.I.C. Copyright 2024 New Vector Ltd.
Copyright 2022, 2023 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { test, expect } from "../../element-desktop-test"; import { test, expect } from "../../element-desktop-test.js";
declare global { declare global {
interface Window { interface Window {

View File

@ -1,25 +1,29 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C. Copyright 2023 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { _electron as electron, test as base, expect as baseExpect, type ElectronApplication } from "@playwright/test"; import { _electron as electron, test as base, expect as baseExpect, type ElectronApplication } from "@playwright/test";
import fs from "node:fs/promises"; import fs from "node:fs/promises";
import path from "node:path"; import path, { dirname } from "node:path";
import os from "node:os"; import os from "node:os";
import { fileURLToPath } from "node:url";
export const test = base.extend<{ app: ElectronApplication; tmpDir: string }>({ interface Fixtures {
app: ElectronApplication;
tmpDir: string;
extraEnv: Record<string, string>;
extraArgs: string[];
}
const __dirname = dirname(fileURLToPath(import.meta.url));
export const test = base.extend<Fixtures>({
extraEnv: {},
extraArgs: [],
// eslint-disable-next-line no-empty-pattern // eslint-disable-next-line no-empty-pattern
tmpDir: async ({}, use) => { tmpDir: async ({}, use) => {
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "element-desktop-tests-")); const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "element-desktop-tests-"));
@ -27,7 +31,7 @@ export const test = base.extend<{ app: ElectronApplication; tmpDir: string }>({
await use(tmpDir); await use(tmpDir);
await fs.rm(tmpDir, { recursive: true }); await fs.rm(tmpDir, { recursive: true });
}, },
app: async ({ tmpDir }, use) => { app: async ({ tmpDir, extraEnv, extraArgs }, use) => {
const args = ["--profile-dir", tmpDir]; const args = ["--profile-dir", tmpDir];
const executablePath = process.env["ELEMENT_DESKTOP_EXECUTABLE"]; const executablePath = process.env["ELEMENT_DESKTOP_EXECUTABLE"];
@ -37,9 +41,12 @@ export const test = base.extend<{ app: ElectronApplication; tmpDir: string }>({
} }
const app = await electron.launch({ const app = await electron.launch({
env: process.env, env: {
...process.env,
...extraEnv,
},
executablePath, executablePath,
args, args: [...args, ...extraArgs],
}); });
app.process().stdout.pipe(process.stdout); app.process().stdout.pipe(process.stdout);

View File

@ -0,0 +1,10 @@
{
"default_server_config": {
"m.homeserver": {
"base_url": "https://matrix.example.org"
},
"m.identity_server": {
"base_url": "https://identity.example.org"
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -3,9 +3,9 @@
"resolveJsonModule": true, "resolveJsonModule": true,
"moduleResolution": "node", "moduleResolution": "node",
"esModuleInterop": true, "esModuleInterop": true,
"target": "es2017", "target": "es2022",
"module": "es2022", "module": "es2022",
"lib": ["ESNext", "es2021", "dom"] "lib": ["es2022", "dom"]
}, },
"include": ["**/*.ts"] "include": ["**/*.ts"]
} }

View File

@ -1,7 +0,0 @@
signing_id: releases@riot.im
subprojects:
element-web:
includeByDefault: true
# Because element-web is not in our dependencies, but the versions
# follow those of this project (well, vice-versa really)
mirrorVersion: true

View File

@ -1,19 +0,0 @@
/*
Copyright 2022 New Vector Ltd
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 "find-npm-prefix" {
export default function findPrefix(dir: string): Promise<string>;
}

View File

@ -1,17 +1,8 @@
/* /*
Copyright 2022 New Vector Ltd Copyright 2022-2024 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 "@mapbox/node-pre-gyp/lib/util/versioning" { declare module "@mapbox/node-pre-gyp/lib/util/versioning" {

View File

@ -1,11 +1,11 @@
#!/usr/bin/env -S npx ts-node #!/usr/bin/env -S npx tsx
// copies resources into the lib directory. // copies resources into the lib directory.
import parseArgs from "minimist"; import parseArgs from "minimist";
import * as chokidar from "chokidar"; import * as chokidar from "chokidar";
import * as path from "path"; import * as path from "node:path";
import * as fs from "fs"; import * as fs from "node:fs";
const argv = parseArgs(process.argv.slice(2), {}); const argv = parseArgs(process.argv.slice(2), {});

View File

@ -1,15 +1,14 @@
#!/usr/bin/env -S npx ts-node --resolveJsonModule #!/usr/bin/env -S npx tsx --resolveJsonModule
import * as path from "path"; import * as path from "node:path";
import { createWriteStream, promises as fs } from "fs"; import { createWriteStream, promises as fs } from "node:fs";
import * as childProcess from "child_process"; import * as childProcess from "node:child_process";
import tar from "tar"; import * as tar from "tar";
import * as asar from "@electron/asar"; import * as asar from "@electron/asar";
import fetch from "node-fetch"; import { promises as stream } from "node:stream";
import { promises as stream } from "stream";
import riotDesktopPackageJson from "../package.json"; import riotDesktopPackageJson from "../package.json";
import { setPackageVersion } from "./set-version"; import { setPackageVersion } from "./set-version.js";
const PUB_KEY_URL = "https://packages.riot.im/element-release-key.asc"; const PUB_KEY_URL = "https://packages.riot.im/element-release-key.asc";
const PACKAGE_URL_PREFIX = "https://github.com/element-hq/element-web/releases/download/"; const PACKAGE_URL_PREFIX = "https://github.com/element-hq/element-web/releases/download/";
@ -28,7 +27,7 @@ async function downloadToFile(url: string, filename: string): Promise<void> {
console.error(e); console.error(e);
try { try {
await fs.unlink(filename); await fs.unlink(filename);
} catch (_) {} } catch {}
throw e; throw e;
} }
} }
@ -125,6 +124,8 @@ async function main(): Promise<number | undefined> {
}); });
fetch(PUB_KEY_URL) fetch(PUB_KEY_URL)
.then((resp) => { .then((resp) => {
if (!resp.ok) throw new Error(`unexpected response ${resp.statusText}`);
if (!resp.body) throw new Error(`unexpected response has no body ${resp.statusText}`);
stream.pipeline(resp.body, gpgProc.stdin!).catch(reject); stream.pipeline(resp.body, gpgProc.stdin!).catch(reject);
}) })
.catch(reject); .catch(reject);
@ -150,14 +151,14 @@ async function main(): Promise<number | undefined> {
await fs.opendir(expectedDeployDir); await fs.opendir(expectedDeployDir);
console.log(expectedDeployDir + "already exists"); console.log(expectedDeployDir + "already exists");
haveDeploy = true; haveDeploy = true;
} catch (e) {} } catch {}
if (!haveDeploy) { if (!haveDeploy) {
const outPath = path.join(pkgDir, filename); const outPath = path.join(pkgDir, filename);
try { try {
await fs.stat(outPath); await fs.stat(outPath);
console.log("Already have " + filename + ": not redownloading"); console.log("Already have " + filename + ": not redownloading");
} catch (e) { } catch {
try { try {
await downloadToFile(url, outPath); await downloadToFile(url, outPath);
} catch (e) { } catch (e) {
@ -170,7 +171,7 @@ async function main(): Promise<number | undefined> {
try { try {
await fs.stat(outPath + ".asc"); await fs.stat(outPath + ".asc");
console.log("Already have " + filename + ".asc: not redownloading"); console.log("Already have " + filename + ".asc: not redownloading");
} catch (e) { } catch {
try { try {
await downloadToFile(url + ".asc", outPath + ".asc"); await downloadToFile(url + ".asc", outPath + ".asc");
} catch (e) { } catch (e) {
@ -206,7 +207,7 @@ async function main(): Promise<number | undefined> {
await fs.stat(ASAR_PATH); await fs.stat(ASAR_PATH);
console.log(ASAR_PATH + " already present: removing"); console.log(ASAR_PATH + " already present: removing");
await fs.unlink(ASAR_PATH); await fs.unlink(ASAR_PATH);
} catch (e) {} } catch {}
if (cfgDir.length) { if (cfgDir.length) {
const configJsonSource = path.join(cfgDir, "config.json"); const configJsonSource = path.join(cfgDir, "config.json");

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S npx ts-node #!/usr/bin/env -S npx tsx
/** /**
* Script to generate incremental Nightly build versions, based on the latest Nightly build version of that kind. * Script to generate incremental Nightly build versions, based on the latest Nightly build version of that kind.

View File

@ -1,10 +1,12 @@
#!/usr/bin/env -S npx ts-node #!/usr/bin/env -S npx tsx
/* /*
* Checks for the presence of a webapp, inspects its version and prints it * Checks for the presence of a webapp, inspects its version and prints it
*/ */
import { versionFromAsar } from "./set-version"; import url from "node:url";
import { versionFromAsar } from "./set-version.js";
async function main(): Promise<number> { async function main(): Promise<number> {
const version = await versionFromAsar(); const version = await versionFromAsar();
@ -13,13 +15,16 @@ async function main(): Promise<number> {
return 0; return 0;
} }
if (require.main === module) { if (import.meta.url.startsWith("file:")) {
main() const modulePath = url.fileURLToPath(import.meta.url);
.then((ret) => { if (process.argv[1] === modulePath) {
process.exit(ret); main()
}) .then((ret) => {
.catch((e) => { process.exit(ret);
console.error(e); })
process.exit(1); .catch((e) => {
}); console.error(e);
process.exit(1);
});
}
} }

View File

@ -1,21 +1,13 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C. Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { DependencyInfo } from "./dep"; import type { DependencyInfo } from "./dep.js";
import HakEnv from "./hakEnv"; import type HakEnv from "./hakEnv.js";
export default async function build(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> { export default async function build(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
await moduleInfo.scripts.build(hakEnv, moduleInfo); await moduleInfo.scripts.build(hakEnv, moduleInfo);

View File

@ -1,21 +1,13 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C. Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { DependencyInfo } from "./dep"; import type { DependencyInfo } from "./dep.js";
import HakEnv from "./hakEnv"; import type HakEnv from "./hakEnv.js";
export default async function check(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> { export default async function check(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
if (moduleInfo.scripts.check) { if (moduleInfo.scripts.check) {

View File

@ -1,24 +1,16 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C. Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 path from "path"; import path from "node:path";
import { rimraf } from "rimraf"; import { rimraf } from "rimraf";
import { DependencyInfo } from "./dep"; import type { DependencyInfo } from "./dep.js";
import HakEnv from "./hakEnv"; import type HakEnv from "./hakEnv.js";
export default async function clean(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> { export default async function clean(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
await rimraf(moduleInfo.moduleDotHakDir); await rimraf(moduleInfo.moduleDotHakDir);

View File

@ -1,28 +1,20 @@
/* /*
Copyright 2020-2021 The Matrix.org Foundation C.I.C. Copyright 2024 New Vector Ltd.
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 path from "path"; import path from "node:path";
import fsProm from "fs/promises"; import fsProm from "node:fs/promises";
import childProcess from "child_process"; import childProcess from "node:child_process";
import { rimraf } from "rimraf"; import { rimraf } from "rimraf";
import { glob } from "glob"; import { glob } from "glob";
import { mkdirp } from "mkdirp"; import { mkdirp } from "mkdirp";
import HakEnv from "./hakEnv"; import type HakEnv from "./hakEnv.js";
import { DependencyInfo } from "./dep"; import type { DependencyInfo } from "./dep.js";
export default async function copy(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> { export default async function copy(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
if (moduleInfo.cfg.prune) { if (moduleInfo.cfg.prune) {

View File

@ -1,20 +1,12 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2021 The Matrix.org Foundation C.I.C. Copyright 2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 HakEnv from "./hakEnv"; import type HakEnv from "./hakEnv.js";
export interface DependencyInfo { export interface DependencyInfo {
name: string; name: string;

View File

@ -1,32 +1,23 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C. Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 fsProm from "fs/promises"; import fsProm from "node:fs/promises";
import childProcess from "child_process";
import pacote from "pacote"; import pacote from "pacote";
import HakEnv from "./hakEnv"; import type HakEnv from "./hakEnv.js";
import { DependencyInfo } from "./dep"; import type { DependencyInfo } from "./dep.js";
export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> { export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
let haveModuleBuildDir; let haveModuleBuildDir;
try { try {
const stats = await fsProm.stat(moduleInfo.moduleBuildDir); const stats = await fsProm.stat(moduleInfo.moduleBuildDir);
haveModuleBuildDir = stats.isDirectory(); haveModuleBuildDir = stats.isDirectory();
} catch (e) { } catch {
haveModuleBuildDir = false; haveModuleBuildDir = false;
} }
@ -40,17 +31,8 @@ export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo):
}); });
console.log("Running yarn install in " + moduleInfo.moduleBuildDir); console.log("Running yarn install in " + moduleInfo.moduleBuildDir);
await new Promise<void>((resolve, reject) => { await hakEnv.spawn("yarn", ["install", "--ignore-scripts"], {
const proc = childProcess.spawn(hakEnv.isWin() ? "yarn.cmd" : "yarn", ["install", "--ignore-scripts"], { cwd: moduleInfo.moduleBuildDir,
stdio: "inherit",
cwd: moduleInfo.moduleBuildDir,
// We need shell mode on Windows to be able to launch `.cmd` executables
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
shell: hakEnv.isWin(),
});
proc.on("exit", (code) => {
code ? reject(code) : resolve();
});
}); });
// also extract another copy to the output directory at this point // also extract another copy to the output directory at this point

View File

@ -1,23 +1,15 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C. Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { mkdirp } from "mkdirp"; import { mkdirp } from "mkdirp";
import { DependencyInfo } from "./dep"; import type { DependencyInfo } from "./dep.js";
import HakEnv from "./hakEnv"; import type HakEnv from "./hakEnv.js";
export default async function fetchDeps(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> { export default async function fetchDeps(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
await mkdirp(moduleInfo.moduleDotHakDir); await mkdirp(moduleInfo.moduleDotHakDir);

View File

@ -1,25 +1,18 @@
/* /*
Copyright 2020-2021 The Matrix.org Foundation C.I.C. Copyright 2024 New Vector Ltd.
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 path from "path"; import path from "node:path";
import os from "os"; import os from "node:os";
import nodePreGypVersioning from "@mapbox/node-pre-gyp/lib/util/versioning"; import nodePreGypVersioning from "@mapbox/node-pre-gyp/lib/util/versioning";
import { getElectronVersionFromInstalled } from "app-builder-lib/out/electron/electronVersion"; import { getElectronVersionFromInstalled } from "app-builder-lib/out/electron/electronVersion.js";
import childProcess, { SpawnOptions } from "node:child_process";
import { Arch, Target, TARGETS, getHost, isHostId, TargetId } from "./target"; import { Arch, Target, TARGETS, getHost, isHostId, TargetId } from "./target.js";
async function getRuntime(projectRoot: string): Promise<string> { async function getRuntime(projectRoot: string): Promise<string> {
const electronVersion = await getElectronVersionFromInstalled(projectRoot); const electronVersion = await getElectronVersionFromInstalled(projectRoot);
@ -35,6 +28,8 @@ async function getRuntimeVersion(projectRoot: string): Promise<string> {
} }
} }
export type Tool = [cmd: string, ...args: string[]];
export default class HakEnv { export default class HakEnv {
public readonly target: Target; public readonly target: Target;
public runtime?: string; public runtime?: string;
@ -97,18 +92,56 @@ export default class HakEnv {
} }
public makeGypEnv(): Record<string, string | undefined> { public makeGypEnv(): Record<string, string | undefined> {
return Object.assign({}, process.env, { return {
...process.env,
npm_config_arch: this.target.arch, npm_config_arch: this.target.arch,
npm_config_target_arch: this.target.arch, npm_config_target_arch: this.target.arch,
npm_config_disturl: "https://electronjs.org/headers", npm_config_disturl: "https://electronjs.org/headers",
npm_config_runtime: this.runtime, npm_config_runtime: this.runtime,
npm_config_target: this.runtimeVersion, npm_config_target: this.runtimeVersion,
npm_config_build_from_source: true, npm_config_build_from_source: "true",
npm_config_devdir: path.join(os.homedir(), ".electron-gyp"), npm_config_devdir: path.join(os.homedir(), ".electron-gyp"),
}); };
} }
public wantsStaticSqlCipher(): boolean { public wantsStaticSqlCipher(): boolean {
return !(this.isLinux() || this.isFreeBSD()) || process.env.SQLCIPHER_BUNDLED == "1"; return !(this.isLinux() || this.isFreeBSD()) || process.env.SQLCIPHER_BUNDLED == "1";
} }
public spawn(
cmd: string,
args: string[],
{ ignoreWinCmdlet, ...options }: SpawnOptions & { ignoreWinCmdlet?: boolean } = {},
): Promise<void> {
return new Promise((resolve, reject) => {
const proc = childProcess.spawn(cmd + (!ignoreWinCmdlet && this.isWin() ? ".cmd" : ""), args, {
stdio: "inherit",
// We need shell mode on Windows to be able to launch `.cmd` executables
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
shell: this.isWin(),
...options,
});
proc.on("exit", (code) => {
if (code) {
reject(code);
} else {
resolve();
}
});
});
}
public async checkTools(tools: Tool[]): Promise<void> {
for (const [tool, ...args] of tools) {
try {
await this.spawn(tool, args, {
ignoreWinCmdlet: true,
stdio: ["ignore"],
shell: false,
});
} catch {
throw new Error(`Can't find ${tool}`);
}
}
}
} }

View File

@ -1,25 +1,19 @@
/* /*
Copyright 2020-2021 The Matrix.org Foundation C.I.C. Copyright 2024 New Vector Ltd.
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 path from "path"; import path, { dirname } from "node:path";
import findNpmPrefix from "find-npm-prefix"; import { fileURLToPath } from "node:url";
import HakEnv from "./hakEnv"; import HakEnv from "./hakEnv.js";
import { TargetId } from "./target"; import type { TargetId } from "./target.js";
import { DependencyInfo } from "./dep"; import type { DependencyInfo } from "./dep.js";
import { loadJsonFile } from "../../src/utils.js";
import packageJson from "../../package.json";
const GENERALCOMMANDS = ["target"]; const GENERALCOMMANDS = ["target"];
@ -36,20 +30,15 @@ const METACOMMANDS: Record<string, string[]> = {
// Scripts valid in a hak.json 'scripts' section // Scripts valid in a hak.json 'scripts' section
const HAKSCRIPTS = ["check", "fetch", "build"]; const HAKSCRIPTS = ["check", "fetch", "build"];
const __dirname = dirname(fileURLToPath(import.meta.url));
async function main(): Promise<void> { async function main(): Promise<void> {
const prefix = await findNpmPrefix(process.cwd()); const prefix = path.join(__dirname, "..", "..");
let packageJson;
try {
packageJson = require(path.join(prefix, "package.json"));
} catch (e) {
console.error("Can't find a package.json!");
process.exit(1);
}
const targetIds: TargetId[] = []; const targetIds: TargetId[] = [];
// Apply `--target <target>` option if specified // Apply `--target <target>` option if specified
// Can be specified multiple times for the copy command to bundle // Can be specified multiple times for the copy command to bundle
// multiple archs into a single universal output module) // multiple arches into a single universal output module)
for (;;) { for (;;) {
// eslint-disable-line no-constant-condition // eslint-disable-line no-constant-condition
const targetIndex = process.argv.indexOf("--target"); const targetIndex = process.argv.indexOf("--target");
@ -74,19 +63,19 @@ async function main(): Promise<void> {
const hakDepsCfg = packageJson.hakDependencies || {}; const hakDepsCfg = packageJson.hakDependencies || {};
for (const dep of Object.keys(hakDepsCfg)) { for (const dep in hakDepsCfg) {
const hakJsonPath = path.join(prefix, "hak", dep, "hak.json"); const hakJsonPath = path.join(prefix, "hak", dep, "hak.json");
let hakJson: Record<string, any>; let hakJson: Record<string, any>;
try { try {
hakJson = await require(hakJsonPath); hakJson = loadJsonFile(hakJsonPath);
} catch (e) { } catch {
console.error("No hak.json found for " + dep + "."); console.error("No hak.json found for " + dep + ".");
console.log("Expecting " + hakJsonPath); console.log("Expecting " + hakJsonPath);
process.exit(1); process.exit(1);
} }
deps[dep] = { deps[dep] = {
name: dep, name: dep,
version: hakDepsCfg[dep], version: hakDepsCfg[dep as keyof typeof hakDepsCfg],
cfg: hakJson, cfg: hakJson,
moduleHakDir: path.join(prefix, "hak", dep), moduleHakDir: path.join(prefix, "hak", dep),
moduleDotHakDir: path.join(hakEnv.dotHakDir, dep), moduleDotHakDir: path.join(hakEnv.dotHakDir, dep),
@ -100,9 +89,9 @@ async function main(): Promise<void> {
}; };
for (const s of HAKSCRIPTS) { for (const s of HAKSCRIPTS) {
if (hakJson.scripts && hakJson.scripts[s]) { if (hakJson.scripts?.[s]) {
const scriptModule = await import(path.join(prefix, "hak", dep, hakJson.scripts[s])); const scriptModule = await import(path.join("file://", prefix, "hak", dep, hakJson.scripts[s]));
if (scriptModule.__esModule) { if (scriptModule.default) {
deps[dep].scripts[s] = scriptModule.default; deps[dep].scripts[s] = scriptModule.default;
} else { } else {
deps[dep].scripts[s] = scriptModule; deps[dep].scripts[s] = scriptModule;

View File

@ -1,26 +1,17 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C. Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 path from "path"; import path from "node:path";
import os from "os"; import os from "node:os";
import fsProm from "fs/promises"; import fsProm from "node:fs/promises";
import childProcess from "child_process";
import HakEnv from "./hakEnv"; import HakEnv from "./hakEnv.js";
import { DependencyInfo } from "./dep"; import { DependencyInfo } from "./dep.js";
export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> { export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const yarnrc = path.join(hakEnv.projectRoot, ".yarnrc"); const yarnrc = path.join(hakEnv.projectRoot, ".yarnrc");
@ -32,7 +23,7 @@ export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo):
// Also we do this for each module which is unnecessary, but meh. // Also we do this for each module which is unnecessary, but meh.
try { try {
await fsProm.stat(yarnrc); await fsProm.stat(yarnrc);
} catch (e) { } catch {
await fsProm.writeFile( await fsProm.writeFile(
yarnrc, yarnrc,
// XXX: 1. This must be absolute, as yarn will resolve link directories // XXX: 1. This must be absolute, as yarn will resolve link directories
@ -47,31 +38,10 @@ export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo):
); );
} }
const yarnCmd = "yarn" + (hakEnv.isWin() ? ".cmd" : ""); await hakEnv.spawn("yarn", ["link"], {
cwd: moduleInfo.moduleOutDir,
await new Promise<void>((resolve, reject) => {
const proc = childProcess.spawn(yarnCmd, ["link"], {
cwd: moduleInfo.moduleOutDir,
stdio: "inherit",
// We need shell mode on Windows to be able to launch `.cmd` executables
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
shell: hakEnv.isWin(),
});
proc.on("exit", (code) => {
code ? reject(code) : resolve();
});
}); });
await hakEnv.spawn("yarn", ["link", moduleInfo.name], {
await new Promise<void>((resolve, reject) => { cwd: hakEnv.projectRoot,
const proc = childProcess.spawn(yarnCmd, ["link", moduleInfo.name], {
cwd: hakEnv.projectRoot,
stdio: "inherit",
// We need shell mode on Windows to be able to launch `.cmd` executables
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
shell: hakEnv.isWin(),
});
proc.on("exit", (code) => {
code ? reject(code) : resolve();
});
}); });
} }

View File

@ -1,17 +1,9 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2021 The Matrix.org Foundation C.I.C. Copyright 2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { GLIBC, MUSL, familySync as processLibC } from "detect-libc"; import { GLIBC, MUSL, familySync as processLibC } from "detect-libc";

View File

@ -1,18 +1,19 @@
#!/usr/bin/env -S npx ts-node #!/usr/bin/env -S npx tsx
/* /*
* Checks for the presence of a webapp, inspects its version and sets the * Checks for the presence of a webapp, inspects its version and sets the
* version metadata of the package to match. * version metadata of the package to match.
*/ */
import { promises as fs } from "fs"; import { promises as fs } from "node:fs";
import * as asar from "@electron/asar"; import * as asar from "@electron/asar";
import * as childProcess from "child_process"; import * as childProcess from "node:child_process";
import * as url from "node:url";
export async function versionFromAsar(): Promise<string> { export async function versionFromAsar(): Promise<string> {
try { try {
await fs.stat("webapp.asar"); await fs.stat("webapp.asar");
} catch (e) { } catch {
throw new Error("No 'webapp.asar' found. Run 'yarn run fetch'"); throw new Error("No 'webapp.asar' found. Run 'yarn run fetch'");
} }
@ -57,13 +58,16 @@ async function main(args: string[]): Promise<number> {
return 0; return 0;
} }
if (require.main === module) { if (import.meta.url.startsWith("file:")) {
main(process.argv.slice(2)) const modulePath = url.fileURLToPath(import.meta.url);
.then((ret) => { if (process.argv[1] === modulePath) {
process.exit(ret); main(process.argv.slice(2))
}) .then((ret) => {
.catch((e) => { process.exit(ret);
console.error(e); })
process.exit(1); .catch((e) => {
}); console.error(e);
process.exit(1);
});
}
} }

View File

@ -1,16 +1,14 @@
{ {
"compilerOptions": { "compilerOptions": {
"resolveJsonModule": true, "resolveJsonModule": true,
"moduleResolution": "node", "moduleResolution": "node16",
"skipLibCheck": true,
"esModuleInterop": true, "esModuleInterop": true,
"target": "es2017", "target": "es2022",
"module": "commonjs", "module": "node16",
"sourceMap": false, "sourceMap": false,
"strict": true, "strict": true,
"lib": ["es2020", "dom"] "lib": ["es2020"]
}, },
"include": ["../src/@types", "./**/*.ts"], "include": ["../src/@types", "./**/*.ts"]
"ts-node": {
"transpileOnly": true
}
} }

View File

@ -0,0 +1,18 @@
/*
Copyright 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/
// import "electron-devtools-installer";
declare module "electron-devtools-installer" {
interface ExtensionReference {
id: string;
electron: string;
}
export const REACT_DEVELOPER_TOOLS: ExtensionReference;
export default function install(extension: ExtensionReference): Promise<string>;
}

View File

@ -1,6 +0,0 @@
import { GlobOptions } from "glob";
declare module "glob" {
// Workaround for @electron/asar importing IOptions instead of GlobOptions
export type IOptions = GlobOptions;
}

View File

@ -1,24 +1,15 @@
/* /*
Copyright 2021 - 2022 New Vector Ltd Copyright 2021-2024 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { BrowserWindow } from "electron"; import { BrowserWindow } from "electron";
import Store from "electron-store"; import Store from "electron-store";
import AutoLaunch from "auto-launch"; import AutoLaunch from "auto-launch";
import { AppLocalization } from "../language-helper"; import { AppLocalization } from "../language-helper.js";
// global type extensions need to use var for whatever reason // global type extensions need to use var for whatever reason
/* eslint-disable no-var */ /* eslint-disable no-var */

View File

@ -1,17 +1,8 @@
/* /*
Copyright 2022 New Vector Ltd Copyright 2022-2024 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 "matrix-seshat" { declare module "matrix-seshat" {

View File

@ -1,20 +1,11 @@
/* /*
Copyright 2023 New Vector Ltd Copyright 2023, 2024 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { Streams } from "electron"; import type { Streams } from "electron";
type DisplayMediaCallback = (streams: Streams) => void; type DisplayMediaCallback = (streams: Streams) => void;

View File

@ -1,47 +1,42 @@
/* /*
Copyright 2018-2024 New Vector Ltd.
Copyright 2017-2019 Michael Telatynski <7t3chguy@gmail.com>
Copyright 2016 Aviral Dasgupta Copyright 2016 Aviral Dasgupta
Copyright 2016 OpenMarket Ltd Copyright 2016 OpenMarket Ltd
Copyright 2017, 2019 Michael Telatynski <7t3chguy@gmail.com>
Copyright 2018 - 2021 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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.
*/ */
// Squirrel on windows starts the app with various flags as hooks to tell us when we've been installed/uninstalled etc. // Squirrel on windows starts the app with various flags as hooks to tell us when we've been installed/uninstalled etc.
import "./squirrelhooks"; import "./squirrelhooks.js";
import { app, BrowserWindow, Menu, autoUpdater, protocol, dialog, Input, Event, session } from "electron"; import { app, BrowserWindow, Menu, autoUpdater, protocol, dialog, Input, Event, session } from "electron";
// eslint-disable-next-line n/file-extension-in-import
import * as Sentry from "@sentry/electron/main"; import * as Sentry from "@sentry/electron/main";
import AutoLaunch from "auto-launch"; import AutoLaunch from "auto-launch";
import path from "path"; import path, { dirname } from "node:path";
import windowStateKeeper from "electron-window-state"; import windowStateKeeper from "electron-window-state";
import Store from "electron-store"; import Store from "electron-store";
import fs, { promises as afs } from "fs"; import fs, { promises as afs } from "node:fs";
import { URL } from "url"; import { URL, fileURLToPath } from "node:url";
import minimist from "minimist"; import minimist from "minimist";
import "./ipc"; import "./ipc.js";
import "./keytar"; import "./keytar.js";
import "./seshat"; import "./seshat.js";
import "./settings"; import "./settings.js";
import * as tray from "./tray"; import * as tray from "./tray.js";
import { buildMenuTemplate } from "./vectormenu"; import { buildMenuTemplate } from "./vectormenu.js";
import webContentsHandler from "./webcontents-handler"; import webContentsHandler from "./webcontents-handler.js";
import * as updater from "./updater"; import * as updater from "./updater.js";
import { getProfileFromDeeplink, protocolInit } from "./protocol"; import { getProfileFromDeeplink, protocolInit } from "./protocol.js";
import { _t, AppLocalization } from "./language-helper"; import { _t, AppLocalization } from "./language-helper.js";
import { setDisplayMediaCallback } from "./displayMediaCallback"; import { setDisplayMediaCallback } from "./displayMediaCallback.js";
import { setupMacosTitleBar } from "./macos-titlebar"; import { setupMacosTitleBar } from "./macos-titlebar.js";
import { loadJsonFile } from "./utils"; import { loadJsonFile } from "./utils.js";
import { setupMediaAuth } from "./media-auth.js";
const __dirname = dirname(fileURLToPath(import.meta.url));
const argv = minimist(process.argv, { const argv = minimist(process.argv, {
alias: { help: "h" }, alias: { help: "h" },
@ -52,6 +47,10 @@ if (argv["help"]) {
console.log(" --profile-dir {path}: Path to where to store the profile."); console.log(" --profile-dir {path}: Path to where to store the profile.");
console.log(" --profile {name}: Name of alternate profile to use, allows for running multiple accounts."); console.log(" --profile {name}: Name of alternate profile to use, allows for running multiple accounts.");
console.log(" --devtools: Install and use react-devtools and react-perf."); console.log(" --devtools: Install and use react-devtools and react-perf.");
console.log(
` --config: Path to the config.json file. May also be specified via the ELEMENT_DESKTOP_CONFIG_JSON environment variable.\n` +
` Otherwise use the default user location '${app.getPath("userData")}'`,
);
console.log(" --no-update: Disable automatic updating."); console.log(" --no-update: Disable automatic updating.");
console.log(" --hidden: Start the application hidden in the system tray."); console.log(" --hidden: Start the application hidden in the system tray.");
console.log(" --help: Displays this help message."); console.log(" --help: Displays this help message.");
@ -59,6 +58,8 @@ if (argv["help"]) {
app.exit(); app.exit();
} }
const LocalConfigLocation = process.env.ELEMENT_DESKTOP_CONFIG_JSON ?? argv["config"];
// Electron creates the user data directory (with just an empty 'Dictionaries' directory...) // Electron creates the user data directory (with just an empty 'Dictionaries' directory...)
// as soon as the app path is set, so pick a random path in it that must exist if it's a // as soon as the app path is set, so pick a random path in it that must exist if it's a
// real user data directory. // real user data directory.
@ -105,7 +106,7 @@ async function tryPaths(name: string, root: string, rawPaths: string[]): Promise
try { try {
await afs.stat(p); await afs.stat(p);
return p + "/"; return p + "/";
} catch (e) {} } catch {}
} }
console.log(`Couldn't find ${name} files in any of: `); console.log(`Couldn't find ${name} files in any of: `);
for (const p of paths) { for (const p of paths) {
@ -145,7 +146,7 @@ async function loadConfig(): Promise<void> {
try { try {
global.vectorConfig = loadJsonFile(asarPath, "config.json"); global.vectorConfig = loadJsonFile(asarPath, "config.json");
} catch (e) { } catch {
// it would be nice to check the error code here and bail if the config // it would be nice to check the error code here and bail if the config
// is unparsable, but we get MODULE_NOT_FOUND in the case of a missing // is unparsable, but we get MODULE_NOT_FOUND in the case of a missing
// file or invalid json, so node is just very unhelpful. // file or invalid json, so node is just very unhelpful.
@ -155,7 +156,9 @@ async function loadConfig(): Promise<void> {
try { try {
// Load local config and use it to override values from the one baked with the build // Load local config and use it to override values from the one baked with the build
const localConfig = loadJsonFile(app.getPath("userData"), "config.json"); const localConfig = LocalConfigLocation
? loadJsonFile(LocalConfigLocation)
: loadJsonFile(app.getPath("userData"), "config.json");
// If the local config has a homeserver defined, don't use the homeserver from the build // If the local config has a homeserver defined, don't use the homeserver from the build
// config. This is to avoid a problem where Riot thinks there are multiple homeservers // config. This is to avoid a problem where Riot thinks there are multiple homeservers
@ -373,14 +376,10 @@ app.on("ready", async () => {
if (argv["devtools"]) { if (argv["devtools"]) {
try { try {
// eslint-disable-next-line @typescript-eslint/no-var-requires const { default: installExt, REACT_DEVELOPER_TOOLS } = await import("electron-devtools-installer");
const { default: installExt, REACT_DEVELOPER_TOOLS, REACT_PERF } = require("electron-devtools-installer");
installExt(REACT_DEVELOPER_TOOLS) installExt(REACT_DEVELOPER_TOOLS)
.then((name: string) => console.log(`Added Extension: ${name}`)) .then((name: string) => console.log(`Added Extension: ${name}`))
.catch((err: unknown) => console.log("An error occurred: ", err)); .catch((err: unknown) => console.log("An error occurred: ", err));
installExt(REACT_PERF)
.then((name: string) => console.log(`Added Extension: ${name}`))
.catch((err: unknown) => console.log("An error occurred: ", err));
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
@ -453,7 +452,7 @@ app.on("ready", async () => {
defaultHeight: 768, defaultHeight: 768,
}); });
const preloadScript = path.normalize(`${__dirname}/preload.js`); const preloadScript = path.normalize(`${__dirname}/preload.cjs`);
global.mainWindow = new BrowserWindow({ global.mainWindow = new BrowserWindow({
// https://www.electronjs.org/docs/faq#the-font-looks-blurry-what-is-this-and-what-can-i-do // https://www.electronjs.org/docs/faq#the-font-looks-blurry-what-is-this-and-what-can-i-do
backgroundColor: "#fff", backgroundColor: "#fff",
@ -549,6 +548,8 @@ app.on("ready", async () => {
global.mainWindow?.webContents.send("openDesktopCapturerSourcePicker"); global.mainWindow?.webContents.send("openDesktopCapturerSourcePicker");
setDisplayMediaCallback(callback); setDisplayMediaCallback(callback);
}); });
setupMediaAuth(global.mainWindow);
}); });
app.on("window-all-closed", () => { app.on("window-all-closed", () => {

View File

@ -20,6 +20,8 @@
}, },
"common": { "common": {
"about": "Over", "about": "Over",
"brand_help": "%(brand)s Hulp",
"help": "Hulp",
"preferences": "Voorkeuren" "preferences": "Voorkeuren"
}, },
"confirm_quit": "Weet u zeker dat u wilt stoppen?", "confirm_quit": "Weet u zeker dat u wilt stoppen?",
@ -55,6 +57,7 @@
}, },
"window_menu": { "window_menu": {
"bring_all_to_front": "Alles naar voren brengen", "bring_all_to_front": "Alles naar voren brengen",
"label": "Venster" "label": "Venster",
"zoom": "Zoom"
} }
} }

View File

@ -1,28 +1,19 @@
/* /*
Copyright 2022 New Vector Ltd Copyright 2022-2024 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { app, autoUpdater, desktopCapturer, ipcMain, powerSaveBlocker, TouchBar, nativeImage } from "electron"; import { app, autoUpdater, desktopCapturer, ipcMain, powerSaveBlocker, TouchBar, nativeImage } from "electron";
import { relaunchApp } from "electron-clear-data"; import { relaunchApp } from "electron-clear-data";
import IpcMainEvent = Electron.IpcMainEvent; import IpcMainEvent = Electron.IpcMainEvent;
import { recordSSOSession } from "./protocol"; import { recordSSOSession } from "./protocol.js";
import { randomArray } from "./utils"; import { randomArray } from "./utils.js";
import { Settings } from "./settings"; import { Settings } from "./settings.js";
import { keytar } from "./keytar"; import { keytar } from "./keytar.js";
import { getDisplayMediaCallback, setDisplayMediaCallback } from "./displayMediaCallback"; import { getDisplayMediaCallback, setDisplayMediaCallback } from "./displayMediaCallback.js";
ipcMain.on("setBadgeCount", function (_ev: IpcMainEvent, count: number): void { ipcMain.on("setBadgeCount", function (_ev: IpcMainEvent, count: number): void {
if (process.platform !== "win32") { if (process.platform !== "win32") {
@ -156,7 +147,7 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
if (ret === null) { if (ret === null) {
ret = await keytar?.getPassword("riot.im", `${args[0]}|${args[1]}`); ret = await keytar?.getPassword("riot.im", `${args[0]}|${args[1]}`);
} }
} catch (e) { } catch {
// if an error is thrown (e.g. keytar can't connect to the keychain), // if an error is thrown (e.g. keytar can't connect to the keychain),
// then return null, which means the default pickle key will be used // then return null, which means the default pickle key will be used
ret = null; ret = null;
@ -168,7 +159,7 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
const pickleKey = await randomArray(32); const pickleKey = await randomArray(32);
await keytar?.setPassword("element.io", `${args[0]}|${args[1]}`, pickleKey); await keytar?.setPassword("element.io", `${args[0]}|${args[1]}`, pickleKey);
ret = pickleKey; ret = pickleKey;
} catch (e) { } catch {
ret = null; ret = null;
} }
break; break;
@ -179,7 +170,7 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
// migrate from riot.im (remove once we think there will no longer be // migrate from riot.im (remove once we think there will no longer be
// logins from the time of riot.im) // logins from the time of riot.im)
await keytar?.deletePassword("riot.im", `${args[0]}|${args[1]}`); await keytar?.deletePassword("riot.im", `${args[0]}|${args[1]}`);
} catch (e) {} } catch {}
break; break;
case "getDesktopCapturerSources": case "getDesktopCapturerSources":
ret = (await desktopCapturer.getSources(args[0])).map((source) => ({ ret = (await desktopCapturer.getSources(args[0])).map((source) => ({

View File

@ -1,25 +1,15 @@
/* /*
Copyright 2022 New Vector Ltd Copyright 2022-2024 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 type * as Keytar from "keytar"; // Hak dependency type import type * as Keytar from "keytar"; // Hak dependency type
let keytar: typeof Keytar | undefined; let keytar: typeof Keytar | undefined;
try { try {
// eslint-disable-next-line @typescript-eslint/no-var-requires keytar = await import("keytar");
keytar = require("keytar");
} catch (e) { } catch (e) {
if ((<NodeJS.ErrnoException>e).code === "MODULE_NOT_FOUND") { if ((<NodeJS.ErrnoException>e).code === "MODULE_NOT_FOUND") {
console.log("Keytar isn't installed; secure key storage is disabled."); console.log("Keytar isn't installed; secure key storage is disabled.");

View File

@ -1,25 +1,20 @@
/* /*
Copyright 2021 New Vector Ltd Copyright 2021-2024 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 counterpart from "counterpart"; import counterpart from "counterpart";
import { TranslationKey as TKey } from "matrix-web-i18n"; import { TranslationKey as TKey } from "matrix-web-i18n";
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import type Store from "electron-store"; import type Store from "electron-store";
import type EN from "./i18n/strings/en_EN.json"; import type EN from "./i18n/strings/en_EN.json";
import { loadJsonFile } from "./utils"; import { loadJsonFile } from "./utils.js";
const __dirname = dirname(fileURLToPath(import.meta.url));
const FALLBACK_LOCALE = "en"; const FALLBACK_LOCALE = "en";

View File

@ -1,20 +1,11 @@
/* /*
Copyright 2023 New Vector Ltd Copyright 2023, 2024 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { BrowserWindow } from "electron"; import type { BrowserWindow } from "electron";
export function setupMacosTitleBar(window: BrowserWindow): void { export function setupMacosTitleBar(window: BrowserWindow): void {
if (process.platform !== "darwin") return; if (process.platform !== "darwin") return;
@ -137,14 +128,9 @@ export function setupMacosTitleBar(window: BrowserWindow): void {
height: 24px; height: 24px;
} }
.mx_RoomView[data-room-header="new"]::before { .mx_RoomView::before {
height: 13px; height: 13px;
} }
.mx_RoomView[data-room-header="legacy"]::before {
height: 27px;
}
`); `);
} }

106
src/media-auth.ts Normal file
View File

@ -0,0 +1,106 @@
/*
Copyright 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/
import { type BrowserWindow, ipcMain, session } from "electron";
/**
* Check for feature support from the server.
* This requires asking the renderer process for supported versions.
*/
async function getSupportedVersions(window: BrowserWindow): Promise<string[]> {
return new Promise((resolve) => {
ipcMain.once("serverSupportedVersions", (_, versionsResponse) => {
resolve(versionsResponse?.versions || []);
});
window.webContents.send("serverSupportedVersions"); // ping now that the listener exists
});
}
/**
* Get the access token for the user.
* This requires asking the renderer process for the access token.
*/
async function getAccessToken(window: BrowserWindow): Promise<string | undefined> {
return new Promise((resolve) => {
ipcMain.once("userAccessToken", (_, accessToken) => {
resolve(accessToken);
});
window.webContents.send("userAccessToken"); // ping now that the listener exists
});
}
/**
* Get the homeserver url
* This requires asking the renderer process for the homeserver url.
*/
async function getHomeserverUrl(window: BrowserWindow): Promise<string> {
return new Promise((resolve) => {
ipcMain.once("homeserverUrl", (_, homeserver) => {
resolve(homeserver);
});
window.webContents.send("homeserverUrl"); // ping now that the listener exists
});
}
export function setupMediaAuth(window: BrowserWindow): void {
session.defaultSession.webRequest.onBeforeRequest(async (req, callback) => {
// This handler emulates the element-web service worker, where URLs are rewritten late in the request
// for backwards compatibility. As authenticated media becomes more prevalent, this should be replaced
// by the app using authenticated URLs from the outset.
try {
const url = new URL(req.url);
if (
!url.pathname.startsWith("/_matrix/media/v3/download") &&
!url.pathname.startsWith("/_matrix/media/v3/thumbnail")
) {
return callback({}); // not a URL we care about
}
const supportedVersions = await getSupportedVersions(window);
// We have to check that the access token is truthy otherwise we'd be intercepting pre-login media request too,
// e.g. those required for SSO button icons.
const accessToken = await getAccessToken(window);
if (supportedVersions.includes("v1.11") && accessToken) {
url.href = url.href.replace(/\/media\/v3\/(.*)\//, "/client/v1/media/$1/");
return callback({ redirectURL: url.toString() });
} else {
return callback({}); // no support == no modification
}
} catch (e) {
console.error(e);
}
});
session.defaultSession.webRequest.onBeforeSendHeaders(async (req, callback) => {
try {
const url = new URL(req.url);
if (!url.pathname.startsWith("/_matrix/client/v1/media")) {
return callback({}); // invoke unmodified
}
// Is this request actually going to the homeserver?
// We don't combine this check with the one above on purpose.
// We're fetching the homeserver url through IPC and should do so
// as sparingly as possible.
const homeserver = await getHomeserverUrl(window);
const isRequestToHomeServer = homeserver && url.origin === new URL(homeserver).origin;
if (!isRequestToHomeServer) {
return callback({}); // invoke unmodified
}
// Only add authorization header to authenticated media URLs. This emulates the service worker
// behaviour in element-web.
const accessToken = await getAccessToken(window);
// `accessToken` can be falsy, but if we're trying to download media without authentication
// then we should expect failure anyway.
const headers = { ...req.requestHeaders, Authorization: `Bearer ${accessToken}` };
return callback({ requestHeaders: headers });
} catch (e) {
console.error(e);
}
});
}

View File

@ -1,19 +1,13 @@
/* /*
Copyright 2018, 2019, 2021 New Vector Ltd Copyright 2024 New Vector Ltd.
Copyright 2018, 2019 , 2021 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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.
*/ */
// This file is compiled to CommonJS rather than ESM otherwise the browser chokes on the import statement.
import { ipcRenderer, contextBridge, IpcRendererEvent } from "electron"; import { ipcRenderer, contextBridge, IpcRendererEvent } from "electron";
// Expose only expected IPC wrapper APIs to the renderer process to avoid // Expose only expected IPC wrapper APIs to the renderer process to avoid
@ -35,6 +29,9 @@ const CHANNELS = [
"userDownloadCompleted", "userDownloadCompleted",
"userDownloadAction", "userDownloadAction",
"openDesktopCapturerSourcePicker", "openDesktopCapturerSourcePicker",
"userAccessToken",
"homeserverUrl",
"serverSupportedVersions",
]; ];
contextBridge.exposeInMainWorld("electron", { contextBridge.exposeInMainWorld("electron", {

View File

@ -1,23 +1,15 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C. Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { app } from "electron"; import { app } from "electron";
import { URL } from "url"; import { URL } from "node:url";
import path from "path"; import path from "node:path";
import fs from "fs"; import fs from "node:fs";
const LEGACY_PROTOCOL = "element"; const LEGACY_PROTOCOL = "element";
const PROTOCOL = "io.element.desktop"; const PROTOCOL = "io.element.desktop";
@ -58,7 +50,7 @@ function readStore(): Record<string, string> {
const s = fs.readFileSync(storePath, { encoding: "utf8" }); const s = fs.readFileSync(storePath, { encoding: "utf8" });
const o = JSON.parse(s); const o = JSON.parse(s);
return typeof o === "object" ? o : {}; return typeof o === "object" ? o : {};
} catch (e) { } catch {
return {}; return {};
} }
} }

View File

@ -1,22 +1,13 @@
/* /*
Copyright 2022 New Vector Ltd Copyright 2022-2024 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { app, ipcMain } from "electron"; import { app, ipcMain } from "electron";
import { promises as afs } from "fs"; import { promises as afs } from "node:fs";
import path from "path"; import path from "node:path";
import type { import type {
Seshat as SeshatType, Seshat as SeshatType,
@ -24,8 +15,8 @@ import type {
ReindexError as ReindexErrorType, ReindexError as ReindexErrorType,
} from "matrix-seshat"; // Hak dependency type } from "matrix-seshat"; // Hak dependency type
import IpcMainEvent = Electron.IpcMainEvent; import IpcMainEvent = Electron.IpcMainEvent;
import { randomArray } from "./utils"; import { randomArray } from "./utils.js";
import { keytar } from "./keytar"; import { keytar } from "./keytar.js";
let seshatSupported = false; let seshatSupported = false;
let Seshat: typeof SeshatType; let Seshat: typeof SeshatType;
@ -33,8 +24,7 @@ let SeshatRecovery: typeof SeshatRecoveryType;
let ReindexError: typeof ReindexErrorType; let ReindexError: typeof ReindexErrorType;
try { try {
// eslint-disable-next-line @typescript-eslint/no-var-requires const seshatModule = await import("matrix-seshat");
const seshatModule = require("matrix-seshat");
Seshat = seshatModule.Seshat; Seshat = seshatModule.Seshat;
SeshatRecovery = seshatModule.SeshatRecovery; SeshatRecovery = seshatModule.SeshatRecovery;
ReindexError = seshatModule.ReindexError; ReindexError = seshatModule.ReindexError;
@ -69,9 +59,17 @@ async function getOrCreatePassphrase(key: string): Promise<string> {
} }
const deleteContents = async (p: string): Promise<void> => { const deleteContents = async (p: string): Promise<void> => {
for (const entry of await afs.readdir(p)) { try {
const curPath = path.join(p, entry); for (const entry of await afs.readdir(p)) {
await afs.unlink(curPath); const curPath = path.join(p, entry);
try {
await afs.unlink(curPath);
} catch (e) {
console.log("Error deleting a file in EventStore directory", e);
}
}
} catch (e) {
console.log("Error reading the files in EventStore directory", e);
} }
}; };
@ -124,10 +122,7 @@ ipcMain.on("seshat", async function (_ev: IpcMainEvent, payload): Promise<void>
// anyways so reindexing it is a waste of time. // anyways so reindexing it is a waste of time.
if (userVersion === 0) { if (userVersion === 0) {
await recoveryIndex.shutdown(); await recoveryIndex.shutdown();
await deleteContents(eventStorePath);
try {
await deleteContents(eventStorePath);
} catch (e) {}
} else { } else {
await recoveryIndex.reindex(); await recoveryIndex.reindex();
} }
@ -156,9 +151,7 @@ ipcMain.on("seshat", async function (_ev: IpcMainEvent, payload): Promise<void>
break; break;
case "deleteEventIndex": { case "deleteEventIndex": {
try { await deleteContents(eventStorePath);
await deleteContents(eventStorePath);
} catch (e) {}
break; break;
} }
@ -273,7 +266,7 @@ ipcMain.on("seshat", async function (_ev: IpcMainEvent, payload): Promise<void>
else { else {
try { try {
ret = await eventIndex.loadCheckpoints(); ret = await eventIndex.loadCheckpoints();
} catch (e) { } catch {
ret = []; ret = [];
} }
} }

View File

@ -1,20 +1,11 @@
/* /*
Copyright 2022 New Vector Ltd Copyright 2022-2024 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 tray from "./tray"; import * as tray from "./tray.js";
interface Setting { interface Setting {
read(): Promise<any>; read(): Promise<any>;

View File

@ -1,21 +1,13 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2017 OpenMarket Ltd Copyright 2017 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 path from "path"; import path from "node:path";
import { spawn } from "child_process"; import { spawn } from "node:child_process";
import { app } from "electron"; import { app } from "electron";
export function getSquirrelExecutable(): string { export function getSquirrelExecutable(): string {

View File

@ -1,27 +1,19 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2017 Karl Glatz <karl@glatz.biz> Copyright 2017 Karl Glatz <karl@glatz.biz>
Copyright 2017 OpenMarket Ltd Copyright 2017 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { app, Tray, Menu, nativeImage } from "electron"; import { app, Tray, Menu, nativeImage } from "electron";
import pngToIco from "png-to-ico"; import pngToIco from "png-to-ico";
import path from "path"; import path from "node:path";
import fs from "fs"; import fs from "node:fs";
import { v5 as uuidv5 } from "uuid"; import { v5 as uuidv5 } from "uuid";
import { _t } from "./language-helper"; import { _t } from "./language-helper.js";
let trayIcon: Tray | null = null; let trayIcon: Tray | null = null;

View File

@ -1,23 +1,14 @@
/* /*
Copyright 2016-2021 New Vector Ltd Copyright 2016-2024 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { app, autoUpdater, ipcMain } from "electron"; import { app, autoUpdater, ipcMain } from "electron";
import fs from "node:fs/promises"; import fs from "node:fs/promises";
import { getSquirrelExecutable } from "./squirrelhooks"; import { getSquirrelExecutable } from "./squirrelhooks.js";
const UPDATE_POLL_INTERVAL_MS = 60 * 60 * 1000; const UPDATE_POLL_INTERVAL_MS = 60 * 60 * 1000;
const INITIAL_UPDATE_DELAY_MS = 30 * 1000; const INITIAL_UPDATE_DELAY_MS = 30 * 1000;
@ -40,8 +31,8 @@ async function safeCheckForUpdate(): Promise<void> {
// To avoid this we check manually whether an update is available and call the // To avoid this we check manually whether an update is available and call the
// autoUpdater.checkForUpdates() when something new is there. // autoUpdater.checkForUpdates() when something new is there.
try { try {
const res = await global.fetch(feedUrl); const res = await fetch(feedUrl);
const { currentRelease } = await res.json(); const { currentRelease } = (await res.json()) as { currentRelease: string };
const latestVersionDownloaded = latestUpdateDownloaded?.releaseName; const latestVersionDownloaded = latestUpdateDownloaded?.releaseName;
console.info( console.info(
`Latest version from release download: ${currentRelease} (current: ${app.getVersion()}, most recent downloaded ${latestVersionDownloaded}})`, `Latest version from release download: ${currentRelease} (current: ${app.getVersion()}, most recent downloaded ${latestVersionDownloaded}})`,
@ -79,7 +70,7 @@ async function pollForUpdates(): Promise<void> {
export async function start(updateBaseUrl: string): Promise<void> { export async function start(updateBaseUrl: string): Promise<void> {
if (!(await available(updateBaseUrl))) return; if (!(await available(updateBaseUrl))) return;
if (updateBaseUrl.slice(-1) !== "/") { if (!updateBaseUrl.endsWith("/")) {
updateBaseUrl = updateBaseUrl + "/"; updateBaseUrl = updateBaseUrl + "/";
} }

View File

@ -1,20 +1,11 @@
/* /*
Copyright 2022 New Vector Ltd Copyright 2022-2024 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 crypto from "crypto"; import crypto from "node:crypto";
import fs from "node:fs"; import fs from "node:fs";
import path from "node:path"; import path from "node:path";

View File

@ -1,22 +1,14 @@
/* /*
Copyright 2024 New Vector Ltd.
Copyright 2016 OpenMarket Ltd Copyright 2016 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { app, shell, Menu, MenuItem, MenuItemConstructorOptions } from "electron"; import { app, shell, Menu, MenuItem, MenuItemConstructorOptions } from "electron";
import { _t } from "./language-helper"; import { _t } from "./language-helper.js";
const isMac = process.platform === "darwin"; const isMac = process.platform === "darwin";

View File

@ -1,17 +1,8 @@
/* /*
Copyright 2021 New Vector Ltd Copyright 2021-2024 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
you may not use this file except in compliance with the License. Please see LICENSE files in the repository root for full details.
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 { import {
@ -30,13 +21,12 @@ import {
IpcMainEvent, IpcMainEvent,
Event, Event,
} from "electron"; } from "electron";
import url from "url"; import url from "node:url";
import fs from "fs"; import fs from "node:fs";
import fetch from "node-fetch"; import { pipeline } from "node:stream/promises";
import { pipeline } from "stream/promises"; import path from "node:path";
import path from "path";
import { _t } from "./language-helper"; import { _t } from "./language-helper.js";
const MAILTO_PREFIX = "mailto:"; const MAILTO_PREFIX = "mailto:";
@ -185,15 +175,18 @@ function onLinkContextMenu(ev: Event, params: ContextMenuParams, webContents: We
ev.preventDefault(); ev.preventDefault();
} }
function cutCopyPasteSelectContextMenus(params: ContextMenuParams): MenuItemConstructorOptions[] { function cutCopyPasteSelectContextMenus(
params: ContextMenuParams,
webContents: WebContents,
): MenuItemConstructorOptions[] {
const options: MenuItemConstructorOptions[] = []; const options: MenuItemConstructorOptions[] = [];
if (params.misspelledWord) { if (params.misspelledWord) {
params.dictionarySuggestions.forEach((word) => { params.dictionarySuggestions.forEach((word) => {
options.push({ options.push({
label: word, label: word,
click: (menuItem, browserWindow) => { click: () => {
browserWindow?.webContents.replaceMisspelling(word); webContents.replaceMisspelling(word);
}, },
}); });
}); });
@ -203,8 +196,8 @@ function cutCopyPasteSelectContextMenus(params: ContextMenuParams): MenuItemCons
}, },
{ {
label: _t("right_click_menu|add_to_dictionary"), label: _t("right_click_menu|add_to_dictionary"),
click: (menuItem, browserWindow) => { click: () => {
browserWindow?.webContents.session.addWordToSpellCheckerDictionary(params.misspelledWord); webContents.session.addWordToSpellCheckerDictionary(params.misspelledWord);
}, },
}, },
{ {
@ -246,8 +239,8 @@ function cutCopyPasteSelectContextMenus(params: ContextMenuParams): MenuItemCons
return options; return options;
} }
function onSelectedContextMenu(ev: Event, params: ContextMenuParams): void { function onSelectedContextMenu(ev: Event, params: ContextMenuParams, webContents: WebContents): void {
const items = cutCopyPasteSelectContextMenus(params); const items = cutCopyPasteSelectContextMenus(params, webContents);
const popupMenu = Menu.buildFromTemplate(items); const popupMenu = Menu.buildFromTemplate(items);
// popup() requires an options object even for no options // popup() requires an options object even for no options
@ -255,12 +248,12 @@ function onSelectedContextMenu(ev: Event, params: ContextMenuParams): void {
ev.preventDefault(); ev.preventDefault();
} }
function onEditableContextMenu(ev: Event, params: ContextMenuParams): void { function onEditableContextMenu(ev: Event, params: ContextMenuParams, webContents: WebContents): void {
const items: MenuItemConstructorOptions[] = [ const items: MenuItemConstructorOptions[] = [
{ role: "undo" }, { role: "undo" },
{ role: "redo", enabled: params.editFlags.canRedo }, { role: "redo", enabled: params.editFlags.canRedo },
{ type: "separator" }, { type: "separator" },
...cutCopyPasteSelectContextMenus(params), ...cutCopyPasteSelectContextMenus(params, webContents),
]; ];
const popupMenu = Menu.buildFromTemplate(items); const popupMenu = Menu.buildFromTemplate(items);
@ -295,9 +288,9 @@ export default (webContents: WebContents): void => {
if (params.linkURL || params.srcURL) { if (params.linkURL || params.srcURL) {
onLinkContextMenu(ev, params, webContents); onLinkContextMenu(ev, params, webContents);
} else if (params.selectionText) { } else if (params.selectionText) {
onSelectedContextMenu(ev, params); onSelectedContextMenu(ev, params, webContents);
} else if (params.isEditable) { } else if (params.isEditable) {
onEditableContextMenu(ev, params); onEditableContextMenu(ev, params, webContents);
} }
}); });

View File

@ -2,17 +2,18 @@
"compilerOptions": { "compilerOptions": {
"resolveJsonModule": true, "resolveJsonModule": true,
"esModuleInterop": true, "esModuleInterop": true,
"module": "commonjs", "module": "node16",
"moduleResolution": "node", "moduleResolution": "node16",
"target": "es2016", "skipLibCheck": true,
"target": "es2022",
"sourceMap": false, "sourceMap": false,
"outDir": "./lib", "outDir": "./lib",
"rootDir": "./src", "rootDir": "./src",
"declaration": true, "declaration": true,
"typeRoots": ["src/@types", "node_modules/@types"], "typeRoots": ["src/@types", "node_modules/@types"],
"lib": ["es2020", "dom"], "lib": ["es2022"],
"types": ["node"], "types": ["node"],
"strict": true "strict": true
}, },
"include": ["./src/**/*.ts"] "include": ["./src/**/*.ts", "./src/**/*.cts"]
} }

5859
yarn.lock

File diff suppressed because it is too large Load Diff