-
Notifications
You must be signed in to change notification settings - Fork 23
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
adding feature to allow for override of the default rekor domain on s… #67
Conversation
…tartup of the UI Signed-off-by: Ahmed Alsabag <[email protected]>
This app supports overriding of the default rekor server instance for those running private instances of the the sigstore stack. | ||
Create a `.env.local` file at the root and include in it this environment variable | ||
```properties | ||
NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN=https://privaterekor.sigstore.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this would be for private instances, it feels like we should not use PUBLIC
in the variable name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I think however this might be a requirement defined by Next.js. Otherwise the variable would not be available for use in the browser.
Non-NEXT_PUBLIC_ environment variables are only available in the Node.js environment, meaning they aren't accessible to the browser (the client runs in a different environment).
In order to make the value of an environment variable accessible in the browser, Next.js can "inline" a value, at build time, into the js bundle that is delivered to the client, replacing all references to process.env.[variable] with a hard-coded value. To tell it to do this, you just have to prefix the variable with NEXT_PUBLIC_. For example:NEXT_PUBLIC_ANALYTICS_ID=abcdefghijk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps it's worth adding some additional comments in the tsx files to denote the purpose? It's pretty confusing, though now I see it wasn't intended
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps it's worth adding some additional comments in the tsx files to denote the purpose? It's pretty confusing, though now I see it wasn't intended
I'm on it sir!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment in the context.tsx file. Let me know if that's sufficient
Signed-off-by: Ahmed Alsabag <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me.
Signed-off-by: Ahmed Alsabag <[email protected]>
fixed some spacing/linting @bobcallaway @lukehinds. Should hopefully do it 🤞 |
sigstore#67) * adding feature to allow for override of the default rekor domain on startup of the UI Signed-off-by: Ahmed Alsabag <[email protected]> * adding comment to explain the use of the NEXT_PUBLIC prefix Signed-off-by: Ahmed Alsabag <[email protected]> * fixing formatting and spacing issues Signed-off-by: Ahmed Alsabag <[email protected]> --------- Signed-off-by: Ahmed Alsabag <[email protected]>
…tartup of the UI
Summary
Closes #51
Release Note
For those running private instances of Rekor and Rekor Search UI, you can now configure a default domain at compile time as opposed to solely relying on making the change in the Settings panel post-startup.
Documentation
Documentation changes have been added to the README.md as the current documentation makes no reference to the rekor-search-ui