Moonshine-IDE / Super.Human.Portal

Portal interface to show documentation for DominoVagrant and Super.Human.Installer
Other
0 stars 1 forks source link

Compare the page for nomad_helper_url to the expected nomadhelper.html #57

Open piotrzarzycki21 opened 1 month ago

piotrzarzycki21 commented 1 month ago

We also want to compare the page for nomad_helper_url to the expected nomadhelper.html and show a similar warning if they don't match exactly. Genesis doesn't have access to install nomad_helper.html, so we want to have SuperHumanPortal verify that the nomad_helper.html installed by the administrator matches the copy under resources/.

If we are reading nomad_helper_url, then we need to safely handle the case where the URL doesn't resolve properly (because it was not properly configured). I would expect the administrator to test this, but until it is fixed, Super.Human.Portal should use the default logic instead.

A mismatching nomad_helper.html is not necessarily a blocker, so I think we should attempt to use the helper anyway in this case. If this fails, it should be handled by the callback logic.

Originally posted by @JoelProminic in https://github.com/Moonshine-IDE/Super.Human.Portal/issues/54#issuecomment-2088775767

piotrzarzycki21 commented 1 month ago

@JoelProminic I was thinking to have that comparision during configuration fetching, where we are retrieving nomad_helper_url. Where do you think it should actually happen if not in that moment ?

piotrzarzycki21 commented 1 month ago

I'm moving this for the next release. I have started implementing this. Should be ready soon, but let's not hold this since our first target is internal use.

JoelProminic commented 1 month ago

I think that running this just after calling ConfigRead make sense. You can then load the nomad_helper_url and resources/nomad_helper.html pages into memory and compare them.

piotrzarzycki21 commented 1 month ago

I have implemented initial version, but it doesn't work yet as I wanted to so, it's still require a bit more time. I have pushed my changes to branch. I will notify about significant progress and when it will be ready for tests.

piotrzarzycki21 commented 1 month ago

@JoelProminic I think I have whole comparision of nomadhelper.html ready. I'm using HTTPRequest to load local and remote files. I'm using native JS module called "crypto" to compute hashes for both files.

Not we should discuss what kind of message we should display to the user.

JoelProminic commented 1 month ago

Here is a message based on the existing Nomad check

Nomad Helper does not match the current version of Super.Human.Portal. To fix this:

  • Copy %data_directory%/domino/html/Super.Human.Portal/js-release/resources/nomadhelper.html [Copy to Cllpboard] to /opt/hcl/domino/notes/latest/linux/nomad-files [Copy to Cllpboard] on your Nomad server

This should be displayed once per day per user.