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

Make API_BASE_PATH, UI_BASE_PATH, UI_EXTERNAL_LOGIN_URI configurable at load-time #111

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

himdel
Copy link
Collaborator

@himdel himdel commented Oct 18, 2024

Closes #93

The UI builds produced by npm run build can be further configured by serving a /pulp-ui-config.json alongside the built UI. (Note it has to be mapped at /, not just wherever index.html is served from.)

  • API_BASE_PATH - defaults to /pulp/api/v3/ - change when using domains or a different path
  • UI_BASE_PATH - defaults to /ui/ - change when only serving index in a subdirectory, or want different browser path prefix
  • UI_EXTERNAL_LOGIN_URI - defaults to nothing - set to something like /login/ when using an SSO
  • EXTRA_VERSION - an extra version string to display in about modal

Also documents API_PROXY in dev mode, and restore SSO logic when UI_EXTERNAL_LOGIN_URI is set.


default config in pulp-ui/pulp-ui-config.json gets copied by CopyWebpackPlugin to dist/,
and must be served from /pulp-ui-config.json in the webserver config for this to work.

src/ui-config.ts (imported from src/entrypoint.tsx) then loads it and populates a config export on success.

entrypoint then ensures we wait for the promise before rendering anything that would need to use that config

Cc @gerrod3

@himdel himdel changed the title Make API_BASE_PATH, UI_BASE_PATH, UI_EXTERNAL_LOGIN_URI configurable Make API_BASE_PATH, UI_BASE_PATH, UI_EXTERNAL_LOGIN_URI configurable at load-time Oct 18, 2024
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 this pull request may close these issues.

Support configurable base path at runtime
1 participant