threefoldtech / tf-images

Apache License 2.0
1 stars 3 forks source link

Wordpress Custom Domain IPv4 No HTTPS #190

Open Mik-TF opened 10 months ago

Mik-TF commented 10 months ago

Issue

Wordpress weblet when set with ipv4 and custom domain only has HTTP and not HTTPS, as reported by Nelson on the TF Forum, and also tested once more independently on Freefarm node id 10.

Screen Shot 2024-01-04 at 11 39 54 PM
scottyeager commented 9 months ago

This is the only case where the gateway won't terminate TLS for the deployment. For the Nextcloud weblet, we did the following:

  1. Pass in the public IPv4 and custom domain status as env vars to the flist (this is done on the sdk-ts side)
  2. Run a script against these vars inside the VM at startup, and write out the config files accordingly
  3. Caddy is running as a reverse proxy inside the VM either way to help with some other stuff, so it's easy to configure it for auto HTTPS

In the case of the WordPress image, Apache could be configured for HTTPS conditionally and some machinery added to handle acquiring/renewing the certs. Or we can also use Caddy as a reverse proxy as I describe here.