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

PATH_PREFIX doesn't seem to work #114

Closed
staugaard opened this issue Aug 24, 2024 · 4 comments · Fixed by #115
Closed

PATH_PREFIX doesn't seem to work #114

staugaard opened this issue Aug 24, 2024 · 4 comments · Fixed by #115

Comments

@staugaard
Copy link

I'm trying to set up River UI behind Traefik and want to use PATH_PREFIX. It does not seem to work.

Here is my compose service:

  river-ui:
    image: ghcr.io/riverqueue/riverui:latest
    environment:
      DATABASE_URL: my-postgres-url
      PATH_PREFIX: /continent/river
    labels:
      - traefik.enable=true
      - traefik.http.routers.river-ui.rule=Host(`my-domain.com`) && PathPrefix(`/continent/river`)
      - traefik.http.routers.river-ui.middlewares=internal-auth@file
      - traefik.http.services.river-ui.loadbalancer.server.port=8080

When I open /continent/river in my browser, I do get the river UI HTML page, but it tries to load assets on the root.

The returned HTML document looks like this:

<!doctype html>
<html lang="en" class="h-full">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="32x32" />
    <link rel="icon" href="/icon.svg" type="image/svg+xml" sizes="any" />
    <link
      rel="apple-touch-icon"
      href="/apple-icon.png"
      type="image/png"
      sizes="512x512"
    />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>River</title>
    <script type="module" crossorigin src="/assets/index-BfbmKDfG.js"></script>
    <link rel="modulepreload" crossorigin href="/assets/dagrejs-BYkk81-A.js">
    <link rel="modulepreload" crossorigin href="/assets/react-dom-BOasIFCf.js">
    <link rel="modulepreload" crossorigin href="/assets/reactflow-BySh6Uv9.js">
    <link rel="stylesheet" crossorigin href="/assets/index-DVN-ewOD.css">
  </head>
  <body class="bg-white dark:bg-slate-900 h-full">
    <div id="root" class="h-full"></div>
  </body>
</html>

What am I doing wrong?

@staugaard
Copy link
Author

I see from looking at the Dockerfile that PATH_PREFIX must be handled at image building time.

It would be great if this could be done at run time.

@bgentry
Copy link
Contributor

bgentry commented Aug 24, 2024

Definitely agree, been trying to sort out a way to get both Vite and Tanstack Router to cooperate with a dynamic path prefix.

@bgentry
Copy link
Contributor

bgentry commented Aug 26, 2024

This will be fixed in the upcoming release I'll ship shortly. :shipit:

@staugaard
Copy link
Author

Fantastic. Many thanks for the quick response! I can confirm that the change works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants