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

Vue.js / Application urls are not working properly behind a reverse proxy with a context path (context path is duplicated) #205

Closed
lsauer opened this issue Jul 27, 2022 · 4 comments
Labels
defect Something isn't working p3 Nice-to-have features
Milestone

Comments

@lsauer
Copy link

lsauer commented Jul 27, 2022

The application is running on the path /dtrack/. Since almost all content is created by vue.js on the clientside rather on the server side, rewriting urls with the reverse proxy is quite futile.

The situation is as follows. the app is started from dtrack, but the js, etc resources are loaded from the root:
image

Current Behavior:

When hovering over a component in Home > Project > the url appears correct
image

image
The same misbehaviour is also true for the tags
image

The url is set in the DOM as ../dtrack/hash , which in principle is correct. However vue.js clearly has a event-handler on the element to route it and the router is forwarding to

basedomain/dtrack/dtrack/hash with a 404
image

/components may also be affected. I cannot test this right now.

Steps to Reproduce:

See above. Clicking the link

Expected Behavior:

opening the same url as indicated by the browser url preview at the bottom-left.

Environment:

  • Dependency-Track Version: 4.5
  • Distribution: Docker
  • BOM Format & Version: -
  • Database Server: H2
  • Browser: Chrome, Firefox latest

Additional Details:

The context path has to be set in vue.js It has a function getContextPath

Since most of the UI's urls actually work I am assuming this is a small bug of this particular 'project' Router/Controller Configuration.

It would help tremendously if all the js,static,css etc... could be moved into ONE unique path, called dtrack for everyone. There are few downsides, but many upsides.

The Eventlistener is here in App.vue:

It is pushed to the router, where I guess it is filtered out as a non App-native link because Vue.js does not have a basepath

image

I just saw, this was hinted here: DependencyTrack/dependency-track#1831 (reply in thread)

@nscuro
Copy link
Member

nscuro commented Jul 27, 2022

Related to #153.

As mentioned in DependencyTrack/dependency-track#1831 (reply in thread), it's kind of a known issue, but we didn't have the time to look into it yet. If you'd like to contribute a fix, I think you'd make lots of other folks really happy!

@nscuro nscuro transferred this issue from DependencyTrack/dependency-track Jul 27, 2022
@nscuro nscuro added defect Something isn't working help wanted Extra attention is needed p3 Nice-to-have features and removed in triage labels Jul 27, 2022
@lsauer
Copy link
Author

lsauer commented Aug 4, 2022

Related to #153.

As mentioned in DependencyTrack/dependency-track#1831 (reply in thread), it's kind of a known issue, but we didn't have the time to look into it yet. If you'd like to contribute a fix, I think you'd make lots of other folks really happy!

The bug may only presents itself in the custom Project-controller , and you considered that if the basePath is kept relative than everything may work. Could you revisit the issue of a empty built-time basePath. #153 (comment)

All other controllers seam fine.
Generally speaking it would help a lot for the folks using reverse proxies if all the resources of the frontend like js/, css/, static/ could be moved behind a common path like dtrack/js, dtrack/css. Is that something you would be willing to consider?

@jeremytbrun
Copy link

I'm running into this issue as well. Would like to run this behind a reverse proxy but status prefetch content is not being handled appropriately.

@nscuro nscuro removed the help wanted Extra attention is needed label Sep 22, 2024
@nscuro
Copy link
Member

nscuro commented Sep 22, 2024

Implemented in #801

@nscuro nscuro closed this as completed Sep 22, 2024
@nscuro nscuro added this to the 4.12 milestone Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something isn't working p3 Nice-to-have features
Projects
None yet
Development

No branches or pull requests

3 participants