synapse-admin icon indicating copy to clipboard operation
synapse-admin copied to clipboard

PUBLIC_URL removed?!

Open jeffrson opened this issue 3 years ago • 5 comments

I read https://github.com/Awesome-Technologies/synapse-admin/issues/322 - and as requested there I'm opening another issue.

How should a prefix like /synapse-admin be handled now? I just upgraded (docker compose build synapse-admin with docker-compose.yml according to example on github) and it doesn't work anymore?

jeffrson avatar Feb 08 '23 17:02 jeffrson

If you want to build a docker image with a fixed prefix you have to edit the Dockerfile too. See the the changes made in https://github.com/Awesome-Technologies/synapse-admin/commit/9b43d41040b79cc8ad240dbadc66098bc8231c2b (add the ARG and edit the RUN command).

awesome-michael avatar Feb 13 '23 08:02 awesome-michael

Yes, I saw those changes - but I don't understand. Do you mean I should re-add the lines to Dockerfile that you'd removed?

As the docs (README.md) suggest, I use docker-compose.yml with

services:
  synapse-admin:
    build:
      context: https://github.com/Awesome-Technologies/synapse-admin.git
      args:
        ...
        - PUBLIC_URL=/synapse-admin
        ...

There's no way to edit Dockerfile whatsoever.

I'm running /synapse-admin through nginx reverse proxy and I don't see how it is intended now to be used. It simply does not work (anymore), because it tries to read from /static a.s.o.

jeffrson avatar Feb 13 '23 08:02 jeffrson

Likewise I'm trying to use this behind a Traefik ingress in a kubernetes cluster listening on /synapse-admin. To get it to work I needed to add Traefik middleware to remove the /synapse-admin before it was routed to the synapse admin container. However the login page doesn't load correct as all the static files and javascript have the incorrect url they're missing /synapse-admin.

The only way I've managed to do it is to rebuild the docker image myself and re-add PUBLIC_URL pointing it to /synapse-admin. The PUBLIC_URL var should should be put back in and ideally made configurable without re-building.

warrenbailey avatar Jul 14 '23 13:07 warrenbailey

I had issues with this too but fixed it by adding trailing slashes in nginx.

  location /synapse-admin/ {
    # proxy_set_header ...
    proxy_pass http://synapse-admin:80/;
  }

In Nginx Proxy Manager, it looks like this.

mkody avatar Aug 30 '23 07:08 mkody

See the the changes made in https://github.com/Awesome-Technologies/synapse-admin/commit/9b43d41040b79cc8ad240dbadc66098bc8231c2b (add the ARG and edit the RUN command).

I don't really get why it has been removed at all? When using only the "homepage": "." variant, synapse-admin still expects to be served at /. I originally added #266, because there was no way to configure it to be anywhere else (at least I wasn't able to do so) besides changing source code. So what is the added value @awesome-michael?

Wouldn't it work to just not provide a default value to ARG PUBLIC_URL like with REACT_APP_SERVER? Then the environment variable in the RUN instruction wouldn't exist, causing React to still use the homepage setting. Users relying on PUBLIC_URL would still be able to use it without modifying the Dockerfile.

MexHigh avatar Sep 30 '23 19:09 MexHigh