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

Change appConfigPath in index.html to be compatible with both Kubernetes and non-Kubernetes deployments #2454

Open
robyngit opened this issue Jun 18, 2024 · 2 comments · Fixed by #2463

Comments

@robyngit
Copy link
Member

To accommodate the planned structure in Kubernetes deployments, we need to change the appConfigPath in index.html from an absolute path to a relative one.

The current path, var appConfigPath = "/config/config.js", is a problem for metacatui deployments that are in a sub-directory of a domain, like https://arcticdata.io/catalog. Currently, this deployment updates the config path in index to prepend /catalog/ to the start of the path, but this would not be needed if we use the relative path instead.

We should ensure that this change will be compatible with all existing (non Kubernetes) installations.

See also #2453

@rushirajnenuji
Copy link
Member

Hi @robyngit and @artntek -

Ran into the issue with the local deployment of metacatUI, with the most recent develop branch of MetacatUI.

It looks like MetacatUI runs into issues with getting the config when you directly navigating links in the app.

Error:

The loader.js file failed to load. The MetacatUI `root` setting is probably incorrect. Set a `root` path for MetacatUI in the AppConfig.

To reproduce,

  • checkout develop branch
  • set up config:
MetacatUI.AppConfig = {
    root: "/",
    theme: "arctic",
}
  • run local npm server
  • visit any page https://localhost:3000/view/{PID} or https://localhost:3000/portals/{portal_label}

@robyngit
Copy link
Member Author

Thanks for finding this @rushirajnenuji ! You're right, this solution isn't going to work. I'm going to re-open this issue and revert the change in develop... @artntek we'll need to figure out another way to do this

@robyngit robyngit reopened this Jul 17, 2024
@robyngit robyngit changed the title Change appConfigPath in index.html to the relative path config/config.js Change appConfigPath in index.html to be compatible with both Kubernetes and non-Kubernetes deployments Jul 17, 2024
robyngit added a commit that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants