@astrofoundry/pi-astro 0.40.22 → 0.40.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/network/SKILL.md +28 -1
package/package.json
CHANGED
package/skills/network/SKILL.md
CHANGED
|
@@ -76,7 +76,9 @@ Both consoles run Network `10.6.109`. The console serves no `openapi.json` (404)
|
|
|
76
76
|
| `clients` | GET | `clients/{id}/actions`: `AUTHORIZE_GUEST_ACCESS`, `UNAUTHORIZE_GUEST_ACCESS` |
|
|
77
77
|
| `wans`, `vpn/servers`, `vpn/site-to-site-tunnels`, `radius/profiles`, `switching/*`, `device-tags` | GET | read only |
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
The official API has no endpoint for these: Site Magic (read it with `unifi cloud`), NAT, switch port profiles and per-port settings (only power cycle), device settings (name, LEDs, uplink, management VLAN), client fixed IPs and names, port forwarding, static and traffic routes, VPN server and Teleport settings, admins, and console settings.
|
|
80
|
+
|
|
81
|
+
The cloud connector forwards any path under `/proxy/` of a console, and the account key `UNIFI_API_KEY` is accepted on the Network application's own paths: `unifi <site> nat` proves it for `/proxy/network/v2/api/site/default/nat` (2026-10-31). So "the official API lacks it" is not "impossible": before reporting a change as UI only, find the application path that the UniFi UI uses for it and add a narrow wrapper command, as `nat` was added. Only `nat` is wired today; the other items above stay owner tasks until a command exists. The local console keys were not tested on application paths. Never drive a browser for these changes.
|
|
80
82
|
|
|
81
83
|
Behavior learned on the live consoles:
|
|
82
84
|
|
|
@@ -88,6 +90,31 @@ Behavior learned on the live consoles:
|
|
|
88
90
|
- A policy has exactly one source zone and one destination zone; several destination zones need one policy each. The `SYSTEM_DEFINED` policies show each zone pair's default (on 37: Vpn to Dmz allows, Vpn to Services blocks).
|
|
89
91
|
- Traffic between 37 and Mira crosses two firewalls: `<zone> to Vpn` on the sending site and `Vpn to <zone>` on the receiving site. A subnet routes only if Site Magic shares it: `unifi cloud /v1/sd-wan-configs/<id>` lists the shared networks per site. 37 shares Services, Management, Trusted, and DMZ; Mira shares Trusted, IoT, Services, and Management.
|
|
90
92
|
|
|
93
|
+
## `unifi <37|mira> nat` and `unifi <37|mira> nat-write ...`
|
|
94
|
+
|
|
95
|
+
The gateway's NAT rules (Policy Table, type NAT), which the official API lacks. The wrapper calls the Network application's own path `/proxy/network/v2/api/site/default/nat` through the cloud connector with the account key `UNIFI_API_KEY`; `--local` uses the console's local key instead.
|
|
96
|
+
|
|
97
|
+
| Command | Effect |
|
|
98
|
+
|---|---|
|
|
99
|
+
| `nat` | list the rules |
|
|
100
|
+
| `nat-write POST <json>` | create a rule |
|
|
101
|
+
| `nat-write PUT <ruleId> <json>` | replace a rule (send the full object) |
|
|
102
|
+
| `nat-write DELETE <ruleId>` | delete a rule |
|
|
103
|
+
|
|
104
|
+
Rule ids and network ids here are the application's 24-hex ids, not the official API's UUIDs. Take a network's id from an existing rule's `in_interface`, or from `unifi cloud /v1/sd-wan-configs/<id>` (`networkId`). Every rule needs a unique `rule_index`: set it explicitly, lowest first; a second rule without one fails with `duplicate rule_index`. An `exclude: true` rule at a lower index exempts its match from the rules after it.
|
|
105
|
+
|
|
106
|
+
Both sites redirect IoT DNS with two DNAT rules on the IoT network (`in_interface` and `source_filter.network_conf_id`), TCP and UDP port 53:
|
|
107
|
+
|
|
108
|
+
| Site | Index 0 (`exclude: true`) | Index 1 |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| 37 | `IoT DNS redirect - ex. secondary`: leaves `10.0.40.54:53` alone | `IoT DNS redirect`: every other port-53 query to `10.0.40.53` |
|
|
111
|
+
| mira | `IoT DNS redirect - ex. secondary`: leaves `10.0.40.54:53` alone | `IoT DNS redirect`: every other port-53 query to `10.1.40.53` |
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{ "args": ["unifi", "37", "nat"] }
|
|
115
|
+
{ "args": ["unifi", "mira", "nat-write", "POST", "{\"type\":\"DNAT\",\"description\":\"IoT DNS redirect\",\"rule_index\":1,...}"] }
|
|
116
|
+
```
|
|
117
|
+
|
|
91
118
|
## `unifi cloud <path>`
|
|
92
119
|
|
|
93
120
|
Reads of the Site Manager API itself (`/v1/` or `/ea/`): `/v1/hosts` (consoles and their host ids), `/v1/sites`, `/v1/devices`, `/v1/sd-wan-configs` and `/v1/sd-wan-configs/{id}/status` (Site Magic), `/v1/isp-metrics/{type}`. Lists page with `pageSize` and `nextToken` in the query.
|