From 79ef38ee6b6e01c2512df03b48aed046e7a51d61 Mon Sep 17 00:00:00 2001
From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com>
Date: Mon, 15 Nov 2021 20:40:05 +0100
Subject: [PATCH 1/8] Enable modify user `external_ids` (#179)
* Enable modify user `external_ids`
* add input validation
---
README.md | 2 +-
src/components/users.js | 25 ++++++++++++++++++-------
2 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 96ab28c..dbc4ded 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
This project is built using [react-admin](https://marmelab.com/react-admin/).
-It needs at least Synapse v1.38.0 for all functions to work as expected!
+It needs at least Synapse v1.41.0 for all functions to work as expected!
You get your server version with the request `/_synapse/admin/v1/server_version`.
See also [Synapse version API](https://matrix-org.github.io/synapse/develop/admin_api/version_api.html).
diff --git a/src/components/users.js b/src/components/users.js
index c954416..cdd8768 100644
--- a/src/components/users.js
+++ b/src/components/users.js
@@ -37,6 +37,7 @@ import {
DeleteButton,
SaveButton,
regex,
+ required,
useTranslate,
Pagination,
CreateButton,
@@ -262,6 +263,16 @@ export const UserCreate = props => (
+
+
+
+
+
+
);
@@ -339,16 +350,16 @@ export const UserEdit = props => {
icon={}
path="sso"
>
-
-
-
-
+
+
+
-
-
+
+
Date: Mon, 15 Nov 2021 20:57:38 +0100
Subject: [PATCH 2/8] Automatically set the homeserver for a new user (#184)
and enhance form validation
---
src/components/users.js | 26 +++++++++++++++++++-------
src/i18n/de.js | 3 +--
src/i18n/en.js | 3 +--
src/synapse/dataProvider.js | 4 +++-
4 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/src/components/users.js b/src/components/users.js
index cdd8768..7a471d4 100644
--- a/src/components/users.js
+++ b/src/components/users.js
@@ -36,6 +36,7 @@ import {
BulkDeleteButton,
DeleteButton,
SaveButton,
+ maxLength,
regex,
required,
useTranslate,
@@ -181,10 +182,16 @@ export const UserList = props => {
};
// https://matrix.org/docs/spec/appendices#user-identifiers
-const validateUser = regex(
- /^@[a-z0-9._=\-/]+:.*/,
- "synapseadmin.users.invalid_user_id"
-);
+// here only local part of user_id
+// maxLength = 255 - "@" - ":" - localStorage.getItem("home_server").length
+// localStorage.getItem("home_server").length is not valid here
+const validateUser = [
+ required(),
+ maxLength(253),
+ regex(/^[a-z0-9._=\-/]+$/, "synapseadmin.users.invalid_user_id"),
+];
+
+const validateAddress = [required(), maxLength(255)];
export function generateRandomUser() {
const homeserver = localStorage.getItem("home_server");
@@ -248,8 +255,12 @@ export const UserCreate = props => (
-
-
+
+
@@ -259,8 +270,9 @@ export const UserCreate = props => (
{ id: "email", name: "resources.users.email" },
{ id: "msisdn", name: "resources.users.msisdn" },
]}
+ validate={required()}
/>
-
+
diff --git a/src/i18n/de.js b/src/i18n/de.js
index f7b0bb1..66a8a05 100644
--- a/src/i18n/de.js
+++ b/src/i18n/de.js
@@ -12,8 +12,7 @@ const de = {
url_error: "Keine gültige Matrix Server URL",
},
users: {
- invalid_user_id:
- "Muss eine vollständige Matrix Benutzer-ID sein, z.B. @benutzer_id:homeserver",
+ invalid_user_id: "Lokaler Anteil der Matrix Benutzer-ID ohne Homeserver.",
tabs: { sso: "SSO" },
},
rooms: {
diff --git a/src/i18n/en.js b/src/i18n/en.js
index e669a1a..51ba6ca 100644
--- a/src/i18n/en.js
+++ b/src/i18n/en.js
@@ -12,8 +12,7 @@ const en = {
url_error: "Not a valid Matrix server URL",
},
users: {
- invalid_user_id:
- "Must be a fully qualified Matrix user-id, e.g. @user_id:homeserver",
+ invalid_user_id: "Localpart of a Matrix user-id without homeserver.",
tabs: { sso: "SSO" },
},
rooms: {
diff --git a/src/synapse/dataProvider.js b/src/synapse/dataProvider.js
index b37af45..5b11139 100644
--- a/src/synapse/dataProvider.js
+++ b/src/synapse/dataProvider.js
@@ -41,7 +41,9 @@ const resourceMap = {
data: "users",
total: json => json.total,
create: data => ({
- endpoint: `/_synapse/admin/v2/users/${data.id}`,
+ endpoint: `/_synapse/admin/v2/users/@${data.id}:${localStorage.getItem(
+ "home_server"
+ )}`,
body: data,
method: "PUT",
}),
From 42b32523539c290f1e6d14f2be25b104a2cf3f27 Mon Sep 17 00:00:00 2001
From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com>
Date: Mon, 15 Nov 2021 21:02:47 +0100
Subject: [PATCH 3/8] Add `pristine` to `UserEdit` and `ServerNotice` (#185)
---
src/components/ServerNotices.js | 5 ++++-
src/components/users.js | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/components/ServerNotices.js b/src/components/ServerNotices.js
index 2a3e8bd..6b9b95c 100644
--- a/src/components/ServerNotices.js
+++ b/src/components/ServerNotices.js
@@ -24,7 +24,10 @@ const ServerNoticeDialog = ({ open, loading, onClose, onSend }) => {
const ServerNoticeToolbar = props => (
-
+
diff --git a/src/components/users.js b/src/components/users.js
index 7a471d4..06e659a 100644
--- a/src/components/users.js
+++ b/src/components/users.js
@@ -238,7 +238,7 @@ const UserEditToolbar = props => {
const translate = useTranslate();
return (
-
+
Date: Mon, 15 Nov 2021 21:11:49 +0100
Subject: [PATCH 4/8] Bump tmpl from 1.0.4 to 1.0.5 (#193)
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)
---
updated-dependencies:
- dependency-name: tmpl
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
yarn.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index 66c1d5b..ac2aff1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -11213,9 +11213,9 @@ tiny-warning@^1.0.0, tiny-warning@^1.0.2, tiny-warning@^1.0.3:
integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==
tmpl@1.0.x:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
- integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc"
+ integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==
to-arraybuffer@^1.0.0:
version "1.0.1"
From a5c7d7dd227f6b109c21814b6bbaab433e56e034 Mon Sep 17 00:00:00 2001
From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com>
Date: Mon, 15 Nov 2021 21:15:11 +0100
Subject: [PATCH 5/8] Make items in "Room directory" are clickable (#199)
---
src/components/RoomDirectory.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/RoomDirectory.js b/src/components/RoomDirectory.js
index d8d0469..c8d110f 100644
--- a/src/components/RoomDirectory.js
+++ b/src/components/RoomDirectory.js
@@ -191,7 +191,7 @@ export const FilterableRoomDirectoryList = ({
filters={}
perPage={100}
>
-
+ "/rooms/" + id + "/show"}>
Date: Mon, 15 Nov 2021 21:18:29 +0100
Subject: [PATCH 6/8] replace `undoable` prop with `mutationMode` prop (#202)
---
src/components/RoomDirectory.js | 2 +-
src/components/rooms.js | 2 +-
src/components/users.js | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/components/RoomDirectory.js b/src/components/RoomDirectory.js
index c8d110f..0284e14 100644
--- a/src/components/RoomDirectory.js
+++ b/src/components/RoomDirectory.js
@@ -59,7 +59,7 @@ export const RoomDirectoryBulkDeleteButton = props => (
(
{...props}
confirmTitle="resources.rooms.action.erase.title"
confirmContent="resources.rooms.action.erase.content"
- undoable={false}
+ mutationMode="pessimistic"
/>
);
diff --git a/src/components/users.js b/src/components/users.js
index 06e659a..ff29fdf 100644
--- a/src/components/users.js
+++ b/src/components/users.js
@@ -144,7 +144,7 @@ const UserBulkActionButtons = props => (
{...props}
label="resources.users.action.erase"
confirmTitle="resources.users.helper.erase"
- undoable={false}
+ mutationMode="pessimistic"
/>
);
From 8228d7d2c244ea19a457ecdf637797c35e39fc3b Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 15 Nov 2021 21:18:58 +0100
Subject: [PATCH 7/8] Bump tar from 6.1.8 to 6.1.11 (#207)
Bumps [tar](https://github.com/npm/node-tar) from 6.1.8 to 6.1.11.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v6.1.8...v6.1.11)
---
updated-dependencies:
- dependency-name: tar
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
yarn.lock | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index ac2aff1..532abd7 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7729,9 +7729,9 @@ minipass-pipeline@^1.2.2:
minipass "^3.0.0"
minipass@^3.0.0, minipass@^3.1.1:
- version "3.1.3"
- resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.3.tgz#7d42ff1f39635482e15f9cdb53184deebd5815fd"
- integrity sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==
+ version "3.1.5"
+ resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.5.tgz#71f6251b0a33a49c01b3cf97ff77eda030dff732"
+ integrity sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==
dependencies:
yallist "^4.0.0"
@@ -11077,9 +11077,9 @@ tapable@^1.0.0, tapable@^1.1.3:
integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==
tar@^6.0.2:
- version "6.1.8"
- resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.8.tgz#4fc50cfe56511c538ce15b71e05eebe66530cbd4"
- integrity sha512-sb9b0cp855NbkMJcskdSYA7b11Q8JsX4qe4pyUAfHp+Y6jBjJeek2ZVlwEfWayshEIwlIzXx0Fain3QG9JPm2A==
+ version "6.1.11"
+ resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621"
+ integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==
dependencies:
chownr "^2.0.0"
fs-minipass "^2.0.0"
From abc9d5154eeee86b2cb23b349a7326483249ee0c Mon Sep 17 00:00:00 2001
From: Aaron R
Date: Mon, 15 Nov 2021 14:35:23 -0600
Subject: [PATCH 8/8] Switch Dockerfile to use current LTS version of Node
(#205)
Node 17 current fails due to https://github.com/webpack/webpack/issues/14532. It probably makes sense to use the current LTS version of Node instead of the absolute latest version of Node so these kinds of bleeding edge issues are less likely to happen.
---
Dockerfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Dockerfile b/Dockerfile
index be60bfd..92ce546 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
# Builder
-FROM node:current as builder
+FROM node:lts as builder
WORKDIR /src