optic
optic copied to clipboard
Use built-in web server for optic diff --web instead of app.useoptic.com/cli/diff
Generally, i expect my CLI tools to work without web connection. As the data is passed through the URL anyway it should be possible to host the required files locally when the command is run and provide the user with a localhost version of the page.
Thanks @laundmo -- just to be clear about one thing up front -- we do not log, persist or inspect anything that page loads. The data to render the changelog page is computed locally, compressed, base64 encoded in the URL after the #
hash part of the url /cli/diff/#{data}
. Is the main reason you want it to run local privacy? Ability to run offline? Something else?
We've done the local server approach in the past, but it adds a lot to the binaries and was troublesome to know when to cleanup. Maybe since these changelogs aren't interactive it makes more sense, ie we start a server, keep it running long enough for the page to load, close it. Open to other ideas as well.
It's in part about privacy, (you do try to send a bunch of stuff to sentry) but more on the level of being assured that the site can't be silently updated. But the bigger things for me is definitely offline usage, and being able to guarantee that the exact version i have now will run forever no matter what happens to optic. what happens to my workflow if the optic site disappears tomorrow? or is bought out and promptly killed by a bigger company?
it seems like a needless risk to take, relying on your servers, when it's effectively a static page. maybe you wouldn't even need a built in server, and opening a html file from disk could be enough.
I understand the motivation. Definitely could imagine a static version that injected the same metadata into the page. I had not thought of building it that way. I'll keep this open as a feature request. If you have any examples of other tools you like that do something similar please share
@acunniffe I have a similar scenario and found this issue marked as completed. Could you kindly refer to the current solution for this issue?