From 7aa0f9f50d35b53881fb4bec520d5fd95fe1f832 Mon Sep 17 00:00:00 2001 From: Leon Schmidt <50419884+MexHigh@users.noreply.github.com> Date: Mon, 23 May 2022 14:06:04 +0200 Subject: [PATCH 1/6] Make PUBLIC_URL and REACT_APP_SERVER configurable (#266) * Adjust Dockerfile to include args in build process * Adjust README.md --- Dockerfile | 5 ++++- README.md | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 92ce546..a5d5171 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,14 @@ # Builder FROM node:lts as builder +ARG PUBLIC_URL=/ +ARG REACT_APP_SERVER + WORKDIR /src COPY . /src RUN yarn --network-timeout=100000 install -RUN yarn build +RUN PUBLIC_URL=$PUBLIC_URL REACT_APP_SERVER=$REACT_APP_SERVER yarn build # App diff --git a/README.md b/README.md index 85ee974..383df88 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,9 @@ or by editing it in the [.env](.env) file. See also the context: https://github.com/Awesome-Technologies/synapse-admin.git # args: # - NODE_OPTIONS="--max_old_space_size=1024" + # # see #266 + # - PUBLIC_URL="/synapse-admin" + # - REACT_APP_SERVER="https://matrix.example.com" ports: - "8080:80" restart: unless-stopped From b2fa533ef0b4236f7b8fc46a866347c63d816034 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Apr 2022 00:17:49 +0000 Subject: [PATCH 2/6] Bump async from 2.6.3 to 2.6.4 Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4. - [Release notes](https://github.com/caolan/async/releases) - [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md) - [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4) --- updated-dependencies: - dependency-name: async dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index e703d0f..f15539d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2608,9 +2608,9 @@ async-limiter@~1.0.0: integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== async@^2.6.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== + version "2.6.4" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" + integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== dependencies: lodash "^4.17.14" From 96551259c50632c9b9d13df7eabb87398baf612e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Apr 2022 23:45:52 +0000 Subject: [PATCH 3/6] Bump cross-fetch from 3.1.4 to 3.1.5 Bumps [cross-fetch](https://github.com/lquixada/cross-fetch) from 3.1.4 to 3.1.5. - [Release notes](https://github.com/lquixada/cross-fetch/releases) - [Commits](https://github.com/lquixada/cross-fetch/compare/v3.1.4...v3.1.5) --- updated-dependencies: - dependency-name: cross-fetch dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index f15539d..8d123cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3745,11 +3745,11 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: sha.js "^2.4.8" cross-fetch@^3.0.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" - integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== + version "3.1.5" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" + integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== dependencies: - node-fetch "2.6.1" + node-fetch "2.6.7" cross-spawn@7.0.3, cross-spawn@^7.0.0, cross-spawn@^7.0.2: version "7.0.3" @@ -7804,10 +7804,12 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" -node-fetch@2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== +node-fetch@2.6.7: + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + dependencies: + whatwg-url "^5.0.0" node-forge@^0.10.0: version "0.10.0" @@ -11193,6 +11195,11 @@ tr46@^2.1.0: dependencies: punycode "^2.1.1" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + tryer@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8" @@ -11629,6 +11636,11 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + webidl-conversions@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" @@ -11775,6 +11787,14 @@ whatwg-mimetype@^2.3.0: resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + whatwg-url@^8.0.0, whatwg-url@^8.5.0: version "8.7.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" From e5f73ea8b43dc2bfe8c56f0e987bca619134f4c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 12:47:12 +0000 Subject: [PATCH 4/6] Bump minimist from 1.2.5 to 1.2.6 Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8d123cb..8ec11e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7621,9 +7621,9 @@ minimatch@3.0.4, minimatch@^3.0.4: brace-expansion "^1.1.7" minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== minipass-collect@^1.0.2: version "1.0.2" From 784c284723ad975b73bea9b65892c444154f33f2 Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Wed, 20 Apr 2022 10:46:19 +0200 Subject: [PATCH 5/6] Add note to GH pages --- README.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 383df88..4e8d76b 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,19 @@ This project is built using [react-admin](https://marmelab.com/react-admin/). -It needs at least Synapse v1.42.0 for all functions to work as expected! +## Usage + +### Supported Synapse + +It needs at least [Synapse](https://github.com/matrix-org/synapse) v1.42.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). After entering the URL on the login page of synapse-admin the server version appears below the input field. +### Prerequisites + You need access to the following endpoints: - `/_matrix` @@ -19,7 +25,17 @@ You need access to the following endpoints: See also [Synapse administration endpoints](https://matrix-org.github.io/synapse/develop/reverse_proxy.html#synapse-administration-endpoints) -## Step-By-Step install +### Use without install + +You can use the current version of Synapse Admin without own installation direct +via [GitHub Pages](https://awesome-technologies.github.io/synapse-admin/). + +**Note:** +It is highly recommended to [deploy an own environment](#step-by-step-install), +so that the admin endpoints (`/_synapse/admin`) do not have to be exposed to +the internet. + +### Step-By-Step install You have three options: @@ -27,7 +43,7 @@ You have three options: 2. [Download the source code from github and run using nodejs](#steps-for-2) 3. [Run the Docker container](#steps-for-3) -### Steps for 1) +#### Steps for 1) - make sure you have a webserver installed that can serve static files (any webserver like nginx or apache will do) - configure a vhost for synapse admin on your webserver @@ -36,7 +52,7 @@ You have three options: - move or symlink the `synapse-admin-x.x.x` into your vhosts root dir - open the url of the vhost in your browser -### Steps for 2) +#### Steps for 2) - make sure you have installed the following: git, yarn, nodejs - download the source code: `git clone https://github.com/Awesome-Technologies/synapse-admin.git` @@ -49,7 +65,7 @@ Either you define it at startup (e.g. `REACT_APP_SERVER=https://yourmatrixserver or by editing it in the [.env](.env) file. See also the [documentation](https://create-react-app.dev/docs/adding-custom-environment-variables/). -### Steps for 3) +#### Steps for 3) - run the Docker container from the public docker registry: `docker run -p 8080:80 awesometechnologies/synapse-admin` or use the [docker-compose.yml](docker-compose.yml): `docker-compose up -d` From 0b153ddcbb33550475f93e7388c769d87cf0dc6e Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Mon, 9 May 2022 13:46:00 +0200 Subject: [PATCH 6/6] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dominik Fuchß --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4e8d76b..4b5ee45 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,9 @@ You can use the current version of Synapse Admin without own installation direct via [GitHub Pages](https://awesome-technologies.github.io/synapse-admin/). **Note:** -It is highly recommended to [deploy an own environment](#step-by-step-install), -so that the admin endpoints (`/_synapse/admin`) do not have to be exposed to -the internet. +If you want to use the deployment, you have to make sure that the admin endpoints (`/_synapse/admin`) are accessible for your browser. +**Remember: You have no need to expose these endpoints to the internet but to your network.** +If you want your own deployment, follow the [Step-By-Step Install Guide](#step-by-step-install) below. ### Step-By-Step install