Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run in subpath #333

Open
drequivalent opened this issue Feb 13, 2024 · 2 comments
Open

Can't run in subpath #333

drequivalent opened this issue Feb 13, 2024 · 2 comments
Labels
bug Something isn't working triaged Is triaged by maintainers

Comments

@drequivalent
Copy link

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 drequivalent added the bug Something isn't working label Feb 13, 2024
@charlynguyen charlynguyen added the triaged Is triaged by maintainers label Mar 19, 2024
@charlynguyen
Copy link
Contributor

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

Feel free to contribute 😉

@kaffeeknecht
Copy link

kaffeeknecht commented Jun 13, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged Is triaged by maintainers
Projects
None yet
Development

No branches or pull requests

3 participants