From 2e2085cdfeb4a4ded1c01470ac21f46558ebbec7 Mon Sep 17 00:00:00 2001 From: Manuel Stahl Date: Thu, 18 Apr 2024 17:48:53 +0200 Subject: [PATCH] Use vitejs instead of react-scripts - react-scripts are not maintained anymore - vitejs is well suited for single page applications Fixes #335 See https://darekkay.com/blog/create-react-app-to-vite/ Change-Id: Ib884748e373094a640b576894ff67b98c3584ec8 --- .dockerignore | 1 + .gitignore | 4 + README.md | 36 +- docker-compose.yml | 2 - public/index.html => index.html | 13 +- package.json | 41 +- vite.config.js | 6 + yarn.lock | 7772 ++++++++----------------------- 8 files changed, 2036 insertions(+), 5839 deletions(-) rename public/index.html => index.html (87%) create mode 100644 vite.config.js diff --git a/.dockerignore b/.dockerignore index a9f7bc4..dbd5eff 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,7 @@ # Exclude a bunch of stuff which can make the build context a larger than it needs to be tests/ build/ +dist/ lib/ node_modules/ electron_app/ diff --git a/.gitignore b/.gitignore index 4d29575..c96adcb 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,10 @@ # production /build +/dist + +# vitejs +.vite # misc .DS_Store diff --git a/README.md b/README.md index 751f7d0..da533eb 100644 --- a/README.md +++ b/README.md @@ -79,8 +79,6 @@ You have three options: context: https://github.com/Awesome-Technologies/synapse-admin.git # args: # - NODE_OPTIONS="--max_old_space_size=1024" - # # see #266, PUBLIC_URL must be without surrounding quotation marks - # - PUBLIC_URL=/synapse-admin ports: - "8080:80" restart: unless-stopped @@ -122,6 +120,40 @@ services: ... ``` +### Serving Synapse-Admin on a different path + +We do not support directly changing the path where Synapse-Admin is served. Instead please use a reverse proxy if you need to move Synapse-Admin to a different base path. If you want to serve multiple applications with different paths on the same domain, you need a reverse proxy anyway. + +Example for Traefik: + +`docker-compose.yml` + +```yml +services: + traefik: + image: traefik:mimolette + restart: unless-stopped + ports: + - 80:80 + - 443:443 + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + labels: + - "traefik.http.middlewares.admin.redirectregex.regex:^(.*)/admin/?" + - "traefik.http.middlewares.admin.redirectregex.replacement:$${1}/admin/" + - "traefik.http.middlewares.admin_path.replacepathregex.regex:^/admin/(.*)" + - "traefik.http.middlewares.admin_path.replacepathregex.replacement:/$1" + + synapse-admin: + image: awesometechnologies/synapse-admin:latest + restart: unless-stopped + labels: + - "traefik.enable=true" + - "traefik.http.routers.synapse-admin.priority=3" + - "traefik.http.routers.synapse-admin.rule=Host(`example.com`)&&PathPrefix(`/admin`)" + - "traefik.http.routers.synapse-admin.middlewares=admin,admin_path" +``` + ## Screenshots ![Screenshots](./screenshots.jpg) diff --git a/docker-compose.yml b/docker-compose.yml index 6b16162..e7b91ce 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,8 +14,6 @@ services: # if you're building on an architecture other than amd64, make sure # to define a maximum ram for node. otherwise the build will fail. # - NODE_OPTIONS="--max_old_space_size=1024" - # default is . - # - PUBLIC_URL=/synapse-admin ports: - "8080:80" restart: unless-stopped diff --git a/public/index.html b/index.html similarity index 87% rename from public/index.html rename to index.html index 3498b4c..1b585a1 100644 --- a/public/index.html +++ b/index.html @@ -2,7 +2,6 @@ - - - + + Synapse-Admin