feat(admin): accept hostname-only tunnel URLs (auto http/https)

TunnelStoreProvisioner expands bare hosts to http:// for unsecure and
https:// for optional secure; full URLs still work. Tunnel block strips
scheme for prefill display. Update tunnel template copy, Index error
text, and README/docs.
This commit is contained in:
2026-03-21 00:11:47 -05:00
parent 6080eaa9d5
commit 80981cfe62
9 changed files with 67 additions and 22 deletions
+2 -2
View File
@@ -14,8 +14,8 @@ Defined in [`Magesail/etc/adminhtml/menu.xml`](../Magesail/etc/adminhtml/menu.xm
**Stopped state**
- **Tunnel base URL (unsecure)** — required before **Start Tunnel**; must match the hostname you use in the browser / holesail-browser vhost.
- **Tunnel base URL (secure)** — optional; see [tunnel-store-and-multistore.md](tunnel-store-and-multistore.md).
- **Tunnel hostname (unsecure)** — required before **Start Tunnel**; enter hostname only (e.g. `dev.myshop.local`); stored as `http://host/`. Must match the browser / holesail-browser vhost.
- **Tunnel hostname (secure, optional)** — hostname only; stored as `https://host/` when set. Full URLs with scheme still accepted. See [tunnel-store-and-multistore.md](tunnel-store-and-multistore.md).
- **Use secure URLs on storefront and in admin** — optional checkbox; drives scoped `web/secure/*` flags when provisioning.
**Start** sends an AJAX (or form) request with `action=start` and the URL fields; the controller provisions the tunnel store, updates NGINX map if configured, then starts Node.
+1 -1
View File
@@ -7,7 +7,7 @@
| **Command failed** / Node error | `node` missing or not on PATH for PHP user | Install Node 18+; confirm `sudo -u www-data which node`. |
| | `npm install` not run in `scripts/` | Run `npm install` in the configured **Scripts directory**. |
| **Invalid port** | Config not 80/443 | Set **Port** to 80 or 443 under Holesail Tunnel settings. |
| **Tunnel base URL is required** | Empty unsecure URL on start | Fill **Tunnel base URL (unsecure)** to match your browser/proxy host. |
| **Tunnel hostname is required** | Empty unsecure field on start | Fill **Tunnel hostname (unsecure)** (e.g. `dev.myshop.local`) to match your browser/proxy host. |
## PID / process
+5 -3
View File
@@ -8,9 +8,11 @@ It is created on the **default website**s **default store group** when you **
## Base URLs
You must supply at least **Tunnel base URL (unsecure)** in Admin. It should match the hostname users see in the browser when using holesail-browser (or your proxy), including scheme (`http` vs `https`).
You must supply at least the **unsecure hostname** in Admin (e.g. `dev.myshop.local` without `http://`). The module saves **`http://hostname/`** as the unsecure base URL. Optional **secure hostname** (without `https://`) becomes **`https://hostname/`**. You can still paste a full `http://` or `https://` URL; schemes are preserved when already present.
Optional **Tunnel base URL (secure)** and **Use secure URLs on storefront and in admin** drive scoped configuration:
The configured base URLs must match what users see in the browser when using holesail-browser (or your proxy) for host/scheme expectations.
**Use secure URLs on storefront and in admin** drives scoped configuration:
- `web/unsecure/base_url`
- `web/secure/base_url`
@@ -18,7 +20,7 @@ Optional **Tunnel base URL (secure)** and **Use secure URLs on storefront and in
## Persisted state: `var/magesail_tunnel_store.json`
[`TunnelStoreState`](../Magesail/Model/TunnelStoreState.php) writes JSON containing `store_id`, `store_code`, base URLs, `use_secure_urls`, and optionally `nginx_pending_reload`. The Admin tunnel page prefills the URL fields from this file when the tunnel is stopped.
[`TunnelStoreState`](../Magesail/Model/TunnelStoreState.php) writes JSON containing `store_id`, `store_code`, full base URLs, `use_secure_urls`, and optionally `nginx_pending_reload`. The Admin tunnel page **displays hostnames only** (scheme stripped) when the tunnel is stopped, for easier editing.
## Teardown