question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Document that LHCI server must own the entire origin

See original GitHub issue

Hi, I’m trying to run the lhci server on a url like

http://dev-server.example.org/dev-tools/lighthouse-ci-server/app/

but the server tries to load everything relative to

http://dev-server.example.org/app/

for example http://dev-server.example.org/app/entry.fd7e7398.js. It also tries to redirect from http://dev-server.example.org/dev-tools/lighthouse-ci-server/ to http://dev-server.example.org/app/. I can’t find any way of setting the asset path at the moment but maybe I am missing something.

Would you be open to adding a base/public url or asset prefix config option for the server to support this use case?

I guess the mount path could be read on server startup but it looks like the asset path is set at build time so I’m not sure how easy this would be to configure at startup.

It looks like the upload command might already support this use case with the serverBaseUrl option, but I haven’t tested it. It would be great to have it for the server as well.

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jflayhartcommented, Jun 20, 2020

@nick-rudenko I think it will become more common to support this proxy stuff for bigger corporations having locked down servers, etc. Glad you asked! I happen to just write up a recipe for this setup.

Maybe it’s hacky, but it works by only exposing routes that matter for public-facing CI tools, while still keeping the LHCI web app GUI locked down and accessible behind VPN (doesn’t sacrifice security). It’s just what I had to do to get around the “must own entire origin” stuff cause I also was getting out of scope with my LHCI server if I had to make a subdomain!

Honestly, your best bet is probably a dedicated subdomain that can resolve paths relative baseUrl (ie origin). It just was more work for me to do that.

1reaction
patrickhulcecommented, May 14, 2020

Thanks for filing @niklasgrahl!

This is a thorny problem that would touch many layers of Lighthouse CI. Not only is the UI affected by every API client as well. The existing serverBaseUrl option you point out effectively only supports setting the origin at the moment. In fact I wonder if we should rename this to serverOrigin in 0.4.x to make that clearer 🤔

You’re also correct that because the base path is set at build time and we have SPA fake URL paths, any changing of the base path would require a custom build of the frontend code (or a significant rework of how the app references static assets).

Given all of these constraints and the considerable increase in testing surface it would require, I’m not sure this is something we can realistically consider for the near future of the project 😕

Happy to add whatever you think would be clear to the server documentation to make this limitation more upfront and obvious!

Read more comments on GitHub >

github_iconTop Results From Across the Web

thegeeklab/lhci - Quay.io
Repository thegeeklab/lhci. ... What you will get is the following file structure which could be used as an upload source: ... All results...
Read more >
Run Lighthouse on GitLab CI - Medium
CONS: it's public and temporary; no history;; on a Lighthouse CI server with target=lhci. PROS: historical archive of all tests;
Read more >
Lighthouse CI Beginner's Guide - Axelerant
We are all familiar with Lighthouse, the open-source, automated tool ... but LHCI needs to run a binary, so you have to install...
Read more >
How to upload the Lighthouse CI results as GitHub status ...
So I think lhci upload only applies if you have set up a Lighthouse CI server, which is not for setting the Lighthouse...
Read more >
Implement Lighthouse-CI with Your Web Development Workflow
Speaker: Ivan kristianto, GDE in Web TechnologyMonitoring and keeping web performance during development is a challenge, we can utilize and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found