Moonshine-IDE / Super.Human.Installer

Super.Human.Installer helps you install the latest and greatest HCL Domino technologies easily.

Home Page:https://superhumaninstaller.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validate Hosts File Entry

JoelProminic opened this issue · comments

I went through Super.Human.Installer with @feather812002, and he ran into some trouble because the IP address changed for the VM, and he did not update the /etc/hosts file.

NOTE: Currently /etc/hosts is not updated automatically because we don't want to prompt the user for Administrator permissiones. If we change this later, this issue will probably be unnecessary.

My idea for this is:

  1. User creates or restarts server
  2. Vagrant scripts run. When they finish, they write some information to verify (at least the IP address)
  3. SHI updates the status
  4. SHI runs a check to verify that the hosts file is configured properly. This will normally fail when the server is first created, and it will also fail if the assigned IP address changed on a restart or recreate.
  5. SHI shows some instructions to update the hosts file. This could be as simple as pointing the user to the Welcome page

Some options for the status check

  • Do a simple regex against the hosts file to check for an entry for the domain
  • Do a ping or other lookup to check that the base domain resolves correctly. Note that a command or API like nslookup can bypass the hosts file, so this would not work.
  • Do validation against all entries or the full host file line

Here are some ideas for the data returned by the provisioner. If we want to support future provisioners, we would need a standardized format this output:

  • The current IP address. This should be sufficient for a basic test against the base domain. I think this is already returned
  • The expected subdomains - this can vary based on the provisioner or which roles the user enabled
  • The full hosts file line - this would be needed if we want to add full instructions in the SHI UI.

This isssue is not a high priority, and we could start with a simple implementation before adding some of the more complicated ideas above.

Also note that we recently found that there was a limit to the length of the hosts file lines, so the user could potentially need to add multiple lines. This will make it more difficult to verify the exact hosts file lines. We'll also need to keep this in mind if we want to display the expected hosts lines in the instructions.

Note that the changes to #120 should mean that we will be better able to detect IP changes that could require an update to the Hosts file.