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

adding feature to allow for override of the default rekor domain on s… #67

Merged
merged 3 commits into from
Nov 4, 2023

Conversation

aalsabag
Copy link
Contributor

@aalsabag aalsabag commented Nov 1, 2023

…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

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
Copy link
Member

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?

Copy link
Contributor Author

@aalsabag aalsabag Nov 1, 2023

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

Copy link
Member

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

Copy link
Contributor Author

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!

Copy link
Contributor Author

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

lukehinds
lukehinds previously approved these changes Nov 3, 2023
Copy link
Member

@lukehinds lukehinds left a 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.

@aalsabag
Copy link
Contributor Author

aalsabag commented Nov 3, 2023

fixed some spacing/linting @bobcallaway @lukehinds. Should hopefully do it 🤞

@bobcallaway bobcallaway merged commit 7f3e714 into sigstore:main Nov 4, 2023
6 checks passed
kahboom pushed a commit to kahboom/rekor-search-ui that referenced this pull request Mar 8, 2024
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]>
kahboom pushed a commit to kahboom/rekor-search-ui that referenced this pull request Aug 8, 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.

UI setup for Private Rekor Server
3 participants