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

Support base path of frontend with depth > 1 #153

Closed
bruegth opened this issue May 25, 2022 · 4 comments
Closed

Support base path of frontend with depth > 1 #153

bruegth opened this issue May 25, 2022 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@bruegth
Copy link

bruegth commented May 25, 2022

Current Behavior:

Basepath with depth > 1 not working

When changing vue.config.js to publicPath to:
e.g. /-/dtrack/
https://github.com/DependencyTrack/frontend/blob/master/vue.config.js#L8
with NGINX config:

  location /-/dtrack/ {
    alias     /opt/owasp/dependency-track-frontend/;
    index     index.html;
    try_files $uri $uri/ /index.html;
  }

Proposed Behavior:

Basepath with depth > 1 is working

Related source:
https://github.com/DependencyTrack/frontend/blob/master/src/views/portfolio/projects/ProjectList.vue#L84
https://github.com/DependencyTrack/frontend/blob/master/src/shared/utils.js#L67

@bruegth bruegth added the enhancement New feature or request label May 25, 2022
@stevespringett
Copy link
Member

@nscuro, correct me if I'm wrong, but didn't we remove support for non-root deployment paths of the frontend due to OIDC complexities.

I think it's expected that NGINX would have similar issues when trying to proxy as a non-root path, correct?

@nscuro
Copy link
Member

nscuro commented May 25, 2022

I believe it wasn't so much because of OIDC specifically, but more so due to the split of the frontend into a separate artifact.

publicPath is a built-time variable:

publicPath: "/",

So it cannot be modified at runtime when the frontend container starts. We had the choice of leaving publicPath empty, which would load all resources relative to the current path, or making it absolute like it is now. The relative path was previously used, and it worked because Alpine's WhitelistUrlFilter did some black magic behind the scenes. So for the bundled distribution it was not an issue.

That being said, we can and should revisit this. Maybe there is a workaround or solution that we didn't consider the last time we looked at it.

@ngc4579
Copy link

ngc4579 commented Sep 20, 2024

This issue has been around for quite a while now. Is there any progress happening behind the scenes? We'd love to use Dependency Track, but are actually forced to use context paths (in contrast to a root deployment), so ATM we cannot deploy DT...

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

nscuro commented Sep 22, 2024

In fact this was implemented by a contributor and will be shipped with v4.12: #801

@nscuro nscuro added this to the 4.12 milestone Sep 22, 2024
@nscuro nscuro closed this as completed Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants