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 URL of sourcify server and repository configurable #21

Merged
merged 2 commits into from
Aug 18, 2023

Conversation

svienot
Copy link
Contributor

@svienot svienot commented Aug 15, 2023

Description:

These changes allow to configure the URL of the server and repository services via runtime environment variables:

  • the URL of the server and repository can be defined with the $SERVER_URL and $REPOSITORY_SERVER_URL environment variables
  • the Docker ui-entrypoint.sh is used to insert a piece of script in the index.html of the select form. This script uses the value of $SERVER_URL and $REPOSITORY_SERVER_URL to set corresponding custom variable in the global window object
  • the React code can access these values inside the window object
  • the URLs will be set to those values, if the environment variable are defined, and to the values assigned at build time to $REACT_APP_SERVER_URL and $REACT_APP_REPOSITORY_SERVER_URL (respectively) otherwise.

Related issue(s):

Fixes #20

Notes for reviewer:

This is code is already running in the POC server (pointed to by Hashscan staging).

Signed-off-by: Simon Viénot <simon.vienot@icloud.com>
…L environment variables.

Signed-off-by: Simon Viénot <simon.vienot@icloud.com>
@svienot svienot merged commit f550e7e into main Aug 18, 2023
2 checks passed
@svienot svienot deleted the dynamic-ui-configuration branch August 18, 2023 08:30
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.

URL of server and repository are fixed at build time in ui
1 participant