Compare commits

..

31 Commits

Author SHA1 Message Date
Travis Ralston
0996956308 Add webpack config to override UI components with customisation 2021-12-16 18:20:31 +01:00
Travis Ralston
86a4d70bcf Webpack config for widget customisation endpoint 2021-12-16 18:20:28 +01:00
Tom
e2a4d7a568 Replacing the education translations with more generic ones. This is _still_ not a sustainable approach. 2021-12-16 18:17:31 +01:00
Tom
12fb012b6f Adding missing translations 2021-12-16 18:16:58 +01:00
Tom
118bd8f4fa Replacing the education translations with more generic ones. This is _still_ not a sustainable approach. 2021-12-16 18:16:54 +01:00
Ben Banfield-Zanin
2f9122d456 s/JS_SDK_REF/JS_SDK_BRANCH/ 2021-12-16 18:13:04 +01:00
Tom
c9ac4d2bf2 Update .gitlab-ci.yml 2021-12-16 18:13:04 +01:00
Arun Neelicattu
5e13a30065 ci: use toml/changes branch for react-sdk testing 2021-12-16 18:13:04 +01:00
Tom
ba11162cee Testing bundling all the translation changes into eleweb. Not a long term solution. 2021-12-16 18:13:01 +01:00
Arun Babu Neelicattu
341d41965f Revert "ci: build container without cache"
This reverts commit 19c33f988d13ec1705187c8c60d848960af7a56c.
2021-12-16 18:12:10 +01:00
Arun Neelicattu
186b4cb3f8 ci: build container without cache 2021-12-16 18:12:10 +01:00
Tom
b338f3f9bb Translate the static jitsi file to German 2021-12-16 18:12:10 +01:00
Travis Ralston
0f31e9f23a Fix build? 2021-12-16 18:12:10 +01:00
Travis Ralston
8944b48e2d Pin js-sdk 2021-12-16 18:12:10 +01:00
Ben Banfield-Zanin
e69e3ae90f I hate bash 2021-12-16 18:12:10 +01:00
Ben Banfield-Zanin
72596694af Attempt to make master build latest again 2021-12-16 18:12:10 +01:00
Ben Banfield-Zanin
3faccf182e Do spaces help? 2021-12-16 18:12:10 +01:00
Ben Banfield-Zanin
70743d0b9a Use some bashisms? 2021-12-16 18:12:10 +01:00
Ben Banfield-Zanin
b1a29294e6 Attempt to use nice ref names when possible 2021-12-16 18:12:10 +01:00
Ben Banfield-Zanin
3547e468c2 Document what the tag will be 2021-12-16 18:12:10 +01:00
Ben Banfield-Zanin
159adcc87f Remove SDK directories after use 2021-12-16 18:12:10 +01:00
Ben Banfield-Zanin
40936b3bf6 Blank script tags aren't allowed 2021-12-16 18:12:10 +01:00
Ben Banfield-Zanin
f41b1c831c Add stub script 2021-12-16 18:12:10 +01:00
Ben Banfield-Zanin
2bfff82b30 Improve the pipeline to attempt to distinguish branches for react-sdk 2021-12-16 18:12:10 +01:00
Ben Banfield-Zanin
b09fa73160 Gitlab pipeline 2021-12-16 18:10:21 +01:00
RiotRobot
eae38311b2 v1.9.7 2021-12-13 15:36:54 +00:00
RiotRobot
1b6b1a8621 Prepare changelog for v1.9.7 2021-12-13 15:36:53 +00:00
RiotRobot
80cf11135d Upgrade matrix-react-sdk to 3.36.1 2021-12-13 15:33:35 +00:00
RiotRobot
9eb5af53e2 Upgrade matrix-js-sdk to 15.2.1 2021-12-13 15:32:59 +00:00
David Baker
0637c2e74d update olm to 3.2.8 (#20160) 2021-12-13 14:59:21 +00:00
James Salter
159f1962a1 Fix Docker build versioning (#20077) (#20078)
* Centralise version scripts and fix Docker version
* Refactor generation of a git-hash-based version into get-version-from-git
* Refactor normalization of versions (stripping leading v) into normalize-version.sh
* Call get-version-from-git from ci_package.sh, call normalize-version from package.sh
* Refactor docker-write-version.sh into docker-package.sh, which both writes the
  version file and invokes yarn build passing VERSION
* Normalize the version received from the server
2021-12-07 15:35:23 +11:00
14 changed files with 3264 additions and 65 deletions

30
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,30 @@
stages:
- build
variables:
USE_CUSTOM_SDKS: "true"
JS_SDK_BRANCH: "release-v9.8.0"
JS_SDK_REPO: "https://github.com/matrix-org/matrix-js-sdk.git"
REACT_SDK_REPO: "https://gitlab-ci-token:$GL_BAYERN_REACT_SDK_TOKEN@gitlab.matrix.org/new-vector/dataport/bayern-react-sdk"
REACT_SDK_BRANCH: "master"
docker-build:
tags: ['shell']
stage: build
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- "[ -d './js-sdk' ] && rm -rf ./js-sdk"
- "[[ $JS_SDK_BRANCH != 'master' ]] && git clone --depth 1 --branch $JS_SDK_BRANCH $JS_SDK_REPO js-sdk && cd js-sdk && export JS_SDK_SHA=$(git rev-parse --short=12 HEAD) && cd ../ && rm -rf js-sdk"
- "[[ $JS_SDK_BRANCH == 'master' ]] && export JS_SDK_SHA=master"
- "[ -d './react-sdk' ] && rm -rf ./react-sdk"
- "[[ $REACT_SDK_BRANCH != 'master' ]] && git clone --depth 1 --branch $REACT_SDK_BRANCH $REACT_SDK_REPO react-sdk && cd react-sdk && export REACT_SDK_SHA=$(git rev-parse --short=12 HEAD) && cd ../ && rm -rf react-sdk"
- "[[ $REACT_SDK_BRANCH == 'master' ]] && export REACT_SDK_SHA=master"
- "[[ $CI_COMMIT_BRANCH != 'master' ]] && export ELEMENT_WEB_SHA=$(git rev-parse --short=12 HEAD)"
- "[[ $CI_COMMIT_BRANCH == 'master' ]] && export ELEMENT_WEB_SHA=master"
- "[[ -v CI_COMMIT_TAG ]] && export SPECIAL_DOCKER_TAG=$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
- "([[ $CI_COMMIT_BRANCH == 'master' ]] && [[ $REACT_SDK_BRANCH == 'master' ]] && [[ $JS_SDK_BRANCH == 'master' ]]) && export SPECIAL_DOCKER_TAG=$CI_REGISTRY_IMAGE:latest"
- '[[ -z $SPECIAL_DOCKER_TAG ]] && export DOCKER_TAG="$CI_REGISTRY_IMAGE:$ELEMENT_WEB_SHA-react-$REACT_SDK_SHA-js-$JS_SDK_SHA" || export DOCKER_TAG="$SPECIAL_DOCKER_TAG"'
script:
- echo "Docker tag will be $DOCKER_TAG"
- docker build --pull -t "$DOCKER_TAG" --build-arg "USE_CUSTOM_SDKS=$USE_CUSTOM_SDKS" --build-arg "JS_SDK_BRANCH=$JS_SDK_BRANCH" --build-arg "JS_SDK_REPO=$JS_SDK_REPO" --build-arg "REACT_SDK_REPO=$REACT_SDK_REPO" --build-arg "REACT_SDK_BRANCH=$REACT_SDK_BRANCH" .
- docker push "$DOCKER_TAG"

View File

@@ -1,3 +1,9 @@
Changes in [1.9.7](https://github.com/vector-im/element-web/releases/tag/v1.9.7) (2021-12-13)
=============================================================================================
* Security release with updated version of Olm to fix https://matrix.org/blog/2021/12/03/pre-disclosure-upcoming-security-release-of-libolm-and-matrix-js-sdk
* Fix a crash on logout
Changes in [1.9.6](https://github.com/vector-im/element-web/releases/tag/v1.9.6) (2021-12-06)
=============================================================================================

View File

@@ -16,15 +16,12 @@ WORKDIR /src
COPY . /src
RUN dos2unix /src/scripts/docker-link-repos.sh && bash /src/scripts/docker-link-repos.sh
RUN yarn --network-timeout=100000 install
RUN yarn build
RUN dos2unix /src/scripts/docker-package.sh && bash /src/scripts/docker-package.sh
# Copy the config now so that we don't create another layer in the app image
RUN cp /src/config.sample.json /src/webapp/config.json
# Ensure we populate the version file
RUN dos2unix /src/scripts/docker-write-version.sh && bash /src/scripts/docker-write-version.sh
# App
FROM nginx:alpine

View File

@@ -1,6 +1,6 @@
{
"name": "element-web",
"version": "1.9.6",
"version": "1.9.7",
"description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.",
"repository": {
@@ -55,13 +55,13 @@
"test": "jest"
},
"dependencies": {
"@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.3.tgz",
"@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.8.tgz",
"browser-request": "^0.3.3",
"gfm.css": "^1.1.2",
"jsrsasign": "^10.2.0",
"katex": "^0.12.0",
"matrix-js-sdk": "15.2.0",
"matrix-react-sdk": "3.36.0",
"matrix-js-sdk": "15.2.1",
"matrix-react-sdk": "3.36.1",
"matrix-widget-api": "^0.1.0-beta.17",
"prop-types": "^15.7.2",
"react": "17.0.2",

View File

@@ -1,17 +1,11 @@
#!/bin/bash
# Runs package.sh setting the version to git hashes of the element-web,
# react-sdk & js-sdk checkouts, for the case where these dependencies
# are git checkouts.
# Runs package.sh, passing DIST_VERSION determined by git
set -ex
rm dist/element-*.tar.gz || true # rm previous artifacts without failing if it doesn't exist
# Since the deps are fetched from git, we can rev-parse
REACT_SHA=$(cd node_modules/matrix-react-sdk; git rev-parse --short=12 HEAD)
JSSDK_SHA=$(cd node_modules/matrix-js-sdk; git rev-parse --short=12 HEAD)
DIST_VERSION=`$(dirname $0)/get-version-from-git.sh`
VECTOR_SHA=$(git rev-parse --short=12 HEAD) # use the ACTUAL SHA rather than assume develop
CI_PACKAGE=true DIST_VERSION=$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA scripts/package.sh
CI_PACKAGE=true DIST_VERSION=$DIST_VERSION scripts/package.sh

View File

@@ -13,10 +13,9 @@ DIST_VERSION=$TAG
# for an appropriately tagged branch as well (heads/v1.2.3).
if [[ $BRANCH != HEAD && ! $BRANCH =~ heads/v.+ ]]
then
REACT_SHA=$(cd node_modules/matrix-react-sdk; git rev-parse --short=12 HEAD)
JSSDK_SHA=$(cd node_modules/matrix-js-sdk; git rev-parse --short=12 HEAD)
VECTOR_SHA=$(git rev-parse --short=12 HEAD) # use the ACTUAL SHA rather than assume develop
DIST_VERSION=$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA
DIST_VERSION=`$(dirname $0)/get-version-from-git.sh`
fi
DIST_VERSION=`$(dirname $0)/normalize-version.sh ${DIST_VERSION}`
VERSION=$DIST_VERSION yarn build
echo $DIST_VERSION > /src/webapp/version

10
scripts/get-version-from-git.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Echoes a version based on the git hashes of the element-web, react-sdk & js-sdk checkouts, for the case where
# these dependencies are git checkouts.
# Since the deps are fetched from git, we can rev-parse
REACT_SHA=$(cd node_modules/matrix-react-sdk; git rev-parse --short=12 HEAD)
JSSDK_SHA=$(cd node_modules/matrix-js-sdk; git rev-parse --short=12 HEAD)
VECTOR_SHA=$(git rev-parse --short=12 HEAD) # use the ACTUAL SHA rather than assume develop
echo $VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA

8
scripts/normalize-version.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
# If $1 looks like v1.2.3 or v1.2.3-foo, strip the leading v, then print it to stdout
if [[ $1 =~ ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(-.+)?$ ]]; then
echo ${1:1}
else
echo $1
fi

View File

@@ -21,12 +21,7 @@ cp -r webapp element-$version
# Just in case you have a local config, remove it before packaging
rm element-$version/config.json || true
# if $version looks like semver with leading v, strip it before writing to file
if [[ ${version} =~ ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(-.+)?$ ]]; then
echo ${version:1} > element-$version/version
else
echo ${version} > element-$version/version
fi
$(dirname $0)/normalize-version.sh ${version} > element-$version/version
tar chvzf dist/element-$version.tar.gz element-$version
rm -r element-$version

File diff suppressed because it is too large Load Diff

View File

@@ -11,9 +11,9 @@
<div class="joinConferencePrompt">
<span class="icon"><!-- managed by CSS --></span>
<!-- TODO: i18n -->
<h2>Jitsi Video Conference</h2>
<h2>Videokonferenz</h2>
<div id="widgetActionContainer">
<button type="button" id="joinButton">Join Conference</button>
<button type="button" id="joinButton">Videokonferenz beitreten</button>
</div>
</div>
</div>

View File

@@ -107,7 +107,7 @@ export default class WebPlatform extends VectorBasePlatform {
// presence of intermediate caching proxies), but still: we're trying
// to tell the user that there is a new version.
return new Promise(function(resolve, reject) {
return new Promise((resolve, reject) => {
request(
{
method: "GET",
@@ -121,27 +121,24 @@ export default class WebPlatform extends VectorBasePlatform {
return;
}
const ver = body.trim();
resolve(ver);
resolve(this.getNormalizedAppVersion(body.trim()));
},
);
});
}
getNormalizedAppVersion(): string {
let ver = process.env.VERSION;
getNormalizedAppVersion(version: string): string {
// if version looks like semver with leading v, strip it
// (matches scripts/package.sh)
// (matches scripts/normalize-version.sh)
const semVerRegex = new RegExp("^v[0-9]+.[0-9]+.[0-9]+(-.+)?$");
if (semVerRegex.test(process.env.VERSION)) {
ver = process.env.VERSION.substr(1);
if (semVerRegex.test(version)) {
return version.substr(1);
}
return ver;
return version;
}
getAppVersion(): Promise<string> {
return Promise.resolve(this.getNormalizedAppVersion());
return Promise.resolve(this.getNormalizedAppVersion(process.env.VERSION));
}
startUpdater() {
@@ -155,7 +152,7 @@ export default class WebPlatform extends VectorBasePlatform {
pollForUpdate = () => {
return this.getMostRecentVersion().then((mostRecentVersion) => {
const currentVersion = this.getNormalizedAppVersion();
const currentVersion = this.getNormalizedAppVersion(process.env.VERSION);
if (currentVersion !== mostRecentVersion) {
if (this.shouldShowUpdate(mostRecentVersion)) {

View File

@@ -39,6 +39,17 @@ function getActiveThemes() {
return themes;
}
const additionalPlugins = [
new webpack.NormalModuleReplacementPlugin(
/src[\/\\]customisations[\/\\]WidgetVariables\.ts/,
path.resolve(require.resolve("matrix-react-sdk/package.json"), '..', 'src', 'customisations', 'bayern', 'BayernWidgetVariableCustomisations.ts'),
),
new webpack.NormalModuleReplacementPlugin(
/src[\/\\]customisations[\/\\]ComponentVisibility\.ts/,
path.resolve(require.resolve("matrix-react-sdk/package.json"), '..', 'src', 'customisations', 'bayern', 'BayernComponentVisibilityCustomisations.ts'),
),
];
module.exports = (env, argv) => {
// Establish settings based on the environment and args.
//
@@ -546,6 +557,7 @@ module.exports = (env, argv) => {
include: "./webapp/bundles",
}),
new webpack.EnvironmentPlugin(['VERSION']),
...additionalPlugins,
].filter(Boolean),
output: {

View File

@@ -1306,9 +1306,9 @@
"@types/yargs" "^16.0.0"
chalk "^4.0.0"
"@matrix-org/olm@https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.3.tgz":
version "3.2.3"
resolved "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.3.tgz#cc332fdd25c08ef0e40f4d33fc3f822a0f98b6f4"
"@matrix-org/olm@https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.8.tgz":
version "3.2.8"
resolved "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.8.tgz#8d53636d045e1776e2a2ec6613e57330dd9ce856"
"@mrmlnc/readdir-enhanced@^2.2.1":
version "2.2.1"
@@ -7854,10 +7854,10 @@ mathml-tag-names@^2.1.3:
resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3"
integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==
matrix-js-sdk@15.2.0:
version "15.2.0"
resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-15.2.0.tgz#1f04fe938f951af8af4b78dff8ff697db5981428"
integrity sha512-jZOM8Fn86oNvU3zVQcc+JTKKrtYq4ADN6rPZs4Mwxj/X/GDP+2YIP5176GtviF0GM6VO1dcnPZY73ykl8DayjA==
matrix-js-sdk@15.2.1:
version "15.2.1"
resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-15.2.1.tgz#61e9742ccacfe486231415372e12cb13607b5d7c"
integrity sha512-e0/NE6LUfDLKLdWNFyH5OGt2QHybandrC0x9qgj7P1/fe+zgLGGd8W4XGDa5CMHjjqm/OoLMam44+0+FafojlQ==
dependencies:
"@babel/runtime" "^7.12.5"
another-json "^0.2.0"
@@ -7878,10 +7878,10 @@ matrix-mock-request@^1.2.3:
bluebird "^3.5.0"
expect "^1.20.2"
matrix-react-sdk@3.36.0:
version "3.36.0"
resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.36.0.tgz#70a07944bd217e8d52e7b818d215d6d7e1b9c3f2"
integrity sha512-/Mc+4PrySGs2LHN15LQk9bUauAHk2dW7SrG04wEnjNSA+yudH5wiHYZ/4p1ZHjOLW/NsDoGpIYN+Yqkr9aKuHA==
matrix-react-sdk@3.36.1:
version "3.36.1"
resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.36.1.tgz#0970b5e707e5dfc07dd708a3e30f7050296fcc31"
integrity sha512-5L6SoMt3S1gjvB4AviR1Duc6sSVqf1hSq7aW8JH1houF3N7cYlNDJL5RXQ+G3iFqMlE+QpEUOApfN45WjLA+Bw==
dependencies:
"@babel/runtime" "^7.12.5"
"@sentry/browser" "^6.11.0"
@@ -7912,7 +7912,7 @@ matrix-react-sdk@3.36.0:
katex "^0.12.0"
linkifyjs "^2.1.9"
lodash "^4.17.20"
matrix-js-sdk "15.2.0"
matrix-js-sdk "15.2.1"
matrix-widget-api "^0.1.0-beta.17"
minimist "^1.2.5"
opus-recorder "^8.0.3"