STARTcloud / hcl_domino_standalone_provisioner

This spins up a Standalone Domino Instance, with additional HCL services like Traveler, NomadWeb, etc
Apache License 2.0
1 stars 0 forks source link

Broken welcome.html page in 0.1.22 #5

Closed piotrzarzycki21 closed 4 months ago

piotrzarzycki21 commented 5 months ago

We have discovered that after spin new server with 0.1.22 version of provisioner - welcome.html page is not available. Tested on Mac OS. Changes to fix this issue were applied in version 0.1.22 - manually.

Link to changes in SHI: https://github.com/Moonshine-IDE/Super.Human.Installer/commit/15dca0604d846c13de5c003275f92af18db29f5f

JoelProminic commented 5 months ago

Ah, thanks for the reminder on this @piotrzarzycki21. I remember @MarkProminic had concerns that the change to the default_backend was intentional, so this needs some investigation.

MarkProminic commented 5 months ago

This is because of the way that HAProxy is routing requests.

Any time HAproxy gets a request on a specific URL, something like nomadweb.demo.startcloud.com (replace demo.startcloud.com with your hostname) and there is a corresponding ACL rule for that Host name, HAproxy will send that request to the backend specified with that ACL.

When you set the default backend to Domino, all requests that don't have a ACL, even requests for the IP Address, which is dynamic and not set staticallt anywhere, will be sent to domino. Now because the Welcome page loads from the IP address in a browser because SHI cannot set Hosts records on the users local machine. As a result we have to open the web browser to an IP address. The Python Download tool, which is the main reason for startcloud_quick_start https://github.com/STARTcloud/startcloud_roles/tree/main/startcloud_quick_start

So for the welcome page to work it either needs to be

  1. default set to downloads (which exposes the welcome.html page and allows users to download files placed in /local/notesjava)
  2. moved to Domino (making the role a Domino dependent role, breaking its use with other applications)
  3. A different Mechanism that provides 1. A welcome page, 2. the ability to download files from a arbitrary directory on the VM.

I prefer Option 2 as this will make the role more ubiquitous

JoelProminic commented 5 months ago

I don't really have a strong preference for this. Some thoughts

Domino would be able to host welcome.html and the downloads if there are copied/symlinked under /local/notesdata/domino/html, but not arbitrary downloads from the filesystem.

Why did we want to change the default backend to Domino? Just so that domino. would not be required for Domino server URLs? The Domino server is the big highlight of the Super.Human.Installer instances, so it sounds appealing to have Domino be the default there.

For the additional provisioner support, I think we would want the welcome.html page to be part of the consistent interface for additional provisioners. However, I don't think it matters which backend is used, as long as https://%ip%/welcome.html works for each provisioner.

MarkProminic commented 5 months ago

I believe we wanted to change it to domino during tests of the Rest API. The exact reason is escaping me.

Also I made a type, when I said I prefer Option 2, I meant Option 1.

Option one can later be swapped out with a HTML5 implementation of it. The path that it loads files on the vm from is configurable.

JoelProminic commented 5 months ago

Ah, I thought the reasoning seemed strange for choosing Option 2 :)

I can understand why Option 1 would be more useful for reusability, as we move towards provisioners that are not Domino-based. As I said previously, though, it doesn't matter from the SHI perspective - as long as the page can open, it doesn't matter if is on Domino, Grails, Python, etc. Using a server that is already required on the instance would simplify the configuration, though - the current provisioner already has at least 3 servers besides Python Download.

MarkProminic commented 4 months ago

In the HAProxy configurations I have included a new ACL that regexes any request that looks like an IP and sends it to downloads.

This ensures that when Ansible has finished provisioning, the Hosts.rb, can open the Web browser to the IP address of the server. (since DNS cannot be preset).

https://github.com/STARTcloud/startcloud_roles/blob/944df9bee102e08f21a61c98b302b513d0f94829/roles/haproxy/templates/haproxy.cfg.j2#L153

So because of this, I have set the base domain to point to domino as the default https://github.com/STARTcloud/startcloud_roles/blob/944df9bee102e08f21a61c98b302b513d0f94829/roles/haproxy/templates/haproxy.cfg.j2#L201