MageSail (`MageSail_Magesail`) integrates [Holesail](https://www.npmjs.com/package/holesail) with Magento 2 Admin: tunnel lifecycle, optional NGINX global-map updates, and storefront routing for tunneled hosts.
## Development tests (repository root)
PHPUnit, PHPStan (tests + scanned `Model/`), and PHPCS run from the repo root after `composer install` — see the root [`composer.json`](../composer.json), [`phpunit.xml.dist`](../phpunit.xml.dist), and [`.github/workflows/ci.yml`](../.github/workflows/ci.yml).
Admin route prefix: **`magesail`** (see [`Magesail/etc/adminhtml/routes.xml`](../Magesail/etc/adminhtml/routes.xml)). URLs are under your Magento admin base (`/admin_xxx/magesail/...`).
## Menu: MageSail → Holesail Tunnel
## Menu: MageSail
Defined in [`Magesail/etc/adminhtml/menu.xml`](../Magesail/etc/adminhtml/menu.xml). The module registers a **top-level** admin sidebar entry **MageSail**with `sortOrder="78"`. The sail icon uses `.admin__menu .item-magesail.parent.level-0 > a:before` in [`view/adminhtml/web/css/magesail-admin-menu.css`](../Magesail/view/adminhtml/web/css/magesail-admin-menu.css), following the same stacked-icon layout as Magento’s `.admin__menu-link()` pattern in the admin theme (`_menu.less`: block `::before`, `margin-bottom` on level-0 links).
Defined in [`Magesail/etc/adminhtml/menu.xml`](../Magesail/etc/adminhtml/menu.xml). The module registers a **top-level** admin sidebar entry **MageSail**(`resource`**`MageSail_Magesail::magesail`**) with `sortOrder="78"`. **Holesail Tunnel** (Manage Tunnel, How-To, About) is grouped under a submenu; **NGINX Global Map** and **Configuration** are direct children of **MageSail** so admins with only **config** ACL still see those items. The sail icon uses `.admin__menu .item-magesail.parent.level-0 > a:before` in [`view/adminhtml/web/css/magesail-admin-menu.css`](../Magesail/view/adminhtml/web/css/magesail-admin-menu.css).
- **Block**: [`Block/Adminhtml/Tunnel.php`](../Magesail/Block/Adminhtml/Tunnel.php) — UI init JSON for RequireJS [`magesail-tunnel-ui.js`](../Magesail/view/adminhtml/web/js/magesail-tunnel-ui.js) via `x-magento-init` in the template.
The same URL shows two in-page tabs: **Tunnels list** (grid, log tails, start/stop/remove) and **Add a tunnel** (provision form). With no tunnels yet, the **Add a tunnel** tab is selected by default. Optional URL fragments `#magesail-list` and `#magesail-add` (also `#list` / `#add`) open the corresponding tab after load. Long-running actions (**Create and start tunnel**, **Start** / **Stop** / **Remove** on a row) show an in-page **Please wait…** overlay; after a successful create or any successful reload, the URL is set to `#magesail-list` before reload so **Tunnels list** is active.
@@ -51,7 +51,7 @@ Start/stop/delete return JSON when the request is AJAX (`X-Requested-With: XMLHt
- **Block / template**: [`Block/Adminhtml/Nginx/Map.php`](../Magesail/Block/Adminhtml/Nginx/Map.php), [`view/adminhtml/templates/nginx/map.phtml`](../Magesail/view/adminhtml/templates/nginx/map.phtml) — editor logic in [`magesail-nginx-map.js`](../Magesail/view/adminhtml/web/js/magesail-nginx-map.js) with translated strings from the block.
Full-screen tools for the configured **global map** file: on load, **Parse & Load Blocks** runs automatically (when the map path is configured); read raw content, write, parse into blocks, save blocks, run **`nginx -t`** via a minimal generated config, trigger reload (or wrapper), and diagnostics. Sub-actions are selected with request param **`action`**: `read`, `write`, `validate`, `reload`, `parse`, `save_blocks`, `diagnostics` (AJAX/JSON when `X-Requested-With: XMLHttpRequest` or `ajax=1`).
- **Menu id**: `MageSail_Magesail::howto` — listed after **Configuration** under **Holesail Tunnel**; **ACL**: `MageSail_Magesail::tunnel`.
- **Menu id**: `MageSail_Magesail::howto` — under **Holesail Tunnel**; **ACL**: `MageSail_Magesail::tunnel_view`.
In-page guide: recommends **Holesail Browser** (extension) as the primary client for Magento; tunnel workflow; copy-paste examples for **NGINX**, **Apache httpd**, **NGINX Proxy Manager**, and **cURL**; CLI/npm option; **Use TLS** when using local port **443**; security notes; pointers to multistore / NGINX docs. Styles: [`magesail-howto.css`](../Magesail/view/adminhtml/web/css/magesail-howto.css).
@@ -77,13 +77,17 @@ In-page guide: recommends **Holesail Browser** (extension) as the primary client
- **`MageSail_Magesail::tunnel_manage`** — Mutating tunnel actions (create/start/stop/remove) in addition to what **view** allows when combined with **tunnel_view** for the UI.
- **`MageSail_Magesail::config`** — **Configuration** redirect and **NGINX Global Map** editor.
Assign roles under **System → Permissions → User Roles**.
Legacy installs that had only **`MageSail_Magesail::tunnel`** or **`MageSail_Magesail::config`** in `authorization_rule` receive extra rules from [`Setup/Patch/Data/GrantMagesailMenuAcl.php`](../Magesail/Setup/Patch/Data/GrantMagesailMenuAcl.php) on `setup:upgrade`: **`magesail`** menu ACL; roles with **tunnel** also get **tunnel_view** and **tunnel_manage** so behavior stays full-access until you tighten roles.
**Status / Logtail** controllers allow **tunnel**, **tunnel_view**, or **tunnel_manage** (or legacy **tunnel** rule). Assign roles under **System → Permissions → User Roles**.
@@ -27,7 +27,7 @@ Controlled only by Admin config **Auto-restart on crash** — no code changes in
## Database log table
[`MagesailLog`](../Magesail/Model/MagesailLog.php) inserts into **`magesail_logs`** (`message`, `created_at`), created by [`Setup/InstallSchema.php`](../Magesail/Setup/InstallSchema.php). Messages are truncated to 255 characters.
[`MagesailLog`](../Magesail/Model/MagesailLog.php) inserts into **`magesail_logs`** (`message`, `created_at`), defined in [`db_schema.xml`](../Magesail/etc/db_schema.xml). Messages are truncated to 255 characters.
The `magesail_logs` table is defined in declarative schema [`Magesail/etc/db_schema.xml`](../Magesail/etc/db_schema.xml). Older releases used `Setup/InstallSchema.php`; that installer was removed in favor of `setup:upgrade` + declarative schema only. Existing installations that already ran the old installer keep their table; new installs get the same structure from `db_schema.xml`.
## Node dependencies
One-time (from the `scripts` directory — use the path that matches your install):
- Admin: **MageSail → Holesail Tunnel** appears (**Manage Tunnel**, **NGINX Global Map**, **Configuration**) in the main sidebar as a **top-level****MageSail** entry (no dependency on other extensions).
- Database: table `magesail_logs` after `setup:upgrade` (see [`Setup/InstallSchema.php`](../Magesail/Setup/InstallSchema.php)).
- Database: table `magesail_logs` after `setup:upgrade` (see [`db_schema.xml`](../Magesail/etc/db_schema.xml)).
- Optional: open **Manage Tunnel**, add a test tunnel (website/group, port, hostname), then **Remove** if you only wanted to verify the UI.
## Scripts shipped as PHP (not autoloaded as module code)
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.