matrix-neoboard icon indicating copy to clipboard operation
matrix-neoboard copied to clipboard

Can't run in subpath

Open drequivalent opened this issue 1 year ago • 2 comments

Describe the bug

Neoboard can't be run in a subpath proxied by nginx because the link to bundle.js seems to contain absolute path.

Steps To Reproduce

  1. Run Neoboard node /usr/bin/yarn start
  2. Proxy it with nginx:
location /neoboard/ {
        proxy_pass https://127.0.0.1:3000;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
}

  1. Go to https://your-server/neoboard
  2. Get white screen and 404 as the index page tries to get to /bundle.js which should be /neoboard/bundle.js

Expected behavior

Widget warning showing up

drequivalent avatar Feb 13 '24 15:02 drequivalent

Thanks for the report! 🙂 We picked up the issue. Updates will be shared here.

Feel free to contribute 😉

charlynguyen avatar Mar 19 '24 14:03 charlynguyen

Workaround

Apparently this works for the deployed demo at github-pages.

In .github/workflows/ci.yml I found: sed -i 's,"homepage": "/","homepage": "/matrix-neoboard",' matrix-neoboard-widget/package.json

After changing the line in matrix-neoboard-widget/package.json yarn build then tells me:

The project was built assuming it is hosted at /neoboard/.
You can control this with the homepage field in your package.json.

After setting up the reverse proxy as you told, I could successfully add the widget to a matrix room. Would love to configure this via environment variable and in the docker-image, maybe someone more "dev" then me can pick that up.

Kind regards, David

kaffeeknecht avatar Jun 13 '24 08:06 kaffeeknecht