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

Changes to use CLI args to configure VIEWER_ORIGIN for lighthouse server #1004

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

Conversation

bkjam
Copy link

@bkjam bkjam commented Jan 15, 2024

Hi,

I like the solution in #637 which allows us to change the default self-hosted lighthouse report viewer. However, I noticed that the $VIEWER_ORIGIN environment variable works only if you build a custom @lhci/server package. Hence, I made some modifications to configure $VIEWER_ORIGIN for @lhci/server via the CLI args.

I changed the following things:

  • added an optional --viewer.origin cli args for server (Default: https://googlechrome.github.io)
  • added /v1/viewer/origin endpoint that retrieves the viewer.origin value
  • updated the server docs

This may not be the most optimal solution, so I would appreciate any feedback on my approach and code changes. Thank you :)

@connorjclark
Copy link
Collaborator

However, I noticed that the $VIEWER_ORIGIN environment variable works only if you build a custom @lhci/server package.

Do you mean that it only works if you host your own LHCI server? As I understand, you don't need to build anything yourself - the package from npm for @lhci/server will work if you run it with VIEWER_ORIGIN env defined.

If you aren't hosting your own LHCI server, I'm a bit confused why you'd want to be hosting your own report viewer. If that's the case can you explain your use case a bit more?

Otherwise, the code looks good, I'm just not sure why its needed yet.

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.

None yet

2 participants