Merge branch 'element-hq:develop' into ownbuild

This commit is contained in:
Germanowl 2024-04-29 12:00:00 +02:00 committed by GitHub
commit b7c31ee2bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 1126 additions and 1041 deletions

View File

@ -242,3 +242,36 @@ jobs:
bucket-api: ${{ vars.CF_R2_S3_API }}
bucket-key-id: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
bucket-access-key: ${{ secrets.CF_R2_TOKEN }}
deploy-ess:
needs: deploy
runs-on: ubuntu-latest
name: Deploy builds to ESS
if: needs.prepare.outputs.deploy == 'true' && github.event_name == 'release'
env:
BUCKET_NAME: "element-desktop-msi.onprem.element.io"
AWS_REGION: "eu-central-1"
permissions:
id-token: write # This is required for requesting the JWT
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::264135176173:role/Push-ElementDesktop-MSI
role-session-name: githubaction-run-${{ github.run_id }}
aws-region: ${{ env.AWS_REGION }}
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: win-*
- name: Copy files to S3
run: |
PREFIX="${VERSION%.*}"
for file in win-*/*.msi; do
filename=$(basename "$file")
aws s3 cp "$file" "s3://${{ env.BUCKET_NAME }}/$PREFIX/$filename"
done
env:
VERSION: ${{ github.event.release.tag_name }}

View File

@ -41,13 +41,13 @@ jobs:
- name: "Get modified files"
id: changed_files
uses: tj-actions/changed-files@800a2825992141ddde1a8bca8ad394cec34d3188 # v42
uses: tj-actions/changed-files@635f118699dd888d737c15018cd30aff2e0274f8 # v44
with:
files: |
dockerbuild/**
- name: Log in to the Container registry
if: steps.changed_files.outputs.any_modified == 'true'
uses: docker/login-action@5139682d94efc37792e6b54386b5b470a68a4737
uses: docker/login-action@5f4866a30a54f16a52d2ecb4a3898e9e424939cf
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
@ -63,7 +63,7 @@ jobs:
- name: Build and push Docker image
if: steps.changed_files.outputs.any_modified == 'true'
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5
with:
context: dockerbuild
push: true

View File

@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@5139682d94efc37792e6b54386b5b470a68a4737
uses: docker/login-action@5f4866a30a54f16a52d2ecb4a3898e9e424939cf
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
@ -35,7 +35,7 @@ jobs:
type=ref,event=branch
- name: Build and push Docker image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5
with:
context: dockerbuild
push: true

View File

@ -1,3 +1,61 @@
Changes in [1.11.65](https://github.com/element-hq/element-desktop/releases/tag/v1.11.65) (2024-04-23)
======================================================================================================
## ✨ Features
* Make empty state copy for TAC depend on the value of the setting ([#12419](https://github.com/matrix-org/matrix-react-sdk/pull/12419)). Contributed by @dbkr.
* Linkify User Interactive Authentication errors ([#12271](https://github.com/matrix-org/matrix-react-sdk/pull/12271)). Contributed by @t3chguy.
* Add support for device dehydration v2 ([#12316](https://github.com/matrix-org/matrix-react-sdk/pull/12316)). Contributed by @uhoreg.
* Replace `SecurityCustomisations` with `CryptoSetupExtension` ([#12342](https://github.com/matrix-org/matrix-react-sdk/pull/12342)). Contributed by @thoraj.
* Add activity toggle for TAC ([#12413](https://github.com/matrix-org/matrix-react-sdk/pull/12413)). Contributed by @dbkr.
* Humanize spell check language labels ([#12409](https://github.com/matrix-org/matrix-react-sdk/pull/12409)). Contributed by @t3chguy.
* Call Guest Access, give user the option to change the acces level so they can generate a call link. ([#12401](https://github.com/matrix-org/matrix-react-sdk/pull/12401)). Contributed by @toger5.
* TAC: Release Announcement ([#12380](https://github.com/matrix-org/matrix-react-sdk/pull/12380)). Contributed by @florianduros.
* Show the call and share button if the user can create a guest link. ([#12385](https://github.com/matrix-org/matrix-react-sdk/pull/12385)). Contributed by @toger5.
* Add analytics for mark all threads unread ([#12384](https://github.com/matrix-org/matrix-react-sdk/pull/12384)). Contributed by @dbkr.
* Add `EventType.RoomEncryption` to the auto approve capabilities of Element Call widgets ([#12386](https://github.com/matrix-org/matrix-react-sdk/pull/12386)). Contributed by @toger5.
## 🐛 Bug Fixes
* Fix link modal not shown after access upgrade ([#12411](https://github.com/matrix-org/matrix-react-sdk/pull/12411)). Contributed by @toger5.
* Fix thread navigation in timeline ([#12412](https://github.com/matrix-org/matrix-react-sdk/pull/12412)). Contributed by @florianduros.
* Fix inability to join a `knock` room via space hierarchy view ([#12404](https://github.com/matrix-org/matrix-react-sdk/pull/12404)). Contributed by @t3chguy.
* Focus the thread panel when clicking on an item in the TAC ([#12410](https://github.com/matrix-org/matrix-react-sdk/pull/12410)). Contributed by @dbkr.
* Fix space hierarchy tile busy state being stuck after join error ([#12405](https://github.com/matrix-org/matrix-react-sdk/pull/12405)). Contributed by @t3chguy.
* Fix room topic in-app links not being handled correctly on topic dialog ([#12406](https://github.com/matrix-org/matrix-react-sdk/pull/12406)). Contributed by @t3chguy.
Changes in [1.11.64](https://github.com/element-hq/element-desktop/releases/tag/v1.11.64) (2024-04-09)
======================================================================================================
## ✨ Features
* Mark all threads as read button ([#12378](https://github.com/matrix-org/matrix-react-sdk/pull/12378)). Contributed by @dbkr.
* Video call meta space ([#12297](https://github.com/matrix-org/matrix-react-sdk/pull/12297)). Contributed by @toger5.
* Add leave room warning for last admin ([#9452](https://github.com/matrix-org/matrix-react-sdk/pull/9452)). Contributed by @Arnei.
* Iterate styles around Link new device via QR ([#12356](https://github.com/matrix-org/matrix-react-sdk/pull/12356)). Contributed by @t3chguy.
* Improve code-splitting of highlight.js and maplibre-gs libs ([#12349](https://github.com/matrix-org/matrix-react-sdk/pull/12349)). Contributed by @t3chguy.
* Use data-mx-color for rainbows ([#12325](https://github.com/matrix-org/matrix-react-sdk/pull/12325)). Contributed by @tulir.
## 🐛 Bug Fixes
* Fix external guest access url for unencrypted rooms ([#12345](https://github.com/matrix-org/matrix-react-sdk/pull/12345)). Contributed by @toger5.
* Fix video rooms not showing share link button ([#12374](https://github.com/matrix-org/matrix-react-sdk/pull/12374)). Contributed by @toger5.
* Fix space topic jumping on hover/focus ([#12377](https://github.com/matrix-org/matrix-react-sdk/pull/12377)). Contributed by @t3chguy.
* Allow popping out a Jitsi widget to respect Desktop `web_base_url` config ([#12376](https://github.com/matrix-org/matrix-react-sdk/pull/12376)). Contributed by @t3chguy.
* Remove the Lazy Loading `InvalidStoreError` Dialogs ([#12358](https://github.com/matrix-org/matrix-react-sdk/pull/12358)). Contributed by @langleyd.
* Improve readability of badges and pills ([#12360](https://github.com/matrix-org/matrix-react-sdk/pull/12360)). Contributed by @robintown.
Changes in [1.11.63](https://github.com/element-hq/element-desktop/releases/tag/v1.11.63) (2024-03-28)
======================================================================================================
This is a hotfix release to fix a couple of issues: one where the client would sometimes call the client/server API to set a push rule in a loop, and one where authentication was not sent for widgets when it should have been.
## 🐛 Bug Fixes
* Revert "Make EC widget theme reactive - Update widget url when the theme changes" ([#12383](https://github.com/matrix-org/matrix-react-sdk/pull/12383)) in order to fix widgets that require authentication.
* Update to hotfixed js-sdk to fix an issue where Element could try to set a push rule in a loop.
Changes in [1.11.62](https://github.com/element-hq/element-desktop/releases/tag/v1.11.62) (2024-03-26)
======================================================================================================
## ✨ Features

View File

@ -1,10 +1,8 @@
const os = require("os");
const fs = require("fs");
const path = require("path");
const Arch = require("electron-builder").Arch;
const { flipFuses, FuseVersion, FuseV1Options } = require("@electron/fuses");
// Typescript conversion blocked on https://github.com/electron-userland/electron-builder/issues/7775
import * as os from "os";
import * as fs from "fs";
import * as path from "path";
import { Arch, Configuration as BaseConfiguration, AfterPackContext } from "electron-builder";
import { flipFuses, FuseVersion, FuseV1Options } from "@electron/fuses";
/**
* This script has different outputs depending on your os platform.
@ -26,24 +24,47 @@ const { flipFuses, FuseVersion, FuseV1Options } = require("@electron/fuses");
const NIGHTLY_APP_ID = "im.riot.nightly";
const NIGHTLY_DEB_NAME = "element-nightly";
const pkg = JSON.parse(fs.readFileSync("package.json", "utf8"));
interface Pkg {
name: string;
productName: string;
description: string;
version: string;
}
type Writable<T> = NonNullable<
T extends Function ? T : T extends object ? { -readonly [K in keyof T]: Writable<T[K]> } : T
>;
const pkg: Pkg = JSON.parse(fs.readFileSync("package.json", "utf8"));
interface Configuration extends BaseConfiguration {
extraMetadata: Partial<Pick<Pkg, "version">> & Omit<Pkg, "version">;
linux: {
desktop: Record<string, string>;
} & BaseConfiguration["linux"];
win: BaseConfiguration["win"];
mac: BaseConfiguration["mac"];
deb: {
fpm: string[];
} & BaseConfiguration["deb"];
}
/**
* @type {import('electron-builder').Configuration}
* @see https://www.electron.build/configuration/configuration
*/
const config = {
const config: Writable<Configuration> = {
appId: "im.riot.app",
asarUnpack: "**/*.node",
afterPack: async (context) => {
afterPack: async (context: AfterPackContext) => {
if (context.electronPlatformName !== "darwin" || context.arch === Arch.universal) {
// Burn in electron fuses for proactive security hardening.
// On macOS, we only do this for the universal package, as the constituent arm64 and amd64 packages are embedded within.
const ext = {
const ext = (<Record<string, string>>{
darwin: ".app",
win32: ".exe",
linux: "",
}[context.electronPlatformName];
})[context.electronPlatformName];
let executableName = context.packager.appInfo.productFilename;
if (context.electronPlatformName === "linux") {
@ -133,10 +154,13 @@ const config = {
icon: "build/icons/icon.icns",
},
win: {
target: ["squirrel"],
target: ["squirrel", "msi"],
signingHashAlgorithms: ["sha256"],
icon: "build/icons/icon.ico",
},
msi: {
perMachine: true,
},
directories: {
output: "dist",
},
@ -212,4 +236,4 @@ if (os.platform() === "linux") {
}
}
exports.default = config;
export default config;

View File

@ -49,10 +49,14 @@
},
"privacy_policy_url": "https://element.io/cookie-policy",
"features": {
"threadsActivityCentre": true,
"feature_spotlight": true,
"feature_video_rooms": true,
"feature_element_call_video_rooms": true
},
"setting_defaults": {
"RustCrypto.staged_rollout_percent": 100
},
"element_call": {
"url": "https://call.element.dev"
},

View File

@ -44,5 +44,8 @@
"api_host": "https://posthog.element.io"
},
"privacy_policy_url": "https://element.io/cookie-policy",
"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": {
"RustCrypto.staged_rollout_percent": 10
}
}

View File

@ -32,6 +32,9 @@ export default async function buildKeytar(hakEnv: HakEnv, moduleInfo: Dependency
cwd: moduleInfo.moduleBuildDir,
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) => {

View File

@ -1,7 +1,7 @@
import { KnipConfig } from "knip";
export default {
entry: ["src/electron-main.ts", "src/preload.ts", "electron-builder.js", ".eslintrc-*.js", "scripts/**", "hak/**"],
entry: ["src/electron-main.ts", "src/preload.ts", "electron-builder.ts", ".eslintrc-*.js", "scripts/**", "hak/**"],
project: ["**/*.{js,ts}"],
ignoreDependencies: [
// Brought in via hak scripts
@ -9,6 +9,7 @@ export default {
"matrix-seshat",
// Needed by `electron-builder`
"electron-builder-squirrel-windows",
"@types/yargs",
// Required for `action-validator`
"@action-validator/*",
],

View File

@ -2,7 +2,7 @@
"name": "element-desktop",
"productName": "Element",
"main": "lib/electron-main.js",
"version": "1.11.62",
"version": "1.11.65",
"description": "A feature-rich client for Matrix.org",
"author": "Element",
"homepage": "https://element.io",
@ -81,21 +81,23 @@
"@babel/preset-typescript": "^7.18.6",
"@electron/asar": "^3.2.3",
"@electron/fuses": "^1.7.0",
"@playwright/test": "1.42.1",
"@mapbox/node-pre-gyp": "^1.0.11",
"@playwright/test": "1.43.1",
"@types/auto-launch": "^5.0.1",
"@types/counterpart": "^0.18.1",
"@types/minimist": "^1.2.1",
"@types/mkdirp": "^1.0.2",
"@types/node": "18.19.21",
"@types/mkdirp": "^2.0.0",
"@types/node": "18.19.28",
"@types/pacote": "^11.1.1",
"@types/tar": "^6.1.3",
"@types/uuid": "^9.0.2",
"@types/yargs": "^17.0.32",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"app-builder-lib": "24.13.3",
"chokidar": "^3.5.2",
"detect-libc": "^2.0.0",
"electron": "^29.0.0",
"electron": "^30.0.0",
"electron-builder": "24.13.3",
"electron-builder-squirrel-windows": "24.13.3",
"electron-devtools-installer": "^3.2.0",
@ -104,25 +106,25 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-matrix-org": "^1.0.0",
"eslint-plugin-unicorn": "^51.0.0",
"eslint-plugin-unicorn": "^52.0.0",
"find-npm-prefix": "^1.0.2",
"glob": "^10.0.0",
"knip": "^5.0.0",
"matrix-web-i18n": "^3.2.1",
"mkdirp": "^3.0.0",
"node-pre-gyp": "^0.17.0",
"pacote": "^17.0.0",
"pacote": "^18.0.0",
"prettier": "^3.0.0",
"rimraf": "^5.0.0",
"tar": "^6.1.2",
"tar": "^6.2.1",
"ts-node": "^10.9.1",
"typescript": "5.3.3"
"typescript": "5.4.5"
},
"hakDependencies": {
"matrix-seshat": "^3.0.1",
"keytar": "^7.9.0"
},
"resolutions": {
"@types/node": "18.19.21"
"@types/node": "18.19.28",
"config-file-ts": "0.2.8-rc1"
}
}

View File

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/playwright:v1.42.1-jammy
FROM mcr.microsoft.com/playwright:v1.43.1-jammy
WORKDIR /work/element-desktop

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
declare module "node-pre-gyp/lib/util/versioning" {
declare module "@mapbox/node-pre-gyp/lib/util/versioning" {
// eslint-disable-next-line @typescript-eslint/naming-convention
export function get_runtime_abi(runtime: string, version: string): string;
}

View File

@ -44,6 +44,9 @@ export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo):
const proc = childProcess.spawn(hakEnv.isWin() ? "yarn.cmd" : "yarn", ["install", "--ignore-scripts"], {
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();

View File

@ -16,18 +16,18 @@ limitations under the License.
import path from "path";
import os from "os";
import nodePreGypVersioning from "node-pre-gyp/lib/util/versioning";
import { getElectronVersion } from "app-builder-lib/out/electron/electronVersion";
import nodePreGypVersioning from "@mapbox/node-pre-gyp/lib/util/versioning";
import { getElectronVersionFromInstalled } from "app-builder-lib/out/electron/electronVersion";
import { Arch, Target, TARGETS, getHost, isHostId, TargetId } from "./target";
async function getRuntime(projectRoot: string): Promise<string> {
const electronVersion = await getElectronVersion(projectRoot);
const electronVersion = await getElectronVersionFromInstalled(projectRoot);
return electronVersion ? "electron" : "node-webkit";
}
async function getRuntimeVersion(projectRoot: string): Promise<string> {
const electronVersion = await getElectronVersion(projectRoot);
const electronVersion = await getElectronVersionFromInstalled(projectRoot);
if (electronVersion) {
return electronVersion;
} else {

View File

@ -53,6 +53,9 @@ export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo):
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();
@ -63,6 +66,9 @@ export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo):
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

@ -32,6 +32,11 @@ export async function setPackageVersion(ver: string): Promise<void> {
"--new-version",
ver,
],
{
// 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: process.platform === "win32",
},
(err) => {
if (err) {
reject(err);

View File

@ -2,6 +2,7 @@
"action": {
"cancel": "ביטול",
"close": "סגור",
"close_brand": "סגור%(brand)s",
"copy": "העתק",
"cut": "גזור",
"delete": "מחק",
@ -19,6 +20,7 @@
},
"common": {
"about": "אודות",
"brand_help": "%(brand)s עזרה",
"help": "עזרה",
"preferences": "העדפות"
},

View File

@ -51,8 +51,8 @@
},
"view_menu": {
"actual_size": "Rozmiar rzeczywisty",
"toggle_developer_tools": "Przełącz na narzędzia deweloperskie",
"toggle_full_screen": "Przełącz na pełny ekran",
"toggle_developer_tools": "Przełącz narzędzia deweloperskie",
"toggle_full_screen": "Przełącz pełny ekran",
"view": "Wyświetl"
},
"window_menu": {

View File

@ -18,12 +18,16 @@ import path from "path";
import { spawn } from "child_process";
import { app } from "electron";
export function getSquirrelExecutable(): string {
return path.resolve(path.dirname(process.execPath), "..", "Update.exe");
}
function runUpdateExe(args: string[]): Promise<void> {
// Invokes Squirrel's Update.exe which will do things for us like create shortcuts
// Note that there's an Update.exe in the app-x.x.x directory and one in the parent
// directory: we need to run the one in the parent directory, because it discovers
// information about the app by inspecting the directory it's run from.
const updateExe = path.resolve(path.dirname(process.execPath), "..", "Update.exe");
const updateExe = getSquirrelExecutable();
console.log(`Spawning '${updateExe}' with args '${args}'`);
return new Promise((resolve) => {
spawn(updateExe, args, {

View File

@ -15,6 +15,9 @@ limitations under the License.
*/
import { app, autoUpdater, ipcMain } from "electron";
import fs from "node:fs/promises";
import { getSquirrelExecutable } from "./squirrelhooks";
const UPDATE_POLL_INTERVAL_MS = 60 * 60 * 1000;
const INITIAL_UPDATE_DELAY_MS = 30 * 1000;
@ -74,10 +77,12 @@ async function pollForUpdates(): Promise<void> {
}
}
export function start(updateBaseUrl: string): void {
export async function start(updateBaseUrl: string): Promise<void> {
if (!(await available(updateBaseUrl))) return;
if (updateBaseUrl.slice(-1) !== "/") {
updateBaseUrl = updateBaseUrl + "/";
}
try {
let url: string;
let serverType: "json" | undefined;
@ -93,7 +98,6 @@ export function start(updateBaseUrl: string): void {
// Squirrel / electron only supports auto-update on these two platforms.
// I'm not even going to try to guess which feed style they'd use if they
// implemented it on Linux, or if it would be different again.
console.log("Auto update not supported on this platform");
return;
}
@ -116,6 +120,26 @@ export function start(updateBaseUrl: string): void {
}
}
async function available(updateBaseUrl?: string): Promise<boolean> {
if (process.platform === "linux") {
// Auto update is not supported on Linux
console.log("Auto update not supported on this platform");
return false;
}
if (process.platform === "win32") {
try {
await fs.access(getSquirrelExecutable());
} catch {
console.log("Squirrel not found, auto update not supported");
return false;
}
}
// Otherwise we're either on macOS or Windows with Squirrel
return !!updateBaseUrl;
}
ipcMain.on("install_update", installUpdate);
ipcMain.on("check_updates", pollForUpdates);

View File

@ -33,7 +33,7 @@ import {
import url from "url";
import fs from "fs";
import fetch from "node-fetch";
import { pipeline } from "stream";
import { pipeline } from "stream/promises";
import path from "path";
import { _t } from "./language-helper";
@ -165,7 +165,7 @@ function onLinkContextMenu(ev: Event, params: ContextMenuParams, webContents: We
const resp = await fetch(url);
if (!resp.ok) throw new Error(`unexpected response ${resp.statusText}`);
if (!resp.body) throw new Error(`unexpected response has no body ${resp.statusText}`);
pipeline(resp.body, fs.createWriteStream(filePath));
await pipeline(resp.body, fs.createWriteStream(filePath));
}
} catch (err) {
console.error(err);

1905
yarn.lock

File diff suppressed because it is too large Load Diff