hostinger-api-mcp 4.11.0 → 4.12.1

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/gemini-extension.json +1 -1
  3. package/package.json +1 -1
  4. package/server.json +2 -2
  5. package/skills/audit-vps/SKILL.md +10 -6
  6. package/skills/deploy-to-vps/SKILL.md +1 -0
  7. package/skills/headless/VERSION +2 -2
  8. package/skills/headless/steps/07-validate/SKILL.md +44 -8
  9. package/skills/headless/steps/08-deploy/SKILL.md +2 -1
  10. package/skills/headless/steps/09-done/SKILL.md +1 -1
  11. package/skills/provision-vps/SKILL.md +1 -0
  12. package/skills/secure-vps/SKILL.md +5 -3
  13. package/skills/troubleshoot-vps/SKILL.md +1 -0
  14. package/src/core/skills.js +24 -24
  15. package/src/core/skills.ts +24 -24
  16. package/src/servers/agency-hosting.js +1 -1
  17. package/src/servers/agency-hosting.ts +1 -1
  18. package/src/servers/agent-readiness.js +1 -1
  19. package/src/servers/agent-readiness.ts +1 -1
  20. package/src/servers/all.js +1 -1
  21. package/src/servers/all.ts +1 -1
  22. package/src/servers/billing.js +1 -1
  23. package/src/servers/billing.ts +1 -1
  24. package/src/servers/dns.js +1 -1
  25. package/src/servers/dns.ts +1 -1
  26. package/src/servers/domains.js +1 -1
  27. package/src/servers/domains.ts +1 -1
  28. package/src/servers/ecommerce.js +1 -1
  29. package/src/servers/ecommerce.ts +1 -1
  30. package/src/servers/gpu.js +1 -1
  31. package/src/servers/gpu.ts +1 -1
  32. package/src/servers/horizons.js +1 -1
  33. package/src/servers/horizons.ts +1 -1
  34. package/src/servers/hosting.js +1 -1
  35. package/src/servers/hosting.ts +1 -1
  36. package/src/servers/mail.js +1 -1
  37. package/src/servers/mail.ts +1 -1
  38. package/src/servers/reach.js +1 -1
  39. package/src/servers/reach.ts +1 -1
  40. package/src/servers/vps.js +1 -1
  41. package/src/servers/vps.ts +1 -1
  42. package/src/servers/wordpress.js +1 -1
  43. package/src/servers/wordpress.ts +1 -1
@@ -39,10 +39,10 @@ const skills: Skill[] = [
39
39
  "resources": [
40
40
  {
41
41
  "uri": "skill://audit-vps/SKILL.md",
42
- "digest": "sha256:2a88004add6a710278d254e74746a86bbe2e41b346f32223a3173e5975260902",
43
- "size": 7984,
42
+ "digest": "sha256:2ddb6f4ba46bc369f86e0a7a8fb7532c1f6f1eef23a8e657a71b6f9aea962b9d",
43
+ "size": 8979,
44
44
  "mimeType": "text/markdown",
45
- "text": "---\nname: audit-vps\ndescription: \"Audit every Hostinger VPS (KVM plans) on the account and report what needs attention: server state and failed actions, CPU, memory, disk and monthly traffic use, firewall missing or not synced, SSH keys, Monarx malware counts, backup age, Docker Manager projects that are not healthy, old OpenVZ servers, and VPS plans about to lapse. Read-only; produces a prioritised to-do list and names the skill or hPanel page that fixes each item. Triggers: what VPS do I have, audit my servers, check all my VPS, which servers need attention, health check my VPS, are my servers secure, is my VPS backed up, when does my VPS expire.\"\n---\n\n# Audit VPS\n\nRead-only from start to finish. The output is a report; every fix is a separate, confirmed step through another skill or in hPanel.\n\n## Calling the operations\n\n- Read the `inputSchema` that `search` returns before the first call of each operation. If a name below is rejected as unknown, `search` for what the step does (e.g. \"virtual machine metrics\").\n- Batch reads with `multi-execute`, up to 20 steps a batch. Batches chain operations from one server only — the Hostinger Connector runs `vps` and `billing` as separate servers. When a product group is switched off, skip its checks and say which were skipped.\n- `vps_virtual-machines_list` returns a plain array; paged lists (`vps_actions_list`, `vps_backups_list`, `vps_firewall_list`) return `data` and `meta`.\n- Call only read operations. Do not take a snapshot, sync a firewall, install Monarx or restart anything during the audit.\n\n## 1. Inventory\n\n- `vps_virtual-machines_list` — per server `id`, `hostname`, `plan`, `state`, `actions_lock`, `template.name`, `memory` and `disk` (MB), `bandwidth`, `firewall_group_id`, `subscription_id`, `ipv4[0].address`, `created_at`.\n- `vps_firewall_list` — every firewall group with its rules and `is_synced`.\n- `vps_data-centers_list` — to name each server's location from `data_center_id`.\n- `billing_subscriptions_list` (billing product) — joined to servers on `subscription_id`.\n\nTell the user the size (servers by plan and location) before the checks. For large accounts offer to scope the audit.\n\n## 2. Checks\n\nPer server, one batch for every read below except `vps_monarx_scan-metrics` and `vps_docker_list`. Their errors stop a batch, so call each of those two on its own:\n\n- **State.** `running` is normal; `stopped` may be the user's own stop or a Hostinger stop after malware was found; `suspended` is non-payment or abuse; `error` needs Hostinger support; `initial` is bought and waiting for setup. Any other state with `actions_lock: locked` is an action in progress. Expired plans can still show `running` — use the subscription.\n- **Actions.** `vps_actions_list` (first page): an `error` in the last 7 days, or an action still `sent` after 12 hours (stuck — Hostinger support).\n- **Usage.** `vps_virtual-machines_metrics` for the last 24 h. `disk_space` and `ram_usage` are in bytes, while `disk` and `memory` are in MB, so convert before comparing: `disk_space` above 85 % of `disk`, `ram_usage` above 90 % of `memory` most of the day, `cpu_usage` above 90 % most of the day. Sustained high CPU leads Hostinger to limit the server's CPU; whether a limit is active shows only in hPanel.\n- **Traffic.** The same metrics from the 1st of the month: inbound plus outbound traffic near the plan's monthly `bandwidth` means the server will be throttled for the rest of the month.\n- **Backups.** `vps_backups_list`: no backup newer than 8 days on a server older than 7 days means the weekly schedule is probably off. The API cannot show the schedule; the user checks hPanel → VPS → Snapshots & Backups, where Auto-backups shows it.\n- **SSH keys.** `vps_ssh-keys_list-virtual-machine`: none means password login only.\n- **Malware.** `vps_monarx_scan-metrics`: `[VPS:2042] Monarx is not installed` means it is not installed; counts mean it is. `malicious` or `compromised` above 0 is a finding.\n- **Docker Manager.** `vps_docker_list` on every server; an empty list means no projects. `[VPS:2044]` means this server has no Docker Manager, so skip it. Availability does not follow the template name. For each project, flag any container not `running`, or with `health` other than `healthy`.\n- **OpenVZ.** A plan named `KVM n` is KVM and is never flagged. Flag a server whose plan name does not start with `KVM`. Only when the plan name is missing or unclear, use `created_at` before 18 April 2023 as a hint, because VPS bought on hostinger.com before then were usually OpenVZ. For a flagged server, the user checks hPanel and follows Hostinger's OpenVZ-to-KVM migration guide.\n\n**Firewall**, from the API only. In hPanel a group's rules sit behind an Actions menu the agent cannot open, so read them here and never send the user to hPanel to read them. Match each server's `firewall_group_id` to a group from `vps_firewall_list` (or `vps_firewall_get` with that id), then check:\n\n- `firewall_group_id: null`: no group is active, so every port the OS listens on is reachable.\n- `is_synced: false`: rule changes are not applied yet. hPanel does not show this.\n- an `accept` rule with `source: \"any\"` on a database or cache port (3306, 5432, 6379, 27017).\n\nhPanel's Firewall page lists every group on the account with an on/off switch per server, and its rule counts run one higher than the API's. Count rules from the API.\n\nPlans: auto-renew off (`is_auto_renewed: false`, status `non_renewing`) **and** `expires_at` within 30 days. After expiry a VPS is suspended for up to 21 days with data kept, then cancelled; it can be restored from hPanel for 9 more days and is then destroyed.\n\nFrom outside, per server:\n\n```bash\nnc -z -w 3 IP 22 && echo ssh; curl -s -o /dev/null -w \"%{http_code}\\n\" --max-time 10 http://IP/\nfor p in 3306 5432 6379 27017; do nc -z -w 3 IP $p && echo \"open $p\"; done\n```\n\nBefore trusting the scan, run the same check against `192.0.2.1`, a reserved address with no server. Any port that answers there is faked by the local network (a VPN or proxy; 80, 443 and 8080 are common), so check it with `curl` instead. On macOS add `-G 3` to `nc`; without it a port that drops traffic hangs for over a minute.\n\nA database port answering from outside is a finding whatever the rules say.\n\n## 3. Report\n\n```\n# VPS audit\n4 servers (2 KVM 2, 1 KVM 4, 1 KVM 8) · Vilnius 3, Düsseldorf 1\n\n## Fix now\n- srv100 (203.0.113.10) — state error since the restart 2 days ago → Hostinger support\n- srv101 — Monarx counts 3 malicious files → secure-vps, file list in hPanel\n- srv102 — disk 96 % full → troubleshoot-vps\n\n## Soon\n- srv101 — KVM 2 expires in 9 days, auto-renew off → renew in hPanel\n- srv103 — no firewall group; 22, 80, 443, 6379 answer from the internet → secure-vps\n- srv100 — no backup in the last 30 days → hPanel → Snapshots & Backups → Manage schedule\n\n## Worth knowing\n- srv102 — password login only, no SSH key → secure-vps\n- srv103 — firewall group \"web\" not synced → secure-vps\n\n## Healthy\nsrv104\n```\n\n- **Fix now:** state `error`, `suspended`, or `stopped` without the user's knowledge; a failed or stuck action; malware counts above 0; disk above 95 %; a Docker project down; a plan already lapsed; an OpenVZ server.\n- **Soon:** no firewall group, or a database port open to the internet; no backup in 8 days; a plan lapsing within 30 days; disk above 85 %; CPU or memory saturated most of the day; monthly traffic near the quota.\n- **Worth knowing:** no SSH key; firewall group not synced; Monarx not installed.\n\nEach item names the evidence and what fixes it: `troubleshoot-vps`, `secure-vps`, `deploy-to-vps`, `provision-vps`, Hostinger support, or the hPanel page. Hand back without fixing anything.\n\n## Not available through the API\n\nWhat runs inside each server, whether a CPU limit is active, the backup schedule and the Monarx file list. Mention them once at the end so the user knows what the audit could not see.\n"
45
+ "text": "---\nname: audit-vps\ndescription: \"Audit every Hostinger VPS (KVM plans) on the account and report what needs attention: server state and failed actions, CPU, memory, disk and monthly traffic use, firewall missing or not synced, SSH keys, Monarx malware counts, backup age, Docker Manager projects that are not healthy, old OpenVZ servers, and VPS plans about to lapse. Read-only; produces a prioritised to-do list and names the skill or hPanel page that fixes each item. Triggers: what VPS do I have, audit my servers, check all my VPS, which servers need attention, health check my VPS, are my servers secure, is my VPS backed up, when does my VPS expire.\"\n---\n\n# Audit VPS\n\nRead-only from start to finish. The output is a report; every fix is a separate, confirmed step through another skill or in hPanel.\n\n## Calling the operations\n\n- Read the `inputSchema` that `search` returns before the first call of each operation. If a name below is rejected as unknown, `search` for what the step does (e.g. \"virtual machine metrics\").\n- Batch reads with `multi-execute`, up to 20 steps a batch. Batches chain operations from one server only — the Hostinger Connector runs `vps` and `billing` as separate servers. When a product group is switched off, skip its checks and say which were skipped.\n- `vps_virtual-machines_list` returns a plain array; paged lists (`vps_actions_list`, `vps_backups_list`, `vps_firewall_list`) return `data` and `meta`.\n- `Too Many Attempts` is the API rate limit: wait about a minute, then retry that call once, and send no other calls meanwhile. `[VPS:9999] Request failed` (HTTP 500) is usually temporary: retry once later, and if it fails again, report that server as not checked.\n- Call only read operations. Do not take a snapshot, sync a firewall, install Monarx or restart anything during the audit.\n\n## 1. Inventory\n\n- `vps_virtual-machines_list` — per server `id`, `hostname`, `plan`, `state`, `actions_lock`, `template.name`, `memory` and `disk` (MB), `bandwidth`, `firewall_group_id`, `subscription_id`, `ipv4[0].address`, `created_at`.\n- `vps_firewall_list` — every firewall group with its rules and `is_synced`.\n- `vps_data-centers_list` — to name each server's location from `data_center_id`.\n- `billing_subscriptions_list` (billing product) — joined to servers on `subscription_id`.\n\nTell the user the size (servers by plan and location) before the checks. For large accounts offer to scope the audit.\n\n## 2. Checks\n\nPer server, one batch for every read below except `vps_monarx_scan-metrics` and `vps_docker_list`. Their errors stop a batch, so call each of those two on its own:\n\n- **State.** `running` is normal; `stopped` may be the user's own stop or a Hostinger stop after malware was found; `suspended` is non-payment or abuse; `error` needs Hostinger support; `initial` is bought and waiting for setup. Any other state with `actions_lock: locked` is an action in progress. Expired plans can still show `running` — use the subscription.\n- **Actions.** `vps_actions_list` (first page): an `error` in the last 7 days, or an action still `sent` after 12 hours (stuck — Hostinger support).\n- **Usage.** `vps_virtual-machines_metrics` for the last 24 h. `disk_space` and `ram_usage` are in bytes, while `disk` and `memory` are in MB, so convert before comparing: `disk_space` above 85 % of `disk`, `ram_usage` above 90 % of `memory` most of the day, `cpu_usage` above 90 % most of the day. Sustained high CPU leads Hostinger to limit the server's CPU; whether a limit is active shows only in hPanel.\n- **Traffic.** The same metrics from the 1st of the month: inbound plus outbound traffic near the plan's monthly `bandwidth` means the server will be throttled for the rest of the month. By mid-month the result is over 100 KB per server, too large to read whole. When it comes back saved to a file, add up `incoming_traffic` and `outgoing_traffic` with a short script on that file. If the script cannot run, use the last 7 days, scale them to the month and say the figure is an estimate.\n- **Backups.** `vps_backups_list`: no backup newer than 8 days on a server older than 7 days means the weekly schedule is probably off. The API cannot show the schedule; the user checks hPanel → VPS → Snapshots & Backups, where Auto-backups shows it.\n- **SSH keys.** `vps_ssh-keys_list-virtual-machine` shows only keys added through Hostinger (hPanel or the API). Keys added on the server by hand do not appear, so an empty list means \"no SSH key added through Hostinger\", not that login is password-only. secure-vps checks password login over SSH.\n- **Malware.** `vps_monarx_scan-metrics`: `[VPS:2042] Monarx is not installed` means it is not installed; counts mean it is. `malicious` or `compromised` above 0 is a finding.\n- **Docker Manager.** `vps_docker_list` on every server; an empty list means no projects. `[VPS:2044]` means this server has no Docker Manager, so skip it. Availability does not follow the template name. For each project, flag any container not `running`, or with `health` other than `healthy`.\n- **OpenVZ.** A plan named `KVM n` is KVM and is never flagged. Flag a server whose plan name does not start with `KVM`. Only when the plan name is missing or unclear, use `created_at` before 18 April 2023 as a hint, because VPS bought on hostinger.com before then were usually OpenVZ. For a flagged server, the user checks hPanel and follows Hostinger's OpenVZ-to-KVM migration guide.\n\n**Firewall**, from the API only. In hPanel a group's rules sit behind an Actions menu the agent cannot open, so read them here and never send the user to hPanel to read them. Match each server's `firewall_group_id` to a group from `vps_firewall_list` (or `vps_firewall_get` with that id), then check:\n\n- `firewall_group_id: null`: no group is active, so every port the OS listens on is reachable.\n- `is_synced: false`: rule changes are not applied yet. hPanel does not show this.\n- an `accept` rule with `source: \"any\"` on a database or cache port (3306, 5432, 6379, 27017).\n\nhPanel's Firewall page lists every group on the account with an on/off switch per server, and its rule counts run one higher than the API's. Count rules from the API.\n\nPlans: auto-renew off (`is_auto_renewed: false`, status `non_renewing`) **and** `expires_at` within 30 days. After expiry a VPS is suspended for up to 21 days with data kept, then cancelled; it can be restored from hPanel for 9 more days and is then destroyed.\n\nFrom outside, per server:\n\n```bash\nnc -zv -w 3 IP 22\ncurl -s -o /dev/null -w \"%{http_code}\\n\" --max-time 10 http://IP/\nnc -zv -w 3 IP 3306; nc -zv -w 3 IP 5432; nc -zv -w 3 IP 6379; nc -zv -w 3 IP 27017\n```\n\nRun each port as its own `nc`, with the IP written out. A loop or a shell variable makes Claude Code ask for approval every time, and macOS `nc` stops after the first port when given a list.\n\nBefore trusting the scan, run the same check against `192.0.2.1`, a reserved address with no server. Any port that answers there is faked by the local network (a VPN or proxy; 80, 443 and 8080 are common), so check it with `curl` instead. On macOS add `-G 3` to `nc`; without it a port that drops traffic hangs for over a minute.\n\nA database port answering from outside is a finding whatever the rules say.\n\n## 3. Report\n\n```\n# VPS audit\n4 servers (2 KVM 2, 1 KVM 4, 1 KVM 8) · Vilnius 3, Düsseldorf 1\n\n## Fix now\n- srv100 (203.0.113.10) — state error since the restart 2 days ago → Hostinger support\n- srv101 — Monarx counts 3 malicious files → secure-vps, file list in hPanel\n- srv102 — disk 96 % full → troubleshoot-vps\n\n## Soon\n- srv101 — KVM 2 expires in 9 days, auto-renew off → renew in hPanel\n- srv103 — no firewall group; 22, 80, 443, 6379 answer from the internet → secure-vps\n- srv100 — no backup in the last 30 days → hPanel → Snapshots & Backups → Manage schedule\n\n## Worth knowing\n- srv102 — no SSH key added through Hostinger → secure-vps\n- srv103 — firewall group \"web\" not synced → secure-vps\n\n## Healthy\nsrv104\n```\n\n- **Fix now:** state `error`, `suspended`, or `stopped` without the user's knowledge; a failed or stuck action; malware counts above 0; disk above 95 %; a Docker project down; a plan already lapsed; an OpenVZ server.\n- **Soon:** no firewall group, or a database port open to the internet; no backup in 8 days; a plan lapsing within 30 days; disk above 85 %; CPU or memory saturated most of the day; monthly traffic near the quota.\n- **Worth knowing:** no SSH key added through Hostinger; firewall group not synced; Monarx not installed.\n\nEach item names the evidence and what fixes it: `troubleshoot-vps`, `secure-vps`, `deploy-to-vps`, `provision-vps`, Hostinger support, or the hPanel page. Hand back without fixing anything.\n\n## Not available through the API\n\nWhat runs inside each server, whether a CPU limit is active, the backup schedule and the Monarx file list. Mention them once at the end so the user knows what the audit could not see.\n"
46
46
  }
47
47
  ]
48
48
  },
@@ -87,10 +87,10 @@ const skills: Skill[] = [
87
87
  "resources": [
88
88
  {
89
89
  "uri": "skill://deploy-to-vps/SKILL.md",
90
- "digest": "sha256:4f4e377e918afbf9cf57848c7a1b64a25062d90b58dd2212c1cde9e042acdc83",
91
- "size": 10915,
90
+ "digest": "sha256:3013c8b4cf2d9fce046f03c088e08e2f1cfe7daae9860b7892acef28b31a1d3b",
91
+ "size": 11320,
92
92
  "mimeType": "text/markdown",
93
- "text": "---\nname: deploy-to-vps\ndescription: \"Deploy an existing project to a Hostinger VPS (KVM plans): sets up SSH key access, applies a Hostinger firewall group, runs Docker Compose projects through the Docker Manager where the server has it, or over SSH on any server, points a domain at the server, takes a snapshot before risky changes and verifies the result from outside. Triggers: deploy this to my VPS, run this docker-compose on my Hostinger server, put my app on the server, set up nginx and SSL on my VPS, point my domain to my VPS, redeploy on the VPS, add my SSH key to the VPS.\"\n---\n\n# Deploy to VPS\n\nShip a project that already exists — on disk or in a Git repository — to a Hostinger VPS in state `running`. Buying, setting up or reinstalling a server is the `provision-vps` skill; a server that is down or misbehaving is `troubleshoot-vps`.\n\nThe public API cannot run a command on the server. Packages, services, web servers, certificates and files are handled over SSH or in the hPanel browser terminal, so step 2 comes first whenever a shell is needed.\n\n## Calling the operations\n\n- Read the `inputSchema` that `search` returns before the first call of each operation. If a name below is rejected as unknown, `search` for what the step does (e.g. \"add ssh key to virtual machine\").\n- Only the public operations that `search` returns can be called. Hostinger Agent tools in hPanel (running commands, resetting SSH or the guest firewall, disk cleanup) are not available here; when a step needs them, send the user to hPanel.\n- Batch reads with `multi-execute`; values pass between steps as `$steps.<i>.<path>`. A batch stops at its first failure. The Hostinger Connector runs `vps` and `dns` as separate servers, so a batch chains operations from one of them only.\n- A VPS runs one action at a time. Most operations that change it return an action (firewall sync and delete answer `Request accepted` instead; check those with the matching read operation): poll `vps_actions_get` with its `id`, waiting longer between checks, until `state` is `success` or `error` (`created`, `sent`, `delayed`, `started` are still running). Do not send another change while `vps_virtual-machines_get` shows `actions_lock: locked`. An action in `error` keeps the VPS locked and needs Hostinger support.\n- Confirm with the user before: `vps_snapshots_create` (it replaces the existing snapshot), `vps_docker_create` on a project name that already exists (it replaces the project), `vps_docker_stop`, `vps_docker_delete` (removes containers, networks, volumes and images), and `dns_records_update` with `overwrite: true`. Reinstalling is never part of a deploy — hand over to `provision-vps`.\n- SSH keys: use `vps_ssh-keys_*`; the account-level `vps_public-keys_*` operations are deprecated. Firewall sync: use `vps_firewall_sync-to-all-assigned-v-ms`; the single-VM `vps_firewall_sync` is deprecated.\n\n## 1. Pick the target server\n\n- `.hostinger/vps.json` in the project: reuse its `virtual_machine_id`, `ipv4` and `domain` — without asking only when you or the user wrote it in an earlier deploy. If it came with a clone or download, name the server and confirm with the user first.\n- Otherwise `vps_virtual-machines_list` and let the user choose by `hostname` or IP. Keep `id`, `ipv4[0].address`, `ipv4[0].id` (for reverse DNS), `template.name`, `firewall_group_id` and `state`.\n- `state` other than `running`: hand over to `troubleshoot-vps`. `initial` means bought but not set up yet — `provision-vps`.\n\n## 2. Get SSH access\n\nFresh templates log in as `root` with the root password set at setup; keys are optional. Skip this step when `ssh -o BatchMode=yes root@IP true` already succeeds.\n\n1. Find or create a local key: `~/.ssh/id_ed25519.pub`, else `ssh-keygen -t ed25519 -N \"\" -f ~/.ssh/id_ed25519 -C hostinger-agent`.\n2. `vps_ssh-keys_add-virtual-machine` with `keys: [\"<contents of the .pub file>\"]`. The key is written to `root`'s `authorized_keys` by the guest agent; check it with `vps_ssh-keys_list-virtual-machine`.\n3. `ssh -o StrictHostKeyChecking=accept-new root@IP 'uname -a'`. If it is refused straight after adding the key, wait a minute and try again before changing anything else.\n\nStill refused: port 22 closed from outside (`nc -zv -w 5 IP 22`) points at the firewall (step 3) or the guest OS; anything beyond that is `troubleshoot-vps`. Never store the private key in the project, and never print it.\n\n## 3. Firewall\n\nA Hostinger firewall group drops all inbound traffic that no accept rule matches, for IPv4 and IPv6, and needs at least one rule. Each VPS has at most one active group; a group can be shared by several servers. Rule changes reach new connections within about two minutes after a sync; open connections are kept.\n\n1. `vps_firewall_list`; reuse a group whose rules match, else `vps_firewall_create` with a name like `web-<hostname>`.\n2. `vps_firewall_create-rule` per port: `protocol: \"SSH\"` with `port: \"22\"`, `\"HTTP\"`/`\"80\"`, `\"HTTPS\"`/`\"443\"`, `source: \"any\"`, `source_detail: \"any\"`, plus the app's own ports only if they must be reached directly (prefer a reverse proxy on 80/443). Add the SSH rule before activating, or step 2 stops working.\n3. `vps_firewall_activate` with the group and the server, then `vps_firewall_sync-to-all-assigned-v-ms` once it succeeds: a new group reads `is_synced: false` until synced, even though activation already applied its rules. Sync again after any later rule change. The sync answers `Request accepted`; `vps_firewall_get` shows `is_synced: true` when it is done.\n4. Verify from outside: `nc -zv -w 5 IP 22` (on macOS add `-G 5`), and `curl -s -o /dev/null -w \"%{http_code}\\n\" http://IP/` for port 80. Do not judge 80 or 443 by `nc`: some networks (VPNs, proxies) accept those ports for any address.\n\nThe guest OS firewall (ufw, iptables) applies as well; a Hostinger drop wins over a guest accept. Change a shared group only after saying which other servers use it.\n\n## 4. Snapshot before changes\n\nOn a server that already serves something, offer a checkpoint. A VPS keeps one snapshot, a new one replaces it, and it expires after one day — it is a short undo for this deploy, not a backup. `vps_snapshots_get` answers 404 when there is none; when one exists, show its `created_at` and ask before replacing it. Creating it can take up to an hour; the VPS keeps running but is locked for other actions meanwhile.\n\n## 5. Choose the deploy\n\n| Project | Path |\n| --- | --- |\n| Compose file, server where `vps_docker_list` answers | **Docker Manager** (5a), or SSH (5b) |\n| Compose file, server where `vps_docker_list` returns `[VPS:2044]` | **SSH** (5b) with Docker installed |\n| Anything else (Node.js, Python, PHP, static) | **SSH** (5b) |\n\n### 5a. Docker Manager\n\nDocker Manager is available on some servers and not others, and availability does not follow the template name. Call `vps_docker_list` first: `[VPS:2044]` means this server has no Docker Manager, so use 5b.\n\n1. `vps_docker_list` for existing projects. A `project_name` that already exists is replaced — confirm first.\n2. `vps_docker_create` with `project_name` (letters, digits, dashes, underscores), `content` and optional `environment` (`.env` lines). `content` is the compose YAML itself, or a direct URL to the compose file; for GitHub pass the raw file URL with the branch named in it rather than the repository URL.\n3. Use pre-built images. Do not rely on `build:` — whether the Docker Manager builds from source is unresolved, so build and push the image to a registry first. Private registries need credentials added by the user in hPanel's Docker Manager.\n4. Bind app ports that sit behind a reverse proxy to `127.0.0.1`, and add firewall rules (step 3) for any port that must be public.\n5. `vps_docker_containers` for each container's `status`, `health` and `ports`; `vps_docker_logs` (last 300 lines) on failure. Later: `vps_docker_update` pulls images and recreates containers, keeping volumes; `vps_docker_restart` and `vps_docker_start` keep everything.\n6. To deploy on every push to GitHub: the `hostinger/deploy-on-vps@v2` GitHub Action, which deploys the compose project through the Docker Manager, so only on servers where `vps_docker_list` answers. The user sets it up in the repository with `api-key` (a Hostinger API key, kept as a repository secret) and `virtual-machine` (the VM id), plus optional `project-name`, `docker-compose-path` and `environment-variables`.\n\n### 5b. Over SSH\n\nThis is ordinary Linux administration on the user's own server; say what will be installed before installing it.\n\n1. Code to `/opt/<app>` (`git clone` on the server, or `rsync -az --exclude node_modules --exclude .git ./ root@IP:/opt/<app>/`). Secrets go in a file with mode 600, never in the repository.\n2. Compose projects: install Docker if the template lacks it, then `docker compose up -d` in the project directory.\n3. Other apps: a systemd service with `Restart=always`, behind a reverse proxy (nginx) on 80/443, and a Let's Encrypt certificate (`certbot --nginx -d <domain>`) once the domain resolves to the server (step 6) and port 80 is open.\n\n## 6. Point a domain at the server\n\n- Domain on Hostinger DNS: `dns_records_list` first. Then `dns_records_validate` and `dns_records_update` with the same body: `zone: [{ name: \"@\" or \"sub\", type: \"A\", ttl: 300, records: [{ content: \"<ipv4>\" }] }]`, with `overwrite` set explicitly — it defaults to `true`, which replaces records of the same name and type. Use `overwrite: true` only to replace an existing A record, after naming it to the user.\n- Domain elsewhere: give the user the A record to create.\n- Reverse DNS when the server sends mail: `vps_ptr_create` with `ipAddressId` from `ipv4[0].id` and `domain`. `vps_virtual-machines_set-hostname` does not change the PTR.\n- `dig +short A <domain>` must return the IP before requesting a certificate.\n\n## 7. Verify and record\n\n```bash\ncurl -s -o /dev/null -w \"%{http_code}\\n\" https://DOMAIN/\ncurl -s https://DOMAIN/ | grep -o \"TEXT THE PROJECT RENDERS\"\n```\n\nContainers `running` and healthy (5a) or the service active (5b), plus the real page over HTTPS from outside. Write `.hostinger/vps.json` in the project: `{ \"virtual_machine_id\", \"ipv4\", \"domain\", \"deploy\": \"docker-manager\" | \"ssh\", \"project_name\" or \"service\" }`, keeping fields already there.\n\n## Not available through the API\n\n- Running a command or reading a file on the server — SSH or the hPanel browser terminal (`vps_docker_logs` is the exception, for Docker Manager projects).\n- Docker registry credentials — hPanel's Docker Manager.\n- Downloading a backup or snapshot — copy data off the live server with `rsync` or SFTP.\n- Changing the data center — a reinstall in the new location from hPanel (Overview → VPS details → Server location → edit) that erases data, backups and snapshots and changes the IP.\n- Changing plan size — a whole-plan upgrade in hPanel.\n"
93
+ "text": "---\nname: deploy-to-vps\ndescription: \"Deploy an existing project to a Hostinger VPS (KVM plans): sets up SSH key access, applies a Hostinger firewall group, runs Docker Compose projects through the Docker Manager where the server has it, or over SSH on any server, points a domain at the server, takes a snapshot before risky changes and verifies the result from outside. Triggers: deploy this to my VPS, run this docker-compose on my Hostinger server, put my app on the server, set up nginx and SSL on my VPS, point my domain to my VPS, redeploy on the VPS, add my SSH key to the VPS.\"\n---\n\n# Deploy to VPS\n\nShip a project that already exists — on disk or in a Git repository — to a Hostinger VPS in state `running`. Buying, setting up or reinstalling a server is the `provision-vps` skill; a server that is down or misbehaving is `troubleshoot-vps`.\n\nThe public API cannot run a command on the server. Packages, services, web servers, certificates and files are handled over SSH or in the hPanel browser terminal, so step 2 comes first whenever a shell is needed.\n\n## Calling the operations\n\n- Read the `inputSchema` that `search` returns before the first call of each operation. If a name below is rejected as unknown, `search` for what the step does (e.g. \"add ssh key to virtual machine\").\n- Only the public operations that `search` returns can be called. Hostinger Agent tools in hPanel (running commands, resetting SSH or the guest firewall, disk cleanup) are not available here; when a step needs them, send the user to hPanel.\n- Batch reads with `multi-execute`; values pass between steps as `$steps.<i>.<path>`. A batch stops at its first failure. The Hostinger Connector runs `vps` and `dns` as separate servers, so a batch chains operations from one of them only.\n- `Too Many Attempts` is the API rate limit: wait about a minute, then retry that call once, and send no other calls meanwhile. `[VPS:9999] Request failed` (HTTP 500) is usually temporary: retry a read once later. Never resend a change that failed with 500 straight away: it may have gone through, so check the outcome with the matching read or `vps_actions_list` first, and tell the user what you found.\n- A VPS runs one action at a time. Most operations that change it return an action (firewall sync and delete answer `Request accepted` instead; check those with the matching read operation): poll `vps_actions_get` with its `id`, waiting longer between checks, until `state` is `success` or `error` (`created`, `sent`, `delayed`, `started` are still running). Do not send another change while `vps_virtual-machines_get` shows `actions_lock: locked`. An action in `error` keeps the VPS locked and needs Hostinger support.\n- Confirm with the user before: `vps_snapshots_create` (it replaces the existing snapshot), `vps_docker_create` on a project name that already exists (it replaces the project), `vps_docker_stop`, `vps_docker_delete` (removes containers, networks, volumes and images), and `dns_records_update` with `overwrite: true`. Reinstalling is never part of a deploy — hand over to `provision-vps`.\n- SSH keys: use `vps_ssh-keys_*`; the account-level `vps_public-keys_*` operations are deprecated. Firewall sync: use `vps_firewall_sync-to-all-assigned-v-ms`; the single-VM `vps_firewall_sync` is deprecated.\n\n## 1. Pick the target server\n\n- `.hostinger/vps.json` in the project: reuse its `virtual_machine_id`, `ipv4` and `domain` — without asking only when you or the user wrote it in an earlier deploy. If it came with a clone or download, name the server and confirm with the user first.\n- Otherwise `vps_virtual-machines_list` and let the user choose by `hostname` or IP. Keep `id`, `ipv4[0].address`, `ipv4[0].id` (for reverse DNS), `template.name`, `firewall_group_id` and `state`.\n- `state` other than `running`: hand over to `troubleshoot-vps`. `initial` means bought but not set up yet — `provision-vps`.\n\n## 2. Get SSH access\n\nFresh templates log in as `root` with the root password set at setup; keys are optional. Skip this step when `ssh -o BatchMode=yes root@IP true` already succeeds.\n\n1. Find or create a local key: `~/.ssh/id_ed25519.pub`, else `ssh-keygen -t ed25519 -N \"\" -f ~/.ssh/id_ed25519 -C hostinger-agent`.\n2. `vps_ssh-keys_add-virtual-machine` with `keys: [\"<contents of the .pub file>\"]`. The key is written to `root`'s `authorized_keys` by the guest agent; check it with `vps_ssh-keys_list-virtual-machine`.\n3. `ssh -o StrictHostKeyChecking=accept-new root@IP 'uname -a'`. If it is refused straight after adding the key, wait a minute and try again before changing anything else.\n\nStill refused: port 22 closed from outside (`nc -zv -w 5 IP 22`) points at the firewall (step 3) or the guest OS; anything beyond that is `troubleshoot-vps`. Never store the private key in the project, and never print it.\n\n## 3. Firewall\n\nA Hostinger firewall group drops all inbound traffic that no accept rule matches, for IPv4 and IPv6, and needs at least one rule. Each VPS has at most one active group; a group can be shared by several servers. Rule changes reach new connections within about two minutes after a sync; open connections are kept.\n\n1. `vps_firewall_list`; reuse a group whose rules match, else `vps_firewall_create` with a name like `web-<hostname>`.\n2. `vps_firewall_create-rule` per port: `protocol: \"SSH\"` with `port: \"22\"`, `\"HTTP\"`/`\"80\"`, `\"HTTPS\"`/`\"443\"`, `source: \"any\"`, `source_detail: \"any\"`, plus the app's own ports only if they must be reached directly (prefer a reverse proxy on 80/443). Add the SSH rule before activating, or step 2 stops working.\n3. `vps_firewall_activate` with the group and the server, then `vps_firewall_sync-to-all-assigned-v-ms` once it succeeds: a new group reads `is_synced: false` until synced, even though activation already applied its rules. Sync again after any later rule change. The sync answers `Request accepted`; `vps_firewall_get` shows `is_synced: true` when it is done.\n4. Verify from outside: `nc -zv -w 5 IP 22` (on macOS add `-G 5`), and `curl -s -o /dev/null -w \"%{http_code}\\n\" http://IP/` for port 80. Do not judge 80 or 443 by `nc`: some networks (VPNs, proxies) accept those ports for any address.\n\nThe guest OS firewall (ufw, iptables) applies as well; a Hostinger drop wins over a guest accept. Change a shared group only after saying which other servers use it.\n\n## 4. Snapshot before changes\n\nOn a server that already serves something, offer a checkpoint. A VPS keeps one snapshot, a new one replaces it, and it expires after one day — it is a short undo for this deploy, not a backup. `vps_snapshots_get` answers 404 when there is none; when one exists, show its `created_at` and ask before replacing it. Creating it can take up to an hour; the VPS keeps running but is locked for other actions meanwhile.\n\n## 5. Choose the deploy\n\n| Project | Path |\n| --- | --- |\n| Compose file, server where `vps_docker_list` answers | **Docker Manager** (5a), or SSH (5b) |\n| Compose file, server where `vps_docker_list` returns `[VPS:2044]` | **SSH** (5b) with Docker installed |\n| Anything else (Node.js, Python, PHP, static) | **SSH** (5b) |\n\n### 5a. Docker Manager\n\nDocker Manager is available on some servers and not others, and availability does not follow the template name. Call `vps_docker_list` first: `[VPS:2044]` means this server has no Docker Manager, so use 5b.\n\n1. `vps_docker_list` for existing projects. A `project_name` that already exists is replaced — confirm first.\n2. `vps_docker_create` with `project_name` (letters, digits, dashes, underscores), `content` and optional `environment` (`.env` lines). `content` is the compose YAML itself, or a direct URL to the compose file; for GitHub pass the raw file URL with the branch named in it rather than the repository URL.\n3. Use pre-built images. Do not rely on `build:` — whether the Docker Manager builds from source is unresolved, so build and push the image to a registry first. Private registries need credentials added by the user in hPanel's Docker Manager.\n4. Bind app ports that sit behind a reverse proxy to `127.0.0.1`, and add firewall rules (step 3) for any port that must be public.\n5. `vps_docker_containers` for each container's `status`, `health` and `ports`; `vps_docker_logs` (last 300 lines) on failure. Later: `vps_docker_update` pulls images and recreates containers, keeping volumes; `vps_docker_restart` and `vps_docker_start` keep everything.\n6. To deploy on every push to GitHub: the `hostinger/deploy-on-vps@v2` GitHub Action, which deploys the compose project through the Docker Manager, so only on servers where `vps_docker_list` answers. The user sets it up in the repository with `api-key` (a Hostinger API key, kept as a repository secret) and `virtual-machine` (the VM id), plus optional `project-name`, `docker-compose-path` and `environment-variables`.\n\n### 5b. Over SSH\n\nThis is ordinary Linux administration on the user's own server; say what will be installed before installing it.\n\n1. Code to `/opt/<app>` (`git clone` on the server, or `rsync -az --exclude node_modules --exclude .git ./ root@IP:/opt/<app>/`). Secrets go in a file with mode 600, never in the repository.\n2. Compose projects: install Docker if the template lacks it, then `docker compose up -d` in the project directory.\n3. Other apps: a systemd service with `Restart=always`, behind a reverse proxy (nginx) on 80/443, and a Let's Encrypt certificate (`certbot --nginx -d <domain>`) once the domain resolves to the server (step 6) and port 80 is open.\n\n## 6. Point a domain at the server\n\n- Domain on Hostinger DNS: `dns_records_list` first. Then `dns_records_validate` and `dns_records_update` with the same body: `zone: [{ name: \"@\" or \"sub\", type: \"A\", ttl: 300, records: [{ content: \"<ipv4>\" }] }]`, with `overwrite` set explicitly — it defaults to `true`, which replaces records of the same name and type. Use `overwrite: true` only to replace an existing A record, after naming it to the user.\n- Domain elsewhere: give the user the A record to create.\n- Reverse DNS when the server sends mail: `vps_ptr_create` with `ipAddressId` from `ipv4[0].id` and `domain`. `vps_virtual-machines_set-hostname` does not change the PTR.\n- `dig +short A <domain>` must return the IP before requesting a certificate.\n\n## 7. Verify and record\n\n```bash\ncurl -s -o /dev/null -w \"%{http_code}\\n\" https://DOMAIN/\ncurl -s https://DOMAIN/ | grep -o \"TEXT THE PROJECT RENDERS\"\n```\n\nContainers `running` and healthy (5a) or the service active (5b), plus the real page over HTTPS from outside. Write `.hostinger/vps.json` in the project: `{ \"virtual_machine_id\", \"ipv4\", \"domain\", \"deploy\": \"docker-manager\" | \"ssh\", \"project_name\" or \"service\" }`, keeping fields already there.\n\n## Not available through the API\n\n- Running a command or reading a file on the server — SSH or the hPanel browser terminal (`vps_docker_logs` is the exception, for Docker Manager projects).\n- Docker registry credentials — hPanel's Docker Manager.\n- Downloading a backup or snapshot — copy data off the live server with `rsync` or SFTP.\n- Changing the data center — a reinstall in the new location from hPanel (Overview → VPS details → Server location → edit) that erases data, backups and snapshots and changes the IP.\n- Changing plan size — a whole-plan upgrade in hPanel.\n"
94
94
  }
95
95
  ]
96
96
  },
@@ -425,24 +425,24 @@ const skills: Skill[] = [
425
425
  },
426
426
  {
427
427
  "uri": "skill://hostinger-headless/steps/07-validate/SKILL.md",
428
- "digest": "sha256:e9b845930767e351fc9bce7d572da23ac90937b1108db84c9426f335d40851ce",
429
- "size": 4340,
428
+ "digest": "sha256:d1c425ec2298b7e9014b157c433ebea9bd28f4498ad3069a558643f255d09f80",
429
+ "size": 7119,
430
430
  "mimeType": "text/markdown",
431
- "text": "---\nname: headless-step-validate\ndescription: \"Step 7 (validate) of the Hostinger Headless flow. OPTIONAL quick gate before deploy: every prior stage already self-verifies, so this is a fast confirmation (instance live + backend API answers with seeded content) plus optional local preview and user sign-off. Skip the heavy parts when nobody needs to approve.\"\n---\n\n# headless-step-validate\n\n> **Optional / fast.** Every stage before this one already verifies its own work (provision checks the\n> backend, content-model push checks the REST counts, frontend builds clean and looks right at desktop\n> and phone width), and **deploy verifies the live result**. So validate is **not** a re-run of all\n> that — it's a quick confirmation, plus the optional human preview/sign-off. **Skip Steps 3–4 (rebuild + approval) entirely** on an autonomous or\n> temp-domain run where no one is signing off; just do the two 10-second checks below and move on. Spend\n> time here only when a person wants to see it before it goes live.\n\n**In:** project in `~/.hostinger/<domain>/src/`, `site.json`, `state.json`.\n\n## 1 — Instance status (always, quick)\n\n`provision.status == \"completed\"` in `state.json`. Anything else → not ready; return to the instance\nbarrier, don't deploy. Deploy's pre-flight asks the connector again (see *State and artifacts* in the\ntop-level `SKILL.md`).\n\n## 2 — Backend API status (every backend, always, quick)\n\nHit the live API from `site.json` and confirm it answers **with the content the push created** — a 200\nwith an empty catalog means the push didn't land:\n\n- **WordPress:** `GET {urls.rest_api}/posts?per_page=1` → 200 JSON array; check `X-WP-Total` against the\n planned post count, and `GET {urls.rest_api}/media?per_page=1` → `X-WP-Total` matches the planned\n image count (more = duplicates).\n- **WordPress + WooCommerce** (`site.json → woocommerce.enabled`): the WordPress check above **plus**\n `GET {urls.store_api}/products?per_page=100` → 200 with the seeded products and `prices` (minor units);\n count matches the plan. Don't test checkout while `woocommerce.payment_enabled` is `false`.\n- **Ecommerce:** query `urls.storefront_api` for the sales channel → 200 with the seeded products and\n prices *(confirm against the store)*.\n- **PocketBase** (`site.json → backend: \"pocketbase\"`): `GET {urls.api}/health` → 200, and every\n collection with `seed` records in `pocketbase/schema.json` lists them\n (`GET {urls.api}/collections/<name>/records?perPage=1` → `totalItems` at least the seed count, for\n collections visitors may list). `pb-verify.mjs` already ran at the content-model push, so don't\n repeat it here.\n- **Contact form** (`site.json → contact_form.enabled`, Contact Form 7, WordPress only): send the two\n throwaway test submissions in\n [`../04-content-model/wordpress/contact-form.md`](../04-content-model/wordpress/contact-form.md) §5: the\n first must return `status` **`mail_sent`**, the one with the honeypot filled **`spam`**.\n\nFail or counts off → fix content-model push before building against live data.\n\n## 3 — Clean rebuild against the live API (optional — skip unless signing off)\n\nFrontend already produced a clean build; only redo this if you want a from-scratch guarantee before a\nhuman sign-off. Remove the build output and rebuild; a failed or incomplete build is a stop (no\nfixtures, placeholder copy or `.htaccess` in the output).\n\n- **Astro (SSG):** `rm -rf dist && npm run build && npm run check:dist`.\n- **Next.js (SSR):** `rm -rf .next && npm run check && npm run build`.\n\n## 4 — Preview & approval (optional — only when a person is signing off)\n\nWhen someone wants to see it first: start the local preview (Astro: `npm run preview`; Next.js:\n`npx next start`), show the user a couple of key routes at desktop and phone width (capture phone width\nas in frontend's *Visual check*; frontend already caught the layout bugs, so this is for the user, not a\nre-review) and navigation, and present it for **explicit approval**. If preview tooling is unavailable,\ngive the user the command and URL. On an autonomous or temp-domain run, skip this — deploy will verify the live result anyway.\n\nThen (after approval, or immediately if 3–4 were skipped): `state.json` → `stage: \"deploy\"`, fresh\n`updated_at`; leave `provision` unchanged.\n"
431
+ "text": "---\nname: headless-step-validate\ndescription: \"Step 7 (validate) of the Hostinger Headless flow. Quick gate before deploy: every prior stage already self-verifies, so this is a fast confirmation (instance live + backend API answers with seeded content), an npm audit of the frontend before the first deploy (fix high/critical advisories, rebuild clean), plus optional local preview and user sign-off. Skip the heavy parts when nobody needs to approve.\"\n---\n\n# headless-step-validate\n\n> **Fast.** Every stage before this one already verifies its own work (provision checks the\n> backend, content-model push checks the REST counts, frontend builds clean and looks right at desktop\n> and phone width), and **deploy verifies the live result**. So validate is **not** a re-run of all\n> that — it's two quick checks, an npm audit before the first deploy, and the optional human\n> preview/sign-off. **Skip Steps 4–5 (rebuild + approval) entirely** on an autonomous or temp-domain run\n> where no one is signing off. Spend time here only when a person wants to see it before it goes live.\n\n**In:** project in `~/.hostinger/<domain>/src/`, `site.json`, `state.json`.\n\n## 1 — Instance status (always, quick)\n\n`provision.status == \"completed\"` in `state.json`. Anything else → not ready; return to the instance\nbarrier, don't deploy. Deploy's pre-flight asks the connector again (see *State and artifacts* in the\ntop-level `SKILL.md`).\n\n## 2 — Backend API status (every backend, always, quick)\n\nHit the live API from `site.json` and confirm it answers **with the content the push created** — a 200\nwith an empty catalog means the push didn't land:\n\n- **WordPress:** `GET {urls.rest_api}/posts?per_page=1` → 200 JSON array; check `X-WP-Total` against the\n planned post count, and `GET {urls.rest_api}/media?per_page=1` → `X-WP-Total` matches the planned\n image count (more = duplicates).\n- **WordPress + WooCommerce** (`site.json → woocommerce.enabled`): the WordPress check above **plus**\n `GET {urls.store_api}/products?per_page=100` → 200 with the seeded products and `prices` (minor units);\n count matches the plan. Don't test checkout while `woocommerce.payment_enabled` is `false`.\n- **Ecommerce:** query `urls.storefront_api` for the sales channel → 200 with the seeded products and\n prices *(confirm against the store)*.\n- **PocketBase** (`site.json → backend: \"pocketbase\"`): `GET {urls.api}/health` → 200, and every\n collection with `seed` records in `pocketbase/schema.json` lists them\n (`GET {urls.api}/collections/<name>/records?perPage=1` → `totalItems` at least the seed count, for\n collections visitors may list). `pb-verify.mjs` already ran at the content-model push, so don't\n repeat it here.\n- **Contact form** (`site.json → contact_form.enabled`, Contact Form 7, WordPress only): send the two\n throwaway test submissions in\n [`../04-content-model/wordpress/contact-form.md`](../04-content-model/wordpress/contact-form.md) §5: the\n first must return `status` **`mail_sent`**, the one with the honeypot filled **`spam`**.\n\nFail or counts off → fix content-model push before building against live data.\n\n## 3 — Dependency audit (first deploy only, even when nobody signs off)\n\nRun this only when `~/.hostinger/<domain>/deploy.json` doesn't exist yet: deploy writes it after the\nfirst passing deploy, so iterate and redeploy runs skip this step and don't report the skip. Deploy\nships `package-lock.json` and the server installs from it, so the fix lands in the lockfile here. In\n`~/.hostinger/<domain>/src/`:\n\n1. **Audit.** `npm audit`. No vulnerabilities → note \"npm audit clean\" in validate's *Steps completed*\n row of the final report and go on to Step 4. If it can't run (no `package-lock.json`, registry\n unreachable), log an `issue` event\n `{\"stage\":\"validate\",\"symptom\":\"npm audit could not run\",\"cause\":\"<error>\",\"severity\":\"medium\",\"resolved\":false}`,\n list it under *Gaps / follow-ups*, and go on.\n2. **Back up.** Copy `package.json` and `package-lock.json` to `~/.hostinger/<domain>/audit-backup/`\n (outside `src/`, so the deploy archive doesn't pick them up). This is the last working pair. Delete\n `audit-backup/` when this step ends.\n3. **Safe fixes.** `npm audit fix`, then rebuild clean: delete the build output (`.next` for Next.js,\n `.output` for Nuxt, `build` for SvelteKit, `dist` for Astro and Vite/React/Vue; for any\n other framework, the folder `npm run build` writes), run `npm run build`, and run the project's `check` or\n `check:dist` script if it has one. Passes → copy the pair to the backup again. Fails → restore the\n backup and `npm ci`. Never run `npm audit fix --force`: it takes breaking major upgrades across the\n whole tree. Low and moderate advisories this can't fix stay.\n4. **High and critical.** If `npm audit --audit-level=high` still fails, run `npm audit --json`. For\n each entry under `vulnerabilities` whose `severity` is `high` or `critical` and whose `fixAvailable`\n is an object, run `npm install <fixAvailable.name>@<fixAvailable.version>`. Rebuild clean as in\n item 3. Fails → restore the backup, `npm ci`, and treat those advisories as leftovers.\n `fixAvailable: false` means no dependency upgrade fixes it.\n\n**Leftovers.** A high or critical advisory that no upgrade fixes, or whose upgrade breaks the build,\ndoesn't block the deploy: deploy the last working pair, log one event for all of them, and list each\n(package, severity, advisory ID, why it stays) under *Gaps / follow-ups* in the final report\n([`../09-done/SKILL.md`](../09-done/SKILL.md)):\n\n```bash\nnode <skill>/run-log.mjs <domain> event issue '{\"stage\":\"validate\",\"symptom\":\"npm audit: <n> high/critical advisories left\",\"cause\":\"<package>@<version> <advisory ID>: no fix through an upgrade | upgrade breaks the build; …\",\"severity\":\"high\",\"resolved\":false}'\n```\n\n## 4 — Clean rebuild against the live API (optional — skip unless signing off)\n\nFrontend already produced a clean build; only redo this if you want a from-scratch guarantee before a\nhuman sign-off. Remove the build output and rebuild; a failed or incomplete build is a stop (no\nfixtures, placeholder copy or `.htaccess` in the output).\n\n- **Astro (SSG):** `rm -rf dist && npm run build && npm run check:dist`.\n- **Next.js (SSR):** `rm -rf .next && npm run check && npm run build`.\n\n## 5 — Preview & approval (optional — only when a person is signing off)\n\nWhen someone wants to see it first: start the local preview (Astro: `npm run preview`; Next.js:\n`npx next start`), show the user a couple of key routes at desktop and phone width (capture phone width\nas in frontend's *Visual check*; frontend already caught the layout bugs, so this is for the user, not a\nre-review) and navigation, and present it for **explicit approval**. If preview tooling is unavailable,\ngive the user the command and URL. On an autonomous or temp-domain run, skip this — deploy will verify the live result anyway.\n\nThen (after approval, or immediately if 4–5 were skipped): `state.json` → `stage: \"deploy\"`, fresh\n`updated_at`; leave `provision` unchanged.\n"
432
432
  },
433
433
  {
434
434
  "uri": "skill://hostinger-headless/steps/08-deploy/SKILL.md",
435
- "digest": "sha256:0f3d36e77d0428edb2874e5733a774a7fa440edf68c74cca524de8177ac6047c",
436
- "size": 16826,
435
+ "digest": "sha256:2d28e17428e15cf9579a1e712ae7099969353535c32c3ab85a2527b8127bb2d9",
436
+ "size": 16915,
437
437
  "mimeType": "text/markdown",
438
- "text": "---\nname: headless-step-deploy\ndescription: \"Step 8 (deploy) of the Hostinger Headless flow. Archives the frontend source, then deploys through the connector's one-shot hosting_deploy (type nodejs — it uploads the source, runs npm install and the build on the server) with the chosen framework's build settings (appType + output dir) passed explicitly, polls to completion with hosting_get-deployment, verifies the live site and that the backend survived, then writes deploy.json.\"\n---\n\n# headless-step-deploy\n\nShip the frontend to the live domain through the Hostinger connector. You hand the connector a zip of\nthe project **source** and it uploads it, runs `npm install` + the build script on the server, and\nserves the result. **Out:** `deploy.json`.\n\nThis is an **instance-barrier** step: run it only after `provision.status == \"completed\"` and validate\n(if run) has passed. All operations go through the connector (`execute`).\n\n> **Connected to the hosted server (`mcp.hostinger.com`)?** Its `hosting_deploy` deploys Git\n> repositories only and cannot read a local `path`. Run this step through the local\n> `hostinger-api-mcp` server instead (see the connect step:\n> `<command> <launcher>`).\n\n> **With a shell and the Hostinger CLI installed**, the same deploy is one command, with the build\n> settings passed exactly as the table below says. Run it from the project, since it links the current directory:\n> `cd ~/.hostinger/<domain>/src && hostinger up --domain <domain> --type nodejs --app-type <appType> --output-directory <dir> --build-script build --node-version 22 --package-manager npm --message \"<what this deploy changes, like a commit message>\" --yes --format json`.\n> If it fails with `unknown flag: --message` (an older CLI), run `brew upgrade hostinger/tap/hostinger` or rerun it without `--message`.\n> It uploads, builds, waits and returns `data.buildUuid` and `data.buildState`; add `--no-wait` to\n> return at once and wait with `cd \"$HOME\" && node <skill>/wait.mjs build <domain> <uuid>`. Then continue at\n> \"Verify\" below. Recent CLI versions see that the site is headless (`data.headless: true`) and\n> deploy only its Node.js frontend, leaving `/cms` alone; still pass the settings above.\n\n**In:** the project in `~/.hostinger/<domain>/src/`, `site.json` (`username`, `urls`), `state.json`\n(`frontend.framework`, `frontend.rendering`).\n\n> ## ⚠️ The one rule that makes this work: pass build settings explicitly\n> If you let `hosting_deploy` **auto-detect** build settings, for a headless site that detection returns\n> **null** (`appType:null`, `outputDirectory:null`, Node 20) — the build \"completes\" but the **root\n> serves 403** (no `appType`/output → the vhost serves a directory with no entry). This is reproducible.\n> **Always pass `appType`, `outputDirectory`, `nodeVersion`, `buildScript`, `packageManager` and\n> `rootDirectory` on the `hosting_deploy` call** with the framework's values; the deploy then resolves\n> them and serves correctly, and `/cms` is preserved.\n\n## Build configurations\n\nMap `frontend.framework` (from `state.json`) to its `appType` + build output directory, and pass those\non the `hosting_deploy` call. `appType` is the framework's value, e.g. `next`, `nuxt`, `astro`,\n`svelte-kit`, `nest`, `express`, `fastify`, `react`, `create-react-app`, `gatsby`, `vite`, `vue`,\n`angular`, `parcel`, `svelte`, `other`.\n\nCommon cases (all `nodeVersion: 22`, `buildScript: \"build\"`, `packageManager: \"npm\"`, `rootDirectory: \".\"`):\n\n| Framework / mode | Local config | `appType` | `outputDirectory` |\n|---|---|---|---|\n| **Next.js — SSR** *(default)* | `output: 'standalone'` | `next` | `.next` |\n| **Nuxt — SSR** | default | `nuxt` | `.output` |\n| **SvelteKit — SSR** | node adapter | `svelte-kit` | `build` |\n| **Astro — static** | `output: 'static'` | `astro` | `dist` |\n| **Vite / React / Vue — static (SPA)** | — | `vite` (or `react`/`vue`) | `dist` |\n| **Express / NestJS / Fastify — server** | — | `express`/`nest`/`fastify` | build output dir |\n\nSSR/server frameworks run a persistent Node process (root sends `x-powered-by` / `cache-control: no-store`);\nstatic frameworks serve their output dir as files. If unsure of a framework's output dir, check the\nframework's own build output.\n\n## Step 1 — Pre-flight\n\n1. **Instance live (the deploy gate).** `provision.status == \"completed\"`, re-verified with\n `hosting_websites_list-setups { \"domain\": \"<domain>\" }`: deploy overwrites the site root, so it never\n trusts `state.json` alone.\n2. **Build output exists locally** (the framework's output dir — e.g. `.next/`, `dist/`, `.output/`) and\n the project builds clean (frontend/validate already did this). If not, go back.\n - **Next.js 16+:** `package.json`'s `build` script is `next build --webpack`, not plain `next build` —\n the server's glibc can't run Turbopack's native compiler, and Turbopack doesn't fall back to webpack\n (see `../06-frontend/SKILL.md` Step 3). On Next.js 15.x leave it as plain `next build`. Fix it here if it isn't.\n3. **PocketBase: nothing under `/api` or `/_`.** The app serves no route under those\n prefixes, whatever its framework (Next.js `app/api/` or `pages/api/`, Nuxt `server/api/`, SvelteKit\n `src/routes/api/`, Astro `src/pages/api/`, an Express or Fastify route), and `src/` holds no\n `.pocketbase/` folder or `credentials.json`. Fix it here if it does.\n4. **Env vars (only if used).** Build-time vars (e.g. `NEXT_PUBLIC_*`) must be set **before** the build\n with `hosting_nodejs_replace-environment-variables` (full replace: list the current keys first and\n send the complete set). Never put secrets in the repo or the archive. On PocketBase, server-side\n superuser work reads `PB_URL`, `PB_SUPERUSER_EMAIL` and `PB_SUPERUSER_PASSWORD` from here (the\n values come from `~/.hostinger/<domain>/.pocketbase/credentials.json`, never from the archive).\n\n## Step 2 — Archive the source\n\nZip the project **source** with `package.json` at the archive root. **Include** the app/source,\n`public/`, the framework config (`next.config.mjs` / `astro.config.mjs`), `tsconfig.json`,\n`package.json`, `package-lock.json`, `.nvmrc`. **Exclude** `node_modules/`, the build output\n(`.next/`, `dist/`, `out/`), `.git/`, and any `.htaccess` — the server installs and builds from source.\n**Never archive secrets:** the commands below also leave out `.env*` files, `.npmrc` and key/certificate\nfiles (`*.pem`, `*.key`, `*.p12`, `*.pfx`) and any `.pocketbase/` folder. A brought-in project often has a `.env.local`; its values go in\nas environment variables (Step 1), never in the archive. `hosting_deploy` also skips any file named\n`credentials.json` itself and lists it in `skippedFiles`.\n\n> ## ⚠️ Write the archive outside `~/.hostinger/` (the deploy refuses it there)\n> `hosting_deploy` refuses any `path` under a hidden folder at the top of the home directory\n> (`~/.hostinger`, `~/.config`, …) with *\"it is, or contains, a home, system or credentials location\"*:\n> a deploy publishes what it reads, so the connector protects dotfolders that can hold tokens. That\n> covers both `~/.hostinger/<domain>/app.zip` **and** the `~/.hostinger/<domain>/src/` directory\n> itself, so neither can be passed as `path`. Keep the source in the workspace as usual, but write the\n> archive to a fresh temp directory and pass that. Don't copy the archive somewhere else after a\n> refusal, and don't move `src/` out of the workspace.\n\n```bash\n# macOS/Linux — the OS temp dir is outside the home directory\ncd ~/.hostinger/<domain>/src\nDEPLOY_DIR=$(mktemp -d)\nzip -r -X \"$DEPLOY_DIR/app.zip\" . -x 'node_modules/*' '.next/*' 'dist/*' 'out/*' '.git/*' '**/.htaccess' \\\n '.env*' '*/.env*' '.npmrc' '*/.npmrc' '*.pem' '*.key' '*.p12' '*.pfx' '.pocketbase/*' '*/.pocketbase/*'\necho \"$DEPLOY_DIR/app.zip\" # the absolute path to pass as `path` in Step 3\n```\n\n```powershell\n# Windows PowerShell — %TEMP% sits under AppData, which the deploy also refuses; use a plain folder in your\n# profile, which only you can write to (never a folder under C:\\, which every local account can write into)\ncd $HOME\\.hostinger\\<domain>\\src\n$DeployDir = Join-Path $HOME \"hostinger-deploy\\<domain>\"; New-Item -ItemType Directory -Force $DeployDir | Out-Null\ntar -a -cf \"$DeployDir\\app.zip\" --exclude=node_modules --exclude=.next --exclude=dist --exclude=out --exclude=.git --exclude=.htaccess `\n --exclude=.env* --exclude=.npmrc --exclude=*.pem --exclude=*.key --exclude=*.p12 --exclude=*.pfx --exclude=.pocketbase .\n\"$DeployDir\\app.zip\" # the absolute path to pass as `path` in Step 3\n```\n\nDelete the temp directory once the build in Step 4 is `completed`.\n\n## Step 3 — Deploy (one shot: settings + upload + build)\n\nPass the framework's build settings **inline** on the deploy call — there is no separate settings step.\n`path` is the absolute path of the archive from Step 2, in its temp directory. Never pass a path under\n`~/.hostinger/`, the `src/` directory included: the deploy refuses it (see Step 2).\n`message` says what this deploy ships, written like a commit message (first line under 72 characters,\nat most 500): it labels the deploy in the website's deployment history, which otherwise shows only the\narchive's file name.\n\n```json\n{ \"operation\": \"hosting_deploy\",\n \"params\": {\n \"domain\": \"<domain>\",\n \"path\": \"<absolute path printed in Step 2, e.g. /var/folders/…/tmp.XXXX/app.zip>\",\n \"type\": \"nodejs\",\n \"appType\": \"<framework appType, e.g. next>\",\n \"outputDirectory\": \"<framework output dir, e.g. .next>\",\n \"nodeVersion\": 22,\n \"buildScript\": \"build\",\n \"packageManager\": \"npm\",\n \"rootDirectory\": \".\",\n \"message\": \"<one-line summary of what this deploy ships, e.g. Add pricing page>\" } }\n```\n\n`hosting_deploy` uploads the source and triggers `npm install` + the build **end-to-end** — do not call\nany upload or build operation yourself. It returns a build `buildUuid` at once. This **overwrites the\nwebsite root** (expected) and keeps the backend's paths intact (`/cms` for WordPress; `/api` and `/_/`\nfor PocketBase). `type` is always `\"nodejs\"` for a headless site, with the explicit `appType`/`outputDirectory` from\n*Build configurations* —\n**never `\"static\"`**, which serves the build as plain files over the document root and **overwrites\n`/cms`**, destroying the WordPress backend, and would likewise break the routing that keeps `/api` and\n`/_/` on a PocketBase backend. A static-built SPA (Vite/React/Vue) still deploys as\n`type: \"nodejs\"` with its `appType`.\n\n## Step 4 — Wait for the build and the live root\n\nWait for it in one command (see *Waiting on Hostinger* in the top-level `SKILL.md`):\n\n```bash\ncd \"$HOME\" && node <skill>/wait.mjs build <domain> <buildUuid>\n```\n\nIt waits for `hosting_get-deployment` to report the build `completed`, then up to 5 minutes for\n`https://<domain>/` (or `http://` while the certificate is pending) to serve 200. What its result means here:\n\n- `ok: true`: the build is done and the root serves 200. Go on to Step 5.\n- `ok: true` with `https_pending: true`: the build is done and `http://<domain>/` serves 200, but the\n new domain's SSL certificate is still installing (this can take the better part of an hour). The\n deploy worked: tell the user HTTPS will follow on its own, run Step 5 over `http://`, and don't\n wait for the certificate.\n- `ok: false` with `build.state: failed`: read `log_tail` (the end of the build log) and `analysis`, fix\n locally, re-archive and redeploy (pass `fromLine` to `hosting_get-deployment` to read only new log\n output).\n- `ok: false` with `build settings missing`: the settings didn't take (the root would 403 for good). Fix\n the deploy call and redeploy.\n- `ok: false` with `timed_out`: `last_status` says whether the build was still running or the root\n wasn't serving 200 yet (see Step 5's note on a 403). For an SSR app that built but hangs,\n `hosting_nodejs_restart-application { username, domain }` recovers the server without a rebuild.\n\n## Step 5 — Verify the live site (all must pass)\n\n| Check | How | Expect |\n|---|---|---|\n| Root serves | `GET https://<domain>/` | **200** (not 403 / 404) |\n| SSR is live *(server frameworks)* | response headers | `x-powered-by` present, `cache-control: no-store` |\n| Static serves *(static frameworks)* | `GET https://<domain>/` | 200 HTML with real home content |\n| Key routes | a couple of planned routes + one deep route | 200, real content |\n| **Backend survived** *(WordPress / WooCommerce)* | `GET https://<domain>/cms/wp-json/wp/v2/posts?per_page=1` | 200 |\n| **Backend survived** *(PocketBase)* | `GET https://<domain>/api/health` and `GET https://<domain>/_/` | 200 and 200 |\n| **No credentials served** *(PocketBase)* | `GET https://<domain>/.pocketbase/credentials.json` | 404 |\n\n> **Only WordPress (including WordPress + WooCommerce) has a `/cms` on the domain**, and only PocketBase\n> has `/api` and `/_/`, so the *Backend survived* check depends on the backend.\n> - **WordPress + WooCommerce:** also confirm the store survived the deploy —\n> `GET https://<domain>/cms/wp-json/wc/store/v1/products?per_page=1` → 200. There is nothing external to\n> link (no sales-channel step — that's Ecommerce only). **Checkout** stays owner-completed: when\n> `site.json → woocommerce.payment_enabled` is `false`, don't test `/checkout`; a catalog that serves 200\n> is a passing, complete deploy.\n> - **Ecommerce:** the backend is the **Hostinger Ecommerce store**, read over the external Storefront API\n> (`api-ecommerce.hostinger.com`) — nothing a deploy touches lives on this domain. There is no `/cms`;\n> confirm the storefront still fetches products as a frontend check if you like. **Only check that\n> checkout can be reached when `site.json → ecommerce.payment_enabled` is `true`** — on a free account\n> (`payment_enabled: false`) there is no checkout, so **skip that check entirely**; a catalog that serves\n> 200 is a passing, complete deploy. Never fail or hold the deploy because checkout is unavailable.\n> - **PocketBase** (`site.json → backend: \"pocketbase\"`): the backend lives on this domain at `/api`\n> and `/_`, so check both survived and that the credentials URL is a 404, then run\n> `node <skill>/steps/04-content-model/pocketbase/scripts/pb-verify.mjs ~/.hostinger/<domain>/.pocketbase/credentials.json ~/.hostinger/<domain>/pocketbase/schema.json`\n> and expect `READY` (its last check, the website serving the app, now passes). If `/api/health`\n> fails while the root serves the app, the app is answering `/api`: move its routes off that prefix\n> and redeploy. If the credentials URL returns anything but 404, rotate the superuser at once\n> (`hosting_pocketbase_set-superuser`, see `../03-provision/pocketbase/SKILL.md` Step 3) and\n> redeploy without the file.\n\nThe root check is already done when `wait.mjs build` returned `ok: true`; check the rest in one shell\ncommand (`curl` each URL). A `completed` build whose root 403s almost always means the build settings\nweren't passed to `hosting_deploy` (null settings) — pass them and redeploy. Caching can briefly serve a\nstale root; re-check after ~30 s.\n\n## Step 6 — Record `deploy.json`\n\n```json\n{\n \"build_uuid\": \"…\",\n \"stack\": \"nextjs\",\n \"rendering\": \"ssr\",\n \"app_type\": \"next\",\n \"output_directory\": \".next\",\n \"node_version\": 22,\n \"method\": \"hosting_deploy (type: nodejs, settings passed inline)\",\n \"deployed_at\": \"…\",\n \"verified_at\": \"…\",\n \"urls\": { \"live\": \"https://<domain>\", \"cms\": \"https://<domain>/cms\" },\n \"checks\": { \"root\": 200, \"ssr_headers\": true, \"backend_preserved\": true }\n}\n```\n\nNo secrets in `deploy.json`. The `urls.cms` field and the `backend_preserved` check above are\n**WordPress-only** — adjust the record to the backend:\n\n- **WordPress:** keep `urls.cms` and `checks.backend_preserved` as shown.\n- **WordPress + WooCommerce:** keep `urls.cms` + `checks.backend_preserved` (it *is* WordPress), and add\n `urls.store_api` from `site.json`; no external link step.\n- **Ecommerce:** omit `urls.cms`/`backend_preserved`; record the store URLs instead (`urls.storefront_api`,\n `urls.store_admin` from `site.json`) and link the custom sales channel to the live domain —\n `ecommerce_sales-channels_update { store_id, sales_channel_id, url }` (see the ecommerce provision step).\n- **PocketBase:** omit `urls.cms`; add `urls.api` and `urls.admin` from `site.json`,\n `checks.backend_preserved` (the `/api/health` and `/_/` checks) and `checks.pb_verify: \"READY\"`.\n\nUpdate `state.json` (`stage` → `done`), then continue to Step 9 (done).\n\n`hosting_deploy` on the local server is the only path: give its `path` a local **archive** (`zip`, `tar`,\n`tar.gz`, `tgz`, `7z`) written outside `~/.hostinger/` as in Step 2. There is no separate upload or\nbuild step to fall back to.\n"
438
+ "text": "---\nname: headless-step-deploy\ndescription: \"Step 8 (deploy) of the Hostinger Headless flow. Archives the frontend source, then deploys through the connector's one-shot hosting_deploy (type nodejs — it uploads the source, runs npm install and the build on the server) with the chosen framework's build settings (appType + output dir) passed explicitly, polls to completion with hosting_get-deployment, verifies the live site and that the backend survived, then writes deploy.json.\"\n---\n\n# headless-step-deploy\n\nShip the frontend to the live domain through the Hostinger connector. You hand the connector a zip of\nthe project **source** and it uploads it, runs `npm install` + the build script on the server, and\nserves the result. **Out:** `deploy.json`.\n\nThis is an **instance-barrier** step: run it only after `provision.status == \"completed\"` and validate\nhas passed (on a first deploy that includes its dependency audit, even when the rest of validate is\nskipped). All operations go through the connector (`execute`).\n\n> **Connected to the hosted server (`mcp.hostinger.com`)?** Its `hosting_deploy` deploys Git\n> repositories only and cannot read a local `path`. Run this step through the local\n> `hostinger-api-mcp` server instead (see the connect step:\n> `<command> <launcher>`).\n\n> **With a shell and the Hostinger CLI installed**, the same deploy is one command, with the build\n> settings passed exactly as the table below says. Run it from the project, since it links the current directory:\n> `cd ~/.hostinger/<domain>/src && hostinger up --domain <domain> --type nodejs --app-type <appType> --output-directory <dir> --build-script build --node-version 22 --package-manager npm --message \"<what this deploy changes, like a commit message>\" --yes --format json`.\n> If it fails with `unknown flag: --message` (an older CLI), run `brew upgrade hostinger/tap/hostinger` or rerun it without `--message`.\n> It uploads, builds, waits and returns `data.buildUuid` and `data.buildState`; add `--no-wait` to\n> return at once and wait with `cd \"$HOME\" && node <skill>/wait.mjs build <domain> <uuid>`. Then continue at\n> \"Verify\" below. Recent CLI versions see that the site is headless (`data.headless: true`) and\n> deploy only its Node.js frontend, leaving `/cms` alone; still pass the settings above.\n\n**In:** the project in `~/.hostinger/<domain>/src/`, `site.json` (`username`, `urls`), `state.json`\n(`frontend.framework`, `frontend.rendering`).\n\n> ## ⚠️ The one rule that makes this work: pass build settings explicitly\n> If you let `hosting_deploy` **auto-detect** build settings, for a headless site that detection returns\n> **null** (`appType:null`, `outputDirectory:null`, Node 20) — the build \"completes\" but the **root\n> serves 403** (no `appType`/output → the vhost serves a directory with no entry). This is reproducible.\n> **Always pass `appType`, `outputDirectory`, `nodeVersion`, `buildScript`, `packageManager` and\n> `rootDirectory` on the `hosting_deploy` call** with the framework's values; the deploy then resolves\n> them and serves correctly, and `/cms` is preserved.\n\n## Build configurations\n\nMap `frontend.framework` (from `state.json`) to its `appType` + build output directory, and pass those\non the `hosting_deploy` call. `appType` is the framework's value, e.g. `next`, `nuxt`, `astro`,\n`svelte-kit`, `nest`, `express`, `fastify`, `react`, `create-react-app`, `gatsby`, `vite`, `vue`,\n`angular`, `parcel`, `svelte`, `other`.\n\nCommon cases (all `nodeVersion: 22`, `buildScript: \"build\"`, `packageManager: \"npm\"`, `rootDirectory: \".\"`):\n\n| Framework / mode | Local config | `appType` | `outputDirectory` |\n|---|---|---|---|\n| **Next.js — SSR** *(default)* | `output: 'standalone'` | `next` | `.next` |\n| **Nuxt — SSR** | default | `nuxt` | `.output` |\n| **SvelteKit — SSR** | node adapter | `svelte-kit` | `build` |\n| **Astro — static** | `output: 'static'` | `astro` | `dist` |\n| **Vite / React / Vue — static (SPA)** | — | `vite` (or `react`/`vue`) | `dist` |\n| **Express / NestJS / Fastify — server** | — | `express`/`nest`/`fastify` | build output dir |\n\nSSR/server frameworks run a persistent Node process (root sends `x-powered-by` / `cache-control: no-store`);\nstatic frameworks serve their output dir as files. If unsure of a framework's output dir, check the\nframework's own build output.\n\n## Step 1 — Pre-flight\n\n1. **Instance live (the deploy gate).** `provision.status == \"completed\"`, re-verified with\n `hosting_websites_list-setups { \"domain\": \"<domain>\" }`: deploy overwrites the site root, so it never\n trusts `state.json` alone.\n2. **Build output exists locally** (the framework's output dir — e.g. `.next/`, `dist/`, `.output/`) and\n the project builds clean (frontend/validate already did this). If not, go back.\n - **Next.js 16+:** `package.json`'s `build` script is `next build --webpack`, not plain `next build` —\n the server's glibc can't run Turbopack's native compiler, and Turbopack doesn't fall back to webpack\n (see `../06-frontend/SKILL.md` Step 3). On Next.js 15.x leave it as plain `next build`. Fix it here if it isn't.\n3. **PocketBase: nothing under `/api` or `/_`.** The app serves no route under those\n prefixes, whatever its framework (Next.js `app/api/` or `pages/api/`, Nuxt `server/api/`, SvelteKit\n `src/routes/api/`, Astro `src/pages/api/`, an Express or Fastify route), and `src/` holds no\n `.pocketbase/` folder or `credentials.json`. Fix it here if it does.\n4. **Env vars (only if used).** Build-time vars (e.g. `NEXT_PUBLIC_*`) must be set **before** the build\n with `hosting_nodejs_replace-environment-variables` (full replace: list the current keys first and\n send the complete set). Never put secrets in the repo or the archive. On PocketBase, server-side\n superuser work reads `PB_URL`, `PB_SUPERUSER_EMAIL` and `PB_SUPERUSER_PASSWORD` from here (the\n values come from `~/.hostinger/<domain>/.pocketbase/credentials.json`, never from the archive).\n\n## Step 2 — Archive the source\n\nZip the project **source** with `package.json` at the archive root. **Include** the app/source,\n`public/`, the framework config (`next.config.mjs` / `astro.config.mjs`), `tsconfig.json`,\n`package.json`, `package-lock.json`, `.nvmrc`. **Exclude** `node_modules/`, the build output\n(`.next/`, `dist/`, `out/`), `.git/`, and any `.htaccess` — the server installs and builds from source.\n**Never archive secrets:** the commands below also leave out `.env*` files, `.npmrc` and key/certificate\nfiles (`*.pem`, `*.key`, `*.p12`, `*.pfx`) and any `.pocketbase/` folder. A brought-in project often has a `.env.local`; its values go in\nas environment variables (Step 1), never in the archive. `hosting_deploy` also skips any file named\n`credentials.json` itself and lists it in `skippedFiles`.\n\n> ## ⚠️ Write the archive outside `~/.hostinger/` (the deploy refuses it there)\n> `hosting_deploy` refuses any `path` under a hidden folder at the top of the home directory\n> (`~/.hostinger`, `~/.config`, …) with *\"it is, or contains, a home, system or credentials location\"*:\n> a deploy publishes what it reads, so the connector protects dotfolders that can hold tokens. That\n> covers both `~/.hostinger/<domain>/app.zip` **and** the `~/.hostinger/<domain>/src/` directory\n> itself, so neither can be passed as `path`. Keep the source in the workspace as usual, but write the\n> archive to a fresh temp directory and pass that. Don't copy the archive somewhere else after a\n> refusal, and don't move `src/` out of the workspace.\n\n```bash\n# macOS/Linux — the OS temp dir is outside the home directory\ncd ~/.hostinger/<domain>/src\nDEPLOY_DIR=$(mktemp -d)\nzip -r -X \"$DEPLOY_DIR/app.zip\" . -x 'node_modules/*' '.next/*' 'dist/*' 'out/*' '.git/*' '**/.htaccess' \\\n '.env*' '*/.env*' '.npmrc' '*/.npmrc' '*.pem' '*.key' '*.p12' '*.pfx' '.pocketbase/*' '*/.pocketbase/*'\necho \"$DEPLOY_DIR/app.zip\" # the absolute path to pass as `path` in Step 3\n```\n\n```powershell\n# Windows PowerShell — %TEMP% sits under AppData, which the deploy also refuses; use a plain folder in your\n# profile, which only you can write to (never a folder under C:\\, which every local account can write into)\ncd $HOME\\.hostinger\\<domain>\\src\n$DeployDir = Join-Path $HOME \"hostinger-deploy\\<domain>\"; New-Item -ItemType Directory -Force $DeployDir | Out-Null\ntar -a -cf \"$DeployDir\\app.zip\" --exclude=node_modules --exclude=.next --exclude=dist --exclude=out --exclude=.git --exclude=.htaccess `\n --exclude=.env* --exclude=.npmrc --exclude=*.pem --exclude=*.key --exclude=*.p12 --exclude=*.pfx --exclude=.pocketbase .\n\"$DeployDir\\app.zip\" # the absolute path to pass as `path` in Step 3\n```\n\nDelete the temp directory once the build in Step 4 is `completed`.\n\n## Step 3 — Deploy (one shot: settings + upload + build)\n\nPass the framework's build settings **inline** on the deploy call — there is no separate settings step.\n`path` is the absolute path of the archive from Step 2, in its temp directory. Never pass a path under\n`~/.hostinger/`, the `src/` directory included: the deploy refuses it (see Step 2).\n`message` says what this deploy ships, written like a commit message (first line under 72 characters,\nat most 500): it labels the deploy in the website's deployment history, which otherwise shows only the\narchive's file name.\n\n```json\n{ \"operation\": \"hosting_deploy\",\n \"params\": {\n \"domain\": \"<domain>\",\n \"path\": \"<absolute path printed in Step 2, e.g. /var/folders/…/tmp.XXXX/app.zip>\",\n \"type\": \"nodejs\",\n \"appType\": \"<framework appType, e.g. next>\",\n \"outputDirectory\": \"<framework output dir, e.g. .next>\",\n \"nodeVersion\": 22,\n \"buildScript\": \"build\",\n \"packageManager\": \"npm\",\n \"rootDirectory\": \".\",\n \"message\": \"<one-line summary of what this deploy ships, e.g. Add pricing page>\" } }\n```\n\n`hosting_deploy` uploads the source and triggers `npm install` + the build **end-to-end** — do not call\nany upload or build operation yourself. It returns a build `buildUuid` at once. This **overwrites the\nwebsite root** (expected) and keeps the backend's paths intact (`/cms` for WordPress; `/api` and `/_/`\nfor PocketBase). `type` is always `\"nodejs\"` for a headless site, with the explicit `appType`/`outputDirectory` from\n*Build configurations* —\n**never `\"static\"`**, which serves the build as plain files over the document root and **overwrites\n`/cms`**, destroying the WordPress backend, and would likewise break the routing that keeps `/api` and\n`/_/` on a PocketBase backend. A static-built SPA (Vite/React/Vue) still deploys as\n`type: \"nodejs\"` with its `appType`.\n\n## Step 4 — Wait for the build and the live root\n\nWait for it in one command (see *Waiting on Hostinger* in the top-level `SKILL.md`):\n\n```bash\ncd \"$HOME\" && node <skill>/wait.mjs build <domain> <buildUuid>\n```\n\nIt waits for `hosting_get-deployment` to report the build `completed`, then up to 5 minutes for\n`https://<domain>/` (or `http://` while the certificate is pending) to serve 200. What its result means here:\n\n- `ok: true`: the build is done and the root serves 200. Go on to Step 5.\n- `ok: true` with `https_pending: true`: the build is done and `http://<domain>/` serves 200, but the\n new domain's SSL certificate is still installing (this can take the better part of an hour). The\n deploy worked: tell the user HTTPS will follow on its own, run Step 5 over `http://`, and don't\n wait for the certificate.\n- `ok: false` with `build.state: failed`: read `log_tail` (the end of the build log) and `analysis`, fix\n locally, re-archive and redeploy (pass `fromLine` to `hosting_get-deployment` to read only new log\n output).\n- `ok: false` with `build settings missing`: the settings didn't take (the root would 403 for good). Fix\n the deploy call and redeploy.\n- `ok: false` with `timed_out`: `last_status` says whether the build was still running or the root\n wasn't serving 200 yet (see Step 5's note on a 403). For an SSR app that built but hangs,\n `hosting_nodejs_restart-application { username, domain }` recovers the server without a rebuild.\n\n## Step 5 — Verify the live site (all must pass)\n\n| Check | How | Expect |\n|---|---|---|\n| Root serves | `GET https://<domain>/` | **200** (not 403 / 404) |\n| SSR is live *(server frameworks)* | response headers | `x-powered-by` present, `cache-control: no-store` |\n| Static serves *(static frameworks)* | `GET https://<domain>/` | 200 HTML with real home content |\n| Key routes | a couple of planned routes + one deep route | 200, real content |\n| **Backend survived** *(WordPress / WooCommerce)* | `GET https://<domain>/cms/wp-json/wp/v2/posts?per_page=1` | 200 |\n| **Backend survived** *(PocketBase)* | `GET https://<domain>/api/health` and `GET https://<domain>/_/` | 200 and 200 |\n| **No credentials served** *(PocketBase)* | `GET https://<domain>/.pocketbase/credentials.json` | 404 |\n\n> **Only WordPress (including WordPress + WooCommerce) has a `/cms` on the domain**, and only PocketBase\n> has `/api` and `/_/`, so the *Backend survived* check depends on the backend.\n> - **WordPress + WooCommerce:** also confirm the store survived the deploy —\n> `GET https://<domain>/cms/wp-json/wc/store/v1/products?per_page=1` → 200. There is nothing external to\n> link (no sales-channel step — that's Ecommerce only). **Checkout** stays owner-completed: when\n> `site.json → woocommerce.payment_enabled` is `false`, don't test `/checkout`; a catalog that serves 200\n> is a passing, complete deploy.\n> - **Ecommerce:** the backend is the **Hostinger Ecommerce store**, read over the external Storefront API\n> (`api-ecommerce.hostinger.com`) — nothing a deploy touches lives on this domain. There is no `/cms`;\n> confirm the storefront still fetches products as a frontend check if you like. **Only check that\n> checkout can be reached when `site.json → ecommerce.payment_enabled` is `true`** — on a free account\n> (`payment_enabled: false`) there is no checkout, so **skip that check entirely**; a catalog that serves\n> 200 is a passing, complete deploy. Never fail or hold the deploy because checkout is unavailable.\n> - **PocketBase** (`site.json → backend: \"pocketbase\"`): the backend lives on this domain at `/api`\n> and `/_`, so check both survived and that the credentials URL is a 404, then run\n> `node <skill>/steps/04-content-model/pocketbase/scripts/pb-verify.mjs ~/.hostinger/<domain>/.pocketbase/credentials.json ~/.hostinger/<domain>/pocketbase/schema.json`\n> and expect `READY` (its last check, the website serving the app, now passes). If `/api/health`\n> fails while the root serves the app, the app is answering `/api`: move its routes off that prefix\n> and redeploy. If the credentials URL returns anything but 404, rotate the superuser at once\n> (`hosting_pocketbase_set-superuser`, see `../03-provision/pocketbase/SKILL.md` Step 3) and\n> redeploy without the file.\n\nThe root check is already done when `wait.mjs build` returned `ok: true`; check the rest in one shell\ncommand (`curl` each URL). A `completed` build whose root 403s almost always means the build settings\nweren't passed to `hosting_deploy` (null settings) — pass them and redeploy. Caching can briefly serve a\nstale root; re-check after ~30 s.\n\n## Step 6 — Record `deploy.json`\n\n```json\n{\n \"build_uuid\": \"…\",\n \"stack\": \"nextjs\",\n \"rendering\": \"ssr\",\n \"app_type\": \"next\",\n \"output_directory\": \".next\",\n \"node_version\": 22,\n \"method\": \"hosting_deploy (type: nodejs, settings passed inline)\",\n \"deployed_at\": \"…\",\n \"verified_at\": \"…\",\n \"urls\": { \"live\": \"https://<domain>\", \"cms\": \"https://<domain>/cms\" },\n \"checks\": { \"root\": 200, \"ssr_headers\": true, \"backend_preserved\": true }\n}\n```\n\nNo secrets in `deploy.json`. The `urls.cms` field and the `backend_preserved` check above are\n**WordPress-only** — adjust the record to the backend:\n\n- **WordPress:** keep `urls.cms` and `checks.backend_preserved` as shown.\n- **WordPress + WooCommerce:** keep `urls.cms` + `checks.backend_preserved` (it *is* WordPress), and add\n `urls.store_api` from `site.json`; no external link step.\n- **Ecommerce:** omit `urls.cms`/`backend_preserved`; record the store URLs instead (`urls.storefront_api`,\n `urls.store_admin` from `site.json`) and link the custom sales channel to the live domain —\n `ecommerce_sales-channels_update { store_id, sales_channel_id, url }` (see the ecommerce provision step).\n- **PocketBase:** omit `urls.cms`; add `urls.api` and `urls.admin` from `site.json`,\n `checks.backend_preserved` (the `/api/health` and `/_/` checks) and `checks.pb_verify: \"READY\"`.\n\nUpdate `state.json` (`stage` → `done`), then continue to Step 9 (done).\n\n`hosting_deploy` on the local server is the only path: give its `path` a local **archive** (`zip`, `tar`,\n`tar.gz`, `tgz`, `7z`) written outside `~/.hostinger/` as in Step 2. There is no separate upload or\nbuild step to fall back to.\n"
439
439
  },
440
440
  {
441
441
  "uri": "skill://hostinger-headless/steps/09-done/SKILL.md",
442
- "digest": "sha256:9685204071f51c0dd146dd9db844f20a8c62ca58b1f644a011683744ced5e4e6",
443
- "size": 15617,
442
+ "digest": "sha256:10396463d13ee9b19e2aac6c193b32cc6d68240573e0fa0befaba2b46596bb1e",
443
+ "size": 15634,
444
444
  "mimeType": "text/markdown",
445
- "text": "---\nname: headless-step-done\ndescription: \"Step 9 (done) of the Hostinger Headless flow. Verifies the live site, then hands over the URLs (hPanel success page, main site, WordPress/store admin, dashboard), tells hPanel the build finished and opens the success page in the browser on a successful run, and gives a summary of what was built plus explicit next steps — how to log in to wp-admin and reset the password, how to manage content, and how to finish WooCommerce/store setup so it can take orders. Its final report format is also used whenever a run stops early.\"\n---\n\n# headless-step-done\n\nVerify the live site, then hand over the URLs (success page, main site, WordPress admin, dashboard), a\nsummary of what was built, and what the user can do next. **On a successful run, tell hPanel the build\nfinished and open the success page for the user** (see *Open the success page*).\n\n## Final report\n\nEvery run ends with this report, whether it finishes here or stops at an earlier stage (a dummy or\nmissing step, a failed provision, the user pausing). On a run that deployed this session, run the\nchecks in *Verify the live site* below first. Build the report from `state.json`, `site.json`,\n`deploy.json` and what you actually did and checked in this run. Report only what you verified. Don't\nclaim a stage passed if you didn't check it.\n\nWrite it in this order:\n\n1. **One-paragraph outcome.** What was created and on which domain (bold it). If the run stopped\n early, name the stage it stopped at, why, and what the user will see right now (e.g. \"the site\n root returns 403 until the frontend is deployed\").\n\n2. **Steps completed.** This table is required on every run, including early stops: never replace\n it with prose. Give one row per stage that ran, using the stage numbers and names from the\n orchestrator's flow table. Leave out stages that didn't run and name them in the outcome\n paragraph instead. A finished WordPress blog build looks like this:\n\n | Stage | Result |\n |---|---|\n | connect | Hostinger connector reached over MCP (`@hostinger/mcp` 1.9.2); signed in through the browser login. |\n | 1 check state | New build for `harbourlight.blog`; no earlier workspace. |\n | 2 refine | Personal travel blog about coastal towns in the UK; backend: WordPress. |\n | 3 provision | Business plan, order 41875230; setup took 6 min; domain, SSL and WordPress checks passed. |\n | 4 content model | 5 pages, 8 posts, 6 categories, 1 menu, 14 images (Hostinger AI), SEO titles on every page; counts re-read from the REST API. |\n | 5 design | \"Salt & Ink\" direction: serif headings, sea-blue accents; `design.md` and logo icon written. |\n | 6 frontend | Next.js SSR with home, blog, post, category and contact pages wired to the REST API; local build passed. |\n | 7 validate | Instance setup completed; REST API returned the 8 pushed posts; no preview (nobody signing off). |\n | 8 deploy | Source uploaded, build finished in 3 min; site root returns 200. |\n | 9 done | Main site, wp-admin and REST API re-checked live: all returned 200. |\n\n3. **Links** — every URL that exists at this point. Build the hPanel URLs from `site.json`\n (`order_id`, `username`, `domain`) and the onboarding slug; take the rest from `site.json` /\n `deploy.json`. Lead with the one the user cares about most — the **main site** — then the admin\n and dashboards. **Don't list the success page here:** it opens on its own (see *Open the success\n page*), so printing its URL in the report is just noise — the only exception is when a browser\n can't be opened (handled in that section):\n\n - **Main site (live):** `urls.site` (`https://<domain>`) — only once deployed.\n - **WordPress admin (one-click auto-login):** for a WordPress backend, **mint and hand over the\n auto-login redirect URL** — `wordpress_login_create-links { username, software: <site.json\n wordpress.install_id> }` returns a temporary link that logs the user straight into wp-admin. Give\n that URL as the admin link (it lands on `/cms/wp-admin`), so the user never needs a password.\n Alongside it, give the two ways back in that don't expire: the **login URL `{urls.wp_admin}`**\n (`https://<domain>/cms/wp-admin` — the headless WordPress lives under `/cms`), and the **WP Admin\n button in hPanel** (hPanel → the website → *WP Admin*). Note how to **reset the password**: on the\n `/cms/wp-admin` login screen use **\"Lost your password?\"**, and WordPress emails a reset link to the\n **WordPress admin email** (the address set at install, which the owner already has). Optionally, for\n more reliable delivery, they can create a mailbox on the domain (hPanel → *Emails*) and set it as the\n admin address in **wp-admin → Settings → General**.\n **Never print or store a password.** For a **WordPress + WooCommerce** store, this *same* wp-admin\n login is the store admin (wp-admin → WooCommerce → Products/Orders) — do **not** use the Ecommerce\n `store_admin` path; the store setup the owner still needs is spelled out under *Next steps*. For a\n Hostinger **Ecommerce** store, link the store admin from `urls.store_admin` instead.\n - **PocketBase dashboard** (a PocketBase backend): `urls.admin` (`https://<domain>/_/`). Give\n the owner the **login access** in three lines: the sign-in email (`site.json →\n pocketbase.superuser_email`, by default the website owner's email), the full path of the\n credentials file (`~/.hostinger/<domain>/.pocketbase/credentials.json`, which holds\n `superuser_email` and `superuser_password`), and one command to read it (`cat <that path>`).\n **Name the file, never paste the password**, and tell them to move both into their password\n manager, since Hostinger can't show the password again. Say that this is the owner's\n superuser login, not a member account: members sign up on the site and live in the `users`\n collection. A lost password is reset by asking the agent to rotate the superuser\n (`hosting_pocketbase_set-superuser`), which saves a new password to the same file.\n - **hPanel site dashboard:** `https://hpanel.hostinger.com/websites/<domain>` (the headless website\n is installed by now).\n - **Onboarding (resume):** `https://hpanel.hostinger.com/headless-onboarding/<order_id>/<username>/`\n - **REST API** (for developers): `urls.rest_api`, or `urls.api` on PocketBase.\n\n > URL shape note: `<username>` may be dropped from the onboarding/success URLs in a future hPanel\n > release. If a built URL 404s, retry the same path without the `/<username>` segment before\n > reporting it as broken.\n\n4. **Next steps** — what the user does now to actually use the site. Required on a successful run;\n tailor the bullets to the backend and keep them concrete. This is the hand-holding the hPanel\n success page can't give: don't just link wp-admin, tell them what to do once they're in.\n\n - **Manage content (WordPress):** in wp-admin (the one-click link, the `/cms/wp-admin` login URL, or\n hPanel → *WP Admin*) → **Posts**, **Pages**, **Media**, **Appearance → Menus**. Say how edits reach\n the live site for *this* build: an **SSR** frontend re-reads the REST API each request, so changes\n show up with no redeploy; an **SSG/static** build must be redeployed to pick up new content (read\n `state.json → frontend.rendering`).\n - **WordPress + WooCommerce — finish store setup so it can take orders.** The catalog and cart already\n work, but **checkout stays off until the owner configures it in wp-admin**: WooCommerce → Settings →\n **Payments** (enable at least one method) and → **Shipping** (add a zone with a rate), then confirm\n products/prices and place a test order. When `site.json → woocommerce.payment_enabled` is `false`,\n state plainly that this step is **required before any purchase works** — this is the gap owners hit.\n - **Hostinger Ecommerce store:** when `site.json → ecommerce.payment_enabled` is `false`, finish\n payment setup in the store admin (`urls.store_admin`) before the storefront can sell; otherwise it's\n ready to take orders.\n - **PocketBase:** manage the app from hPanel → the website (environment variables, deployments,\n logs). Say in plain words who can do what, one line per kind of data from\n `pocketbase/schema.json` (e.g. \"anyone can book a free place; only you can see who booked\"), and\n that everything visitors enter is in the dashboard (`/_/`) → *Collections*. Then the two things\n only the owner can set there: **Settings → Mail settings** (SMTP) before password-reset or\n verification emails can be sent — required when visitors have accounts — and **Settings →\n Backups**. Data changes show up live; a schema change needs no redeploy.\n\n5. **Where state lives** — the workspace path `~/.hostinger/<domain>/`, the `stage` that a\n resumed run will start from, and the build report `~/.hostinger/<domain>/report.html`.\n\n6. **Gaps / follow-ups** (only if any) — a short numbered list of anything skipped, approximated or\n left for the user (e.g. no images generated, default WordPress content left in place).\n\nNever include passwords, JWTs or other secrets in the report. For wp-admin access, give the URL and\noffer a one-click login link (`wordpress_login_create-links`), not credentials.\n\n## Verify the live site (brief)\n\nOn a run that deployed this session, re-confirm what you're about to hand over actually works (deploy\nalready checked this — this is a quick re-confirm, not a full re-run):\n\n- **Main site:** `GET https://<domain>/` → 200 (Next.js SSR: `x-powered-by: Next.js`; Astro SSG: static\n HTML with real content).\n- **WordPress admin:** `GET {urls.wp_admin}` → reachable (a login page, 200/302), not 404.\n- **Backend API:** `GET {urls.rest_api}/posts?per_page=1` → 200 (WordPress); for a **WooCommerce** store\n (`site.json → woocommerce.enabled`) also `GET {urls.store_api}/products?per_page=1` → 200; or the\n storefront API for the sales channel → 200 (Ecommerce); or `GET {urls.api}/health` → 200 and\n `GET {urls.admin}` → 200 (PocketBase).\n- **Contact form** (`site.json → contact_form.enabled`): validate already sent a test submission, so\n don't send another here. Hand it over as\n [`../04-content-model/wordpress/contact-form.md`](../04-content-model/wordpress/contact-form.md) §6 says.\n\nIf a check fails, say so in the outcome paragraph and don't claim the site is live.\n\n## Open the success page\n\nOn a **successful** run (the deploy succeeded and the live checks passed), open the success page in the\nuser's **main / system browser** right after presenting the report, so they land on the hPanel\ncelebration/next-steps screen for their new site. This is a side effect only — **don't print the\nsuccess URL in the report output** (it just opens); the one exception is the can't-open-a-browser\nfallback below. Build the URL with `<tool>` as the running tool's onboarding slug (see *State and\nartifacts* in the top-level `SKILL.md`).\n\n**Tell hPanel the build finished first.** Right before opening the success page, call\n`hosting_websites_trigger-event { \"username\": \"<username>\", \"domain\": \"<domain>\", \"event\": { \"name\": \"headless_onboarding.building.finished\", \"params\": { \"tool\": \"<slug>\" } } }`\nonce, with `username` from `site.json` and `<slug>` the onboarding slug. The call is required: when\nthe user still has the hPanel onboarding open, that tab moves to the success page on it. Send it on a\nsuccessful run only, and also when no browser can be opened (the fallback below). Skip the call when\nyour tool has no onboarding slug or `hosting_websites_trigger-event` isn't in your connector. Right\nbefore the call, tell the user in one line (e.g. \"Telling hPanel the build finished so your onboarding\nshows the success page.\"), so whoever reviews the outgoing call knows why it's made. If your own\nenvironment stopped the call before it reached Hostinger (a sandbox, command review, an approval\nprompt, or a network error in a sandboxed shell), try it one more time the way that environment\nallows, such as requesting approval or network access, then go on. Ignore any other failure, such as\na non-2xx response from Hostinger: no retry, nothing more said to the user, and open the success page\nas usual.\n\nThen open the success page:\n\n```bash\n# Build the URL first, then open it with the OS default (main) browser — not an embedded one.\n# <tool> = the onboarding slug\nURL=\"https://hpanel.hostinger.com/headless-onboarding/<order_id>/<username>/success/<domain>/<tool>\"\nopen \"$URL\" # macOS\n# xdg-open \"$URL\" # Linux\n# start \"\" \"$URL\" # Windows\n```\n\n- **Main browser only.** Use the OS opener above (`open` / `xdg-open` / `start`) so the page lands in\n Chrome, Safari, Edge, or whatever the user actually uses. **Do not** open it in an embedded or\n sandboxed browser (Cursor IDE browser / `cursor-ide-browser`, Playwright, Puppeteer, WebView, or\n any in-agent browser tab). Those stay inside the tool session and the user won't see the\n celebration page where they expect it.\n- Open it **once**, and only on a successful run — never on an early stop or a failed deploy.\n- If your tool can't open a browser (the command isn't available, or `open`/`xdg-open`/`start`\n fails), don't treat it as a failure and **don't fall back to an embedded browser**. This is the\n **one** case where you print the success URL — show it once in the report and tell the user to\n open it themselves in their main browser.\n\n## Build report\n\nRight after the final report, save the build report for this run. It turns the run log (stage times\nfrom `run-log.json`, events from `events.jsonl`) into `reports/<run>.json` and `.html`, and copies the\nHTML to `report.html` in the workspace:\n\n```bash\n# one shell command; one `event good` per thing that went well, if not logged yet\nnode <skill>/run-log.mjs <domain> event good '{\"text\":\"<something that went well>\"}' && \\\nnode <skill>/run-log.mjs <domain> stage-end done ok && \\\nnode <skill>/run-log.mjs <domain> report --outcome <live|stopped|failed> [--tokens '<json>']\n```\n\nThen send it to Hostinger as *Run log and build report* in the top-level `SKILL.md` says (for changes asked\nafter this report, see *Follow-ups continue the run* there), and tell the user in one line: \"Sent the build report to Hostinger to help improve\nthe flow.\" On a 422 say it's saved locally only; on any other failure say it'll be sent next session.\n\n- **Outcome:** `live` when the deploy succeeded this run, `failed` when a stage failed and you\n couldn't recover, `stopped` for everything else (the user paused, a dummy or missing step). Leave\n `--outcome` out and the script decides from the log.\n- **Before you write it,** check that every issue, correction and skill gap from this run is in\n `events.jsonl`. Log any that are missing now; the report only shows what was logged.\n- **After you write it,** read the `warning:` lines `report` prints. They list logging gaps: a stage\n that never ended, a start that was estimated, a stage logged with no duration, or (on a live build)\n a stage that was never logged. Fix what you can: `stage-end` an open stage, or correct a start with\n `stage-fix <stage> --started-ago <time>`, then run `report` again. What you can't fix stays in the report's\n *Logging gaps* section.\n- In the final report's *Where state lives*, add the path to `report.html` so the user can open it.\n\nDo this on every run, including the early stops: those reports are the most useful ones.\n"
445
+ "text": "---\nname: headless-step-done\ndescription: \"Step 9 (done) of the Hostinger Headless flow. Verifies the live site, then hands over the URLs (hPanel success page, main site, WordPress/store admin, dashboard), tells hPanel the build finished and opens the success page in the browser on a successful run, and gives a summary of what was built plus explicit next steps — how to log in to wp-admin and reset the password, how to manage content, and how to finish WooCommerce/store setup so it can take orders. Its final report format is also used whenever a run stops early.\"\n---\n\n# headless-step-done\n\nVerify the live site, then hand over the URLs (success page, main site, WordPress admin, dashboard), a\nsummary of what was built, and what the user can do next. **On a successful run, tell hPanel the build\nfinished and open the success page for the user** (see *Open the success page*).\n\n## Final report\n\nEvery run ends with this report, whether it finishes here or stops at an earlier stage (a dummy or\nmissing step, a failed provision, the user pausing). On a run that deployed this session, run the\nchecks in *Verify the live site* below first. Build the report from `state.json`, `site.json`,\n`deploy.json` and what you actually did and checked in this run. Report only what you verified. Don't\nclaim a stage passed if you didn't check it.\n\nWrite it in this order:\n\n1. **One-paragraph outcome.** What was created and on which domain (bold it). If the run stopped\n early, name the stage it stopped at, why, and what the user will see right now (e.g. \"the site\n root returns 403 until the frontend is deployed\").\n\n2. **Steps completed.** This table is required on every run, including early stops: never replace\n it with prose. Give one row per stage that ran, using the stage numbers and names from the\n orchestrator's flow table. Leave out stages that didn't run and name them in the outcome\n paragraph instead. A finished WordPress blog build looks like this:\n\n | Stage | Result |\n |---|---|\n | connect | Hostinger connector reached over MCP (`@hostinger/mcp` 1.9.2); signed in through the browser login. |\n | 1 check state | New build for `harbourlight.blog`; no earlier workspace. |\n | 2 refine | Personal travel blog about coastal towns in the UK; backend: WordPress. |\n | 3 provision | Business plan, order 41875230; setup took 6 min; domain, SSL and WordPress checks passed. |\n | 4 content model | 5 pages, 8 posts, 6 categories, 1 menu, 14 images (Hostinger AI), SEO titles on every page; counts re-read from the REST API. |\n | 5 design | \"Salt & Ink\" direction: serif headings, sea-blue accents; `design.md` and logo icon written. |\n | 6 frontend | Next.js SSR with home, blog, post, category and contact pages wired to the REST API; local build passed. |\n | 7 validate | Instance setup completed; REST API returned the 8 pushed posts; npm audit clean; no preview (nobody signing off). |\n | 8 deploy | Source uploaded, build finished in 3 min; site root returns 200. |\n | 9 done | Main site, wp-admin and REST API re-checked live: all returned 200. |\n\n3. **Links** — every URL that exists at this point. Build the hPanel URLs from `site.json`\n (`order_id`, `username`, `domain`) and the onboarding slug; take the rest from `site.json` /\n `deploy.json`. Lead with the one the user cares about most — the **main site** — then the admin\n and dashboards. **Don't list the success page here:** it opens on its own (see *Open the success\n page*), so printing its URL in the report is just noise — the only exception is when a browser\n can't be opened (handled in that section):\n\n - **Main site (live):** `urls.site` (`https://<domain>`) — only once deployed.\n - **WordPress admin (one-click auto-login):** for a WordPress backend, **mint and hand over the\n auto-login redirect URL** — `wordpress_login_create-links { username, software: <site.json\n wordpress.install_id> }` returns a temporary link that logs the user straight into wp-admin. Give\n that URL as the admin link (it lands on `/cms/wp-admin`), so the user never needs a password.\n Alongside it, give the two ways back in that don't expire: the **login URL `{urls.wp_admin}`**\n (`https://<domain>/cms/wp-admin` — the headless WordPress lives under `/cms`), and the **WP Admin\n button in hPanel** (hPanel → the website → *WP Admin*). Note how to **reset the password**: on the\n `/cms/wp-admin` login screen use **\"Lost your password?\"**, and WordPress emails a reset link to the\n **WordPress admin email** (the address set at install, which the owner already has). Optionally, for\n more reliable delivery, they can create a mailbox on the domain (hPanel → *Emails*) and set it as the\n admin address in **wp-admin → Settings → General**.\n **Never print or store a password.** For a **WordPress + WooCommerce** store, this *same* wp-admin\n login is the store admin (wp-admin → WooCommerce → Products/Orders) — do **not** use the Ecommerce\n `store_admin` path; the store setup the owner still needs is spelled out under *Next steps*. For a\n Hostinger **Ecommerce** store, link the store admin from `urls.store_admin` instead.\n - **PocketBase dashboard** (a PocketBase backend): `urls.admin` (`https://<domain>/_/`). Give\n the owner the **login access** in three lines: the sign-in email (`site.json →\n pocketbase.superuser_email`, by default the website owner's email), the full path of the\n credentials file (`~/.hostinger/<domain>/.pocketbase/credentials.json`, which holds\n `superuser_email` and `superuser_password`), and one command to read it (`cat <that path>`).\n **Name the file, never paste the password**, and tell them to move both into their password\n manager, since Hostinger can't show the password again. Say that this is the owner's\n superuser login, not a member account: members sign up on the site and live in the `users`\n collection. A lost password is reset by asking the agent to rotate the superuser\n (`hosting_pocketbase_set-superuser`), which saves a new password to the same file.\n - **hPanel site dashboard:** `https://hpanel.hostinger.com/websites/<domain>` (the headless website\n is installed by now).\n - **Onboarding (resume):** `https://hpanel.hostinger.com/headless-onboarding/<order_id>/<username>/`\n - **REST API** (for developers): `urls.rest_api`, or `urls.api` on PocketBase.\n\n > URL shape note: `<username>` may be dropped from the onboarding/success URLs in a future hPanel\n > release. If a built URL 404s, retry the same path without the `/<username>` segment before\n > reporting it as broken.\n\n4. **Next steps** — what the user does now to actually use the site. Required on a successful run;\n tailor the bullets to the backend and keep them concrete. This is the hand-holding the hPanel\n success page can't give: don't just link wp-admin, tell them what to do once they're in.\n\n - **Manage content (WordPress):** in wp-admin (the one-click link, the `/cms/wp-admin` login URL, or\n hPanel → *WP Admin*) → **Posts**, **Pages**, **Media**, **Appearance → Menus**. Say how edits reach\n the live site for *this* build: an **SSR** frontend re-reads the REST API each request, so changes\n show up with no redeploy; an **SSG/static** build must be redeployed to pick up new content (read\n `state.json → frontend.rendering`).\n - **WordPress + WooCommerce — finish store setup so it can take orders.** The catalog and cart already\n work, but **checkout stays off until the owner configures it in wp-admin**: WooCommerce → Settings →\n **Payments** (enable at least one method) and → **Shipping** (add a zone with a rate), then confirm\n products/prices and place a test order. When `site.json → woocommerce.payment_enabled` is `false`,\n state plainly that this step is **required before any purchase works** — this is the gap owners hit.\n - **Hostinger Ecommerce store:** when `site.json → ecommerce.payment_enabled` is `false`, finish\n payment setup in the store admin (`urls.store_admin`) before the storefront can sell; otherwise it's\n ready to take orders.\n - **PocketBase:** manage the app from hPanel → the website (environment variables, deployments,\n logs). Say in plain words who can do what, one line per kind of data from\n `pocketbase/schema.json` (e.g. \"anyone can book a free place; only you can see who booked\"), and\n that everything visitors enter is in the dashboard (`/_/`) → *Collections*. Then the two things\n only the owner can set there: **Settings → Mail settings** (SMTP) before password-reset or\n verification emails can be sent — required when visitors have accounts — and **Settings →\n Backups**. Data changes show up live; a schema change needs no redeploy.\n\n5. **Where state lives** — the workspace path `~/.hostinger/<domain>/`, the `stage` that a\n resumed run will start from, and the build report `~/.hostinger/<domain>/report.html`.\n\n6. **Gaps / follow-ups** (only if any) — a short numbered list of anything skipped, approximated or\n left for the user (e.g. no images generated, default WordPress content left in place).\n\nNever include passwords, JWTs or other secrets in the report. For wp-admin access, give the URL and\noffer a one-click login link (`wordpress_login_create-links`), not credentials.\n\n## Verify the live site (brief)\n\nOn a run that deployed this session, re-confirm what you're about to hand over actually works (deploy\nalready checked this — this is a quick re-confirm, not a full re-run):\n\n- **Main site:** `GET https://<domain>/` → 200 (Next.js SSR: `x-powered-by: Next.js`; Astro SSG: static\n HTML with real content).\n- **WordPress admin:** `GET {urls.wp_admin}` → reachable (a login page, 200/302), not 404.\n- **Backend API:** `GET {urls.rest_api}/posts?per_page=1` → 200 (WordPress); for a **WooCommerce** store\n (`site.json → woocommerce.enabled`) also `GET {urls.store_api}/products?per_page=1` → 200; or the\n storefront API for the sales channel → 200 (Ecommerce); or `GET {urls.api}/health` → 200 and\n `GET {urls.admin}` → 200 (PocketBase).\n- **Contact form** (`site.json → contact_form.enabled`): validate already sent a test submission, so\n don't send another here. Hand it over as\n [`../04-content-model/wordpress/contact-form.md`](../04-content-model/wordpress/contact-form.md) §6 says.\n\nIf a check fails, say so in the outcome paragraph and don't claim the site is live.\n\n## Open the success page\n\nOn a **successful** run (the deploy succeeded and the live checks passed), open the success page in the\nuser's **main / system browser** right after presenting the report, so they land on the hPanel\ncelebration/next-steps screen for their new site. This is a side effect only — **don't print the\nsuccess URL in the report output** (it just opens); the one exception is the can't-open-a-browser\nfallback below. Build the URL with `<tool>` as the running tool's onboarding slug (see *State and\nartifacts* in the top-level `SKILL.md`).\n\n**Tell hPanel the build finished first.** Right before opening the success page, call\n`hosting_websites_trigger-event { \"username\": \"<username>\", \"domain\": \"<domain>\", \"event\": { \"name\": \"headless_onboarding.building.finished\", \"params\": { \"tool\": \"<slug>\" } } }`\nonce, with `username` from `site.json` and `<slug>` the onboarding slug. The call is required: when\nthe user still has the hPanel onboarding open, that tab moves to the success page on it. Send it on a\nsuccessful run only, and also when no browser can be opened (the fallback below). Skip the call when\nyour tool has no onboarding slug or `hosting_websites_trigger-event` isn't in your connector. Right\nbefore the call, tell the user in one line (e.g. \"Telling hPanel the build finished so your onboarding\nshows the success page.\"), so whoever reviews the outgoing call knows why it's made. If your own\nenvironment stopped the call before it reached Hostinger (a sandbox, command review, an approval\nprompt, or a network error in a sandboxed shell), try it one more time the way that environment\nallows, such as requesting approval or network access, then go on. Ignore any other failure, such as\na non-2xx response from Hostinger: no retry, nothing more said to the user, and open the success page\nas usual.\n\nThen open the success page:\n\n```bash\n# Build the URL first, then open it with the OS default (main) browser — not an embedded one.\n# <tool> = the onboarding slug\nURL=\"https://hpanel.hostinger.com/headless-onboarding/<order_id>/<username>/success/<domain>/<tool>\"\nopen \"$URL\" # macOS\n# xdg-open \"$URL\" # Linux\n# start \"\" \"$URL\" # Windows\n```\n\n- **Main browser only.** Use the OS opener above (`open` / `xdg-open` / `start`) so the page lands in\n Chrome, Safari, Edge, or whatever the user actually uses. **Do not** open it in an embedded or\n sandboxed browser (Cursor IDE browser / `cursor-ide-browser`, Playwright, Puppeteer, WebView, or\n any in-agent browser tab). Those stay inside the tool session and the user won't see the\n celebration page where they expect it.\n- Open it **once**, and only on a successful run — never on an early stop or a failed deploy.\n- If your tool can't open a browser (the command isn't available, or `open`/`xdg-open`/`start`\n fails), don't treat it as a failure and **don't fall back to an embedded browser**. This is the\n **one** case where you print the success URL — show it once in the report and tell the user to\n open it themselves in their main browser.\n\n## Build report\n\nRight after the final report, save the build report for this run. It turns the run log (stage times\nfrom `run-log.json`, events from `events.jsonl`) into `reports/<run>.json` and `.html`, and copies the\nHTML to `report.html` in the workspace:\n\n```bash\n# one shell command; one `event good` per thing that went well, if not logged yet\nnode <skill>/run-log.mjs <domain> event good '{\"text\":\"<something that went well>\"}' && \\\nnode <skill>/run-log.mjs <domain> stage-end done ok && \\\nnode <skill>/run-log.mjs <domain> report --outcome <live|stopped|failed> [--tokens '<json>']\n```\n\nThen send it to Hostinger as *Run log and build report* in the top-level `SKILL.md` says (for changes asked\nafter this report, see *Follow-ups continue the run* there), and tell the user in one line: \"Sent the build report to Hostinger to help improve\nthe flow.\" On a 422 say it's saved locally only; on any other failure say it'll be sent next session.\n\n- **Outcome:** `live` when the deploy succeeded this run, `failed` when a stage failed and you\n couldn't recover, `stopped` for everything else (the user paused, a dummy or missing step). Leave\n `--outcome` out and the script decides from the log.\n- **Before you write it,** check that every issue, correction and skill gap from this run is in\n `events.jsonl`. Log any that are missing now; the report only shows what was logged.\n- **After you write it,** read the `warning:` lines `report` prints. They list logging gaps: a stage\n that never ended, a start that was estimated, a stage logged with no duration, or (on a live build)\n a stage that was never logged. Fix what you can: `stage-end` an open stage, or correct a start with\n `stage-fix <stage> --started-ago <time>`, then run `report` again. What you can't fix stays in the report's\n *Logging gaps* section.\n- In the final report's *Where state lives*, add the path to `report.html` so the user can open it.\n\nDo this on every run, including the early stops: those reports are the most useful ones.\n"
446
446
  },
447
447
  {
448
448
  "uri": "skill://hostinger-headless/wait.mjs",
@@ -501,10 +501,10 @@ const skills: Skill[] = [
501
501
  "resources": [
502
502
  {
503
503
  "uri": "skill://provision-vps/SKILL.md",
504
- "digest": "sha256:6127d3426a17e128945ffeec517b8989a1d613bc2e3ced090cf54a959d5edeee",
505
- "size": 8665,
504
+ "digest": "sha256:c51e19497fde835b79ce7b33a0116e2022a012fc5c7cbe1cc2da2a9112bb8ebd",
505
+ "size": 9086,
506
506
  "mimeType": "text/markdown",
507
- "text": "---\nname: provision-vps\ndescription: \"Set up a Hostinger VPS (KVM plans) or reinstall an existing one: picks the plan and billing term from the catalog, the location and the Linux template, buys only after the user explicitly agrees to the plan, price, renewal price and location, sets up a server waiting for setup, polls until it is running, adds the user's SSH key, applies a firewall and hands over a reachable root@ip. Triggers: create a new VPS, buy a server on Hostinger, which VPS plan should I get, set up a VPS with Ubuntu and Docker, my VPS says waiting for setup, reinstall my VPS, change the OS of my server, start over on a clean server.\"\n---\n\n# Provision a VPS\n\nFrom a need (\"a small server for n8n in Europe\") to a running server the agent can SSH into. Putting an app on it afterwards is `deploy-to-vps`; a server that is up but misbehaving is `troubleshoot-vps`.\n\n## Calling the operations\n\n- Read the `inputSchema` that `search` returns before the first call of each operation. If a name below is rejected as unknown, `search` for what the step does (e.g. \"list vps templates\").\n- Batch reads with `multi-execute`; values pass between steps as `$steps.<i>.<path>`. A batch stops at its first failure. The Hostinger Connector runs `vps` and `billing` as separate servers, so a batch chains operations from one of them only.\n- Purchase and reinstall need the user's explicit \"yes\" in the conversation, after you have shown what is described in step 2 or step 5. Never infer consent from the request itself.\n- Setup, reinstall and restart return an action (firewall sync answers `Request accepted` instead; check it with `vps_firewall_get`): poll `vps_actions_get` with its `id`, waiting longer between checks, until `state` is `success` or `error`, and `vps_virtual-machines_get` until `state` is `running` and `actions_lock` is `unlocked`. Setup usually finishes within minutes (control-panel templates take longer); a reinstall takes about 5–20 minutes. An action still `sent` after 12 hours is stuck — the user contacts Hostinger support.\n- Root `password`: Hostinger rejects passwords found in public leak databases. 12–50 characters, no spaces, at least one upper-case letter, one lower-case letter, one digit and one of `-().&@?'#,/;+`, using only latin letters, digits and those symbols. `panel_password` (control-panel templates only) allows only the symbols `#%+:?@`. Generate strong ones, give them to the user once, and never store them in the project.\n\n## 1. Reuse before buying\n\n`vps_virtual-machines_list`. A server in state `initial` is bought and waiting for setup (hPanel shows \"Waiting for setup\"): go to step 4 with it. A server the user wants wiped: step 5. Only when neither applies, buy.\n\n## 2. Choose plan, location and template\n\n- **Plan and price**: `billing_catalog_list` with `category: \"VPS\"`. Each item has `name` (KVM 1, KVM 2, KVM 4, KVM 8; the list also holds Game Panel 1–8, which are for game servers — offer them only when the user asks for one), `metadata` (`cpus`, `memory` and `disk_space` in MB, `bandwidth`) and `prices`: one entry per term with its own `id` — the `item_id` to buy — and `first_period_price` and `price` (the renewal price), both in cents. Prices differ by country and change with promotions; promotional prices apply to the first period only.\n- **Location**: `vps_data-centers_list` for `id`, `city`, `location` (country code) and `continent`. The location is fixed after setup: moving later is a reinstall in the new location that erases all data, backups and snapshots and changes the IP, and Hostinger does not promise it. Pick the location closest to the users; when the city they name is not listed, say which one you chose and why.\n- **Template**: `vps_templates_list`. Linux only; Windows is not offered. A plain OS when the agent will install things itself; an app template when the user named that app. The \"with Docker\" templates (Ubuntu 24.04 and 26.04) come with Docker installed. Whether a server gets the Docker Manager (`deploy-to-vps` 5a) does not follow the template name; check with `vps_docker_list` after setup. Control-panel templates (cPanel, Plesk, DirectAdmin and others) need a separately bought licence, which is non-refundable.\n- **Post-install script** (optional): `vps_post-install-scripts_list` to reuse one, or `vps_post-install-scripts_create` with `name` and `content` (max 48 KB; run once as root after install, output in `/post_install.log`). Keep secrets out of it; it is stored on the account.\n\nBefore buying, show the user: plan, term, first-period price and renewal price, location (fixed after setup), template, and that new purchases have a 30-day money-back guarantee (not for crypto payments; refunding cancels the server and its data). Wait for their \"yes\".\n\n## 3. Purchase\n\n`billing_payment-methods_list` first. An empty list means the account has no saved payment method and the purchase cannot go through the API: stop, and send the user to hPanel → VPS → Get VPS to buy there, then continue at step 1 with the new server. Otherwise `vps_virtual-machines_purchase` with `item_id` (the price `id` from step 2), optional `payment_method_id` and the `setup` fields from step 4. The default payment method is used when none is given.\n\nA `202 Accepted` means the payment is still being processed and the server was not set up: read the response's `status`, tell the user, and poll `vps_virtual-machines_list` for a new server in state `initial` before step 4. If setup fails for any reason, the user finishes it in hPanel; say which server and why. A just-bought server can take a moment to appear in the list.\n\n## 4. Set up a server in `initial` state\n\n`vps_virtual-machines_setup` with `template_id`, `data_center_id`, optional `post_install_script_id`, `hostname`, root `password`, `public_key: { name, key }` with the user's SSH public key, `enable_backups: true` (free weekly backups on every KVM plan; the first backup appears after a full 7-day cycle; daily backups are a paid add-on in hPanel), and `install_monarx: true` only when the user wants the malware scanner — its free agent detects but does not remove malware, and installing can take up to 60 minutes, during which the VPS accepts no other actions. Then poll until `running`.\n\n## 5. Reinstall an existing server\n\nOnly on the user's explicit request. Show first: the server, its current `template.name`, and what a reinstall does —\n\n- all data on the disk is erased, and the snapshot is deleted;\n- existing backups are kept, and a backup taken on the previous OS restores that OS;\n- the IP address may change;\n- SSH keys, hostname, reverse DNS, firewall group and Monarx after a reinstall are not documented — check each in step 6 and set them again where needed.\n\nOffer `vps_backups_list` so the user knows the last backup, and copy anything they want to keep off the server first (backups cannot be downloaded). After their \"yes\": `vps_virtual-machines_recreate` with `template_id`, optional `password`, `panel_password` and `post_install_script_id`, and poll.\n\n## 6. First login and hand-over\n\n1. `vps_virtual-machines_get`: `ipv4[0].address`, `hostname`, `state: running`.\n2. `vps_ssh-keys_list-virtual-machine`; add the user's key with `vps_ssh-keys_add-virtual-machine` if it is missing.\n3. `ssh -o StrictHostKeyChecking=accept-new root@IP 'tail -n 20 /post_install.log 2>/dev/null; uname -a'`.\n4. A Hostinger firewall group before anything is exposed: `vps_firewall_create`, accept rules for SSH, HTTP and HTTPS with `vps_firewall_create-rule`, then `vps_firewall_activate` for this server and, once it succeeds, `vps_firewall_sync-to-all-assigned-v-ms` (a new group reads `is_synced: false` until synced). `secure-vps` goes further.\n5. Reverse DNS when the server will send mail: `vps_ptr_create` with `ipAddressId` from `ipv4[0].id` and `domain`.\n\nHand over: `root@IP`, hostname, template, location, plan and renewal date, what the post-install script did, and the next step (`deploy-to-vps`). Write `.hostinger/vps.json` in the project when there is one: `{ \"virtual_machine_id\", \"ipv4\", \"hostname\" }`.\n\n## Not available through the API\n\n- Upgrading the plan — hPanel Upgrade: whole plan only, up to 10 minutes, files, IP and location stay; KVM 8 cannot be upgraded and no downgrade exists.\n- Changing location — hPanel Overview → VPS details → Server location → edit (erases data, backups and snapshots).\n- Moving a VPS to another Hostinger account — not supported.\n- Turning daily backups on, buying control-panel or Monarx removal licences, refunds — hPanel Billing.\n- Adding a payment method that is not already on the account.\n"
507
+ "text": "---\nname: provision-vps\ndescription: \"Set up a Hostinger VPS (KVM plans) or reinstall an existing one: picks the plan and billing term from the catalog, the location and the Linux template, buys only after the user explicitly agrees to the plan, price, renewal price and location, sets up a server waiting for setup, polls until it is running, adds the user's SSH key, applies a firewall and hands over a reachable root@ip. Triggers: create a new VPS, buy a server on Hostinger, which VPS plan should I get, set up a VPS with Ubuntu and Docker, my VPS says waiting for setup, reinstall my VPS, change the OS of my server, start over on a clean server.\"\n---\n\n# Provision a VPS\n\nFrom a need (\"a small server for n8n in Europe\") to a running server the agent can SSH into. Putting an app on it afterwards is `deploy-to-vps`; a server that is up but misbehaving is `troubleshoot-vps`.\n\n## Calling the operations\n\n- Read the `inputSchema` that `search` returns before the first call of each operation. If a name below is rejected as unknown, `search` for what the step does (e.g. \"list vps templates\").\n- Batch reads with `multi-execute`; values pass between steps as `$steps.<i>.<path>`. A batch stops at its first failure. The Hostinger Connector runs `vps` and `billing` as separate servers, so a batch chains operations from one of them only.\n- `Too Many Attempts` is the API rate limit: wait about a minute, then retry that call once, and send no other calls meanwhile. `[VPS:9999] Request failed` (HTTP 500) is usually temporary: retry a read once later. After a purchase, setup or reinstall fails with 500, do not resend it: the request may have gone through, so check `vps_virtual-machines_list` and `vps_actions_list` first, and tell the user what you found.\n- Purchase and reinstall need the user's explicit \"yes\" in the conversation, after you have shown what is described in step 2 or step 5. Never infer consent from the request itself.\n- Setup, reinstall and restart return an action (firewall sync answers `Request accepted` instead; check it with `vps_firewall_get`): poll `vps_actions_get` with its `id`, waiting longer between checks, until `state` is `success` or `error`, and `vps_virtual-machines_get` until `state` is `running` and `actions_lock` is `unlocked`. Setup usually finishes within minutes (control-panel templates take longer); a reinstall takes about 5–20 minutes. An action still `sent` after 12 hours is stuck — the user contacts Hostinger support.\n- Root `password`: Hostinger rejects passwords found in public leak databases. 12–50 characters, no spaces, at least one upper-case letter, one lower-case letter, one digit and one of `-().&@?'#,/;+`, using only latin letters, digits and those symbols. `panel_password` (control-panel templates only) allows only the symbols `#%+:?@`. Generate strong ones, give them to the user once, and never store them in the project.\n\n## 1. Reuse before buying\n\n`vps_virtual-machines_list`. A server in state `initial` is bought and waiting for setup (hPanel shows \"Waiting for setup\"): go to step 4 with it. A server the user wants wiped: step 5. Only when neither applies, buy.\n\n## 2. Choose plan, location and template\n\n- **Plan and price**: `billing_catalog_list` with `category: \"VPS\"`. Each item has `name` (KVM 1, KVM 2, KVM 4, KVM 8; the list also holds Game Panel 1–8, which are for game servers — offer them only when the user asks for one), `metadata` (`cpus`, `memory` and `disk_space` in MB, `bandwidth`) and `prices`: one entry per term with its own `id` — the `item_id` to buy — and `first_period_price` and `price` (the renewal price), both in cents. Prices differ by country and change with promotions; promotional prices apply to the first period only.\n- **Location**: `vps_data-centers_list` for `id`, `city`, `location` (country code) and `continent`. The location is fixed after setup: moving later is a reinstall in the new location that erases all data, backups and snapshots and changes the IP, and Hostinger does not promise it. Pick the location closest to the users; when the city they name is not listed, say which one you chose and why.\n- **Template**: `vps_templates_list`. Linux only; Windows is not offered. A plain OS when the agent will install things itself; an app template when the user named that app. The \"with Docker\" templates (Ubuntu 24.04 and 26.04) come with Docker installed. Whether a server gets the Docker Manager (`deploy-to-vps` 5a) does not follow the template name; check with `vps_docker_list` after setup. Control-panel templates (cPanel, Plesk, DirectAdmin and others) need a separately bought licence, which is non-refundable.\n- **Post-install script** (optional): `vps_post-install-scripts_list` to reuse one, or `vps_post-install-scripts_create` with `name` and `content` (max 48 KB; run once as root after install, output in `/post_install.log`). Keep secrets out of it; it is stored on the account.\n\nBefore buying, show the user: plan, term, first-period price and renewal price, location (fixed after setup), template, and that new purchases have a 30-day money-back guarantee (not for crypto payments; refunding cancels the server and its data). Wait for their \"yes\".\n\n## 3. Purchase\n\n`billing_payment-methods_list` first. An empty list means the account has no saved payment method and the purchase cannot go through the API: stop, and send the user to hPanel → VPS → Get VPS to buy there, then continue at step 1 with the new server. Otherwise `vps_virtual-machines_purchase` with `item_id` (the price `id` from step 2), optional `payment_method_id` and the `setup` fields from step 4. The default payment method is used when none is given.\n\nA `202 Accepted` means the payment is still being processed and the server was not set up: read the response's `status`, tell the user, and poll `vps_virtual-machines_list` for a new server in state `initial` before step 4. If setup fails for any reason, the user finishes it in hPanel; say which server and why. A just-bought server can take a moment to appear in the list.\n\n## 4. Set up a server in `initial` state\n\n`vps_virtual-machines_setup` with `template_id`, `data_center_id`, optional `post_install_script_id`, `hostname`, root `password`, `public_key: { name, key }` with the user's SSH public key, `enable_backups: true` (free weekly backups on every KVM plan; the first backup appears after a full 7-day cycle; daily backups are a paid add-on in hPanel), and `install_monarx: true` only when the user wants the malware scanner — its free agent detects but does not remove malware, and installing can take up to 60 minutes, during which the VPS accepts no other actions. Then poll until `running`.\n\n## 5. Reinstall an existing server\n\nOnly on the user's explicit request. Show first: the server, its current `template.name`, and what a reinstall does —\n\n- all data on the disk is erased, and the snapshot is deleted;\n- existing backups are kept, and a backup taken on the previous OS restores that OS;\n- the IP address may change;\n- SSH keys, hostname, reverse DNS, firewall group and Monarx after a reinstall are not documented — check each in step 6 and set them again where needed.\n\nOffer `vps_backups_list` so the user knows the last backup, and copy anything they want to keep off the server first (backups cannot be downloaded). After their \"yes\": `vps_virtual-machines_recreate` with `template_id`, optional `password`, `panel_password` and `post_install_script_id`, and poll.\n\n## 6. First login and hand-over\n\n1. `vps_virtual-machines_get`: `ipv4[0].address`, `hostname`, `state: running`.\n2. `vps_ssh-keys_list-virtual-machine`; add the user's key with `vps_ssh-keys_add-virtual-machine` if it is missing.\n3. `ssh -o StrictHostKeyChecking=accept-new root@IP 'tail -n 20 /post_install.log 2>/dev/null; uname -a'`.\n4. A Hostinger firewall group before anything is exposed: `vps_firewall_create`, accept rules for SSH, HTTP and HTTPS with `vps_firewall_create-rule`, then `vps_firewall_activate` for this server and, once it succeeds, `vps_firewall_sync-to-all-assigned-v-ms` (a new group reads `is_synced: false` until synced). `secure-vps` goes further.\n5. Reverse DNS when the server will send mail: `vps_ptr_create` with `ipAddressId` from `ipv4[0].id` and `domain`.\n\nHand over: `root@IP`, hostname, template, location, plan and renewal date, what the post-install script did, and the next step (`deploy-to-vps`). Write `.hostinger/vps.json` in the project when there is one: `{ \"virtual_machine_id\", \"ipv4\", \"hostname\" }`.\n\n## Not available through the API\n\n- Upgrading the plan — hPanel Upgrade: whole plan only, up to 10 minutes, files, IP and location stay; KVM 8 cannot be upgraded and no downgrade exists.\n- Changing location — hPanel Overview → VPS details → Server location → edit (erases data, backups and snapshots).\n- Moving a VPS to another Hostinger account — not supported.\n- Turning daily backups on, buying control-panel or Monarx removal licences, refunds — hPanel Billing.\n- Adding a payment method that is not already on the account.\n"
508
508
  }
509
509
  ]
510
510
  },
@@ -517,10 +517,10 @@ const skills: Skill[] = [
517
517
  "resources": [
518
518
  {
519
519
  "uri": "skill://secure-vps/SKILL.md",
520
- "digest": "sha256:1322e42ecae93903b477b66d2b9afa0f821e97779e4efc6b66c8492bba2cd4ad",
521
- "size": 9702,
520
+ "digest": "sha256:da1bd381afd8a7c2efecc06c49286c5daa01fe01ed22e8b1c272051916581a1a",
521
+ "size": 10593,
522
522
  "mimeType": "text/markdown",
523
- "text": "---\nname: secure-vps\ndescription: \"Harden a Hostinger VPS (KVM plans) to a baseline: a Hostinger firewall group that only opens the ports in use, SSH keys alongside or instead of password login, the Monarx malware scanner, and a check of the backup status and of the ports reachable from outside. Reads first, proposes each change with what it closes or removes, applies it only after the user agrees, and never locks the user out. Triggers: secure my VPS, lock down my server, harden my VPS, is my VPS safe, close open ports, set up a firewall on my server, disable password login, enable malware scanning, scan my server for malware, are my VPS backups on.\"\n---\n\n# Secure a VPS\n\nBaseline hardening for one server. Read and report first; each change is proposed with what it closes or removes and made only after the user agrees. The rule that matters most: never lock the user, or the agent, out of SSH. An account-wide review is `audit-vps`; a server that is already broken is `troubleshoot-vps`.\n\n## Calling the operations\n\n- Read the `inputSchema` that `search` returns before the first call of each operation. If a name below is rejected as unknown, `search` for what the step does (e.g. \"firewall rule\").\n- Only the public operations that `search` returns can be called. The backup schedule, the Monarx file list and the SSH and firewall resets live in hPanel; say where when a step needs them.\n- Batch reads with `multi-execute`; values pass between steps as `$steps.<i>.<path>`. A batch stops at its first failure.\n- A VPS runs one action at a time. Most changes return an action: poll `vps_actions_get`, waiting longer between checks, until `state` is `success` or `error`. Firewall sync and delete answer `Request accepted` instead; check the result with the matching read operation.\n- Confirm with the user before each of these, listing exactly what changes: `vps_firewall_activate` (closes every port without an accept rule), `vps_firewall_replace-all-rules-in-group`, `vps_firewall_delete-rule`, `vps_firewall_update-rule`, `vps_firewall_deactivate`, `vps_firewall_delete`, `vps_ssh-keys_remove-virtual-machine`, turning off password login, `vps_monarx_install` (locks the VPS for up to an hour), `vps_monarx_uninstall`, and `vps_snapshots_create` (replaces the snapshot).\n- SSH keys: `vps_ssh-keys_*`; the `vps_public-keys_*` operations are deprecated. Firewall sync: `vps_firewall_sync-to-all-assigned-v-ms`; `vps_firewall_sync` is deprecated.\n\n## 1. Find the server\n\n`vps_virtual-machines_list`; keep `id`, `ipv4[0].address`, `state` (must be `running`), `template.name` and `firewall_group_id`. `.hostinger/vps.json` in the project names the server from an earlier deploy.\n\n## 2. Read the current state (read-only)\n\nOne batch:\n\n- `vps_firewall_get` with `firewall_group_id`: rules (`protocol`, `port`, `source`, `source_detail`) and `is_synced`. `vps_firewall_list` and `vps_virtual-machines_list` show which other servers share the group.\n- `vps_ssh-keys_list-virtual-machine`: keys on `root`.\n- `vps_backups_list`: the newest backup. Backups are weekly by default; on the weekly schedule the first one appears after a full 7-day cycle (on daily, within a day). The API cannot show or change the schedule.\n- `vps_monarx_scan-metrics`, alone or last in the batch: `[VPS:2042] Monarx is not installed` means it is not installed, and the error stops the batch; otherwise it returns the `malicious` and `compromised` counts.\n\nFrom outside, which ports actually answer:\n\n```bash\nfor p in 21 22 25 80 443 3306 5432 6379 8080 9200 11211 27017; do nc -z -w 3 IP $p && echo \"open $p\"; done\n```\n\nRun the same loop against `192.0.2.1`, a reserved address with no server, first. Any port that answers there is faked by the local network (a VPN or proxy; 80, 443 and 8080 are common), so judge it with `curl` instead. On macOS add `-G 3` to `nc`; without it a port that drops traffic hangs for over a minute.\n\nOver SSH, what listens and how SSH is set up:\n\n```bash\nss -ltnp\nsshd -T | grep -Ei '^(permitrootlogin|passwordauthentication|pubkeyauthentication) '\nufw status 2>/dev/null | head -3\n```\n\n## 3. Report and propose\n\n```\nsrv123.hstgr.cloud (203.0.113.10) — Ubuntu 24.04\n- No Hostinger firewall group; 22, 80, 443 and 3306 (MySQL) answer from anywhere\n- Password login on, 1 SSH key on root\n- Monarx: not installed\n- Backups: last one 3 days ago (weekly)\n\nProposed:\n1. Firewall group \"web-srv123\": SSH 22, HTTP 80, HTTPS 443 from any; 3306 closed (only this server's app uses it)\n2. Turn off SSH password login (your key works — tested)\n3. Install Monarx (free, detects only; the VPS is locked for up to an hour while it installs)\n```\n\nEvery port that answers from outside must be either in the proposed rules or named as closing. Ask which services from `ss -ltnp` must stay reachable when it is not obvious. Wait for the user to agree, item by item if they prefer.\n\n## 4. Hostinger firewall\n\nAn active group drops all inbound traffic that no accept rule matches, on IPv4 and IPv6, and needs at least one rule. Each server has at most one active group. It applies before the guest firewall: a Hostinger drop wins over an accept in ufw or iptables, and rules in both places must agree.\n\n1. No group: `vps_firewall_create` (name like `web-<hostname>`), then `vps_firewall_create-rule` per port — `protocol: \"SSH\"` with `port: \"22\"`, `\"HTTP\"`/`\"80\"`, `\"HTTPS\"`/`\"443\"`, `\"TCP\"` with the app's port for anything else, `source: \"any\"` with `source_detail: \"any\"`, or `source: \"custom\"` with an IP or CIDR for admin ports. Then `vps_firewall_activate` with the group and the server, and once it succeeds, `vps_firewall_sync-to-all-assigned-v-ms`: a new group reads `is_synced: false` until it is synced, even though activation already applied its rules.\n2. Existing group: change only the agreed rules, or `vps_firewall_replace-all-rules-in-group` with the complete new set and `sync: true`. A shared group changes every server using it — say which.\n3. The SSH rule stays. Restrict it to the user's IP only when they ask, after confirming their current public IP; agent and laptop addresses change.\n4. `vps_firewall_sync-to-all-assigned-v-ms` after rule changes. It answers `Request accepted`, not an action; check `vps_firewall_get` until it shows `is_synced: true`. New connections follow the new rules within about two minutes; open connections are kept.\n5. Re-run the outside port check. Only the agreed ports may answer.\n\n## 5. SSH keys and password login\n\n1. No key yet: `vps_ssh-keys_add-virtual-machine` with `keys: [\"<contents of the .pub file>\"]`.\n2. Prove key login in a new connection: `ssh -o BatchMode=yes -o PasswordAuthentication=no root@IP true`. Do not continue until it works.\n3. With the user's agreement, keeping the current session open:\n\n```bash\nprintf 'PasswordAuthentication no\\nKbdInteractiveAuthentication no\\n' > /etc/ssh/sshd_config.d/10-hardening.conf\nsshd -t && (systemctl reload ssh 2>/dev/null || systemctl reload sshd)\nsshd -T | grep -Ei '^(passwordauthentication|kbdinteractiveauthentication) '\n```\n\nThe unit is `ssh` on Debian and Ubuntu and `sshd` on AlmaLinux, Rocky and CentOS. Both lines from `sshd -T` must say `no`. If either does not, this `sshd_config` does not read `sshd_config.d/` (older images such as CentOS 7 and AlmaLinux 8) or sets the option earlier: set both options in `/etc/ssh/sshd_config` itself, reload, and check again. Test key login again from a new connection; if it fails, undo the change and reload from the open session. Tell the user the way back if they are ever locked out: hPanel → Settings → Reset SSH configuration restores the default `sshd_config`, and the hPanel browser terminal works without SSH.\n\n4. Unknown keys in `vps_ssh-keys_list-virtual-machine`: name them and ask. Remove only the ones the user identifies: `vps_ssh-keys_remove-virtual-machine` with `keys: [\"<the full public key line>\"]` (the OpenSSH key text, not a name or id), then confirm with `vps_ssh-keys_list-virtual-machine`. If the key is still listed, delete its line from `/root/.ssh/authorized_keys` over SSH. List again after the next reboot — a removed key can come back from cloud-init.\n\n## 6. Malware scanning\n\n`vps_monarx_install` installs the free Monarx agent, which detects malware in files but does not remove it; automatic removal needs a paid licence bought in hPanel. Installing can take up to 60 minutes and the VPS accepts no other actions meanwhile — poll the action at long intervals, or tell the user it is installing and check later. Results and the list of infected files are in hPanel → Security → Malware Scanner; `vps_monarx_scan-metrics` gives only the counts. Propose cleaning only after the user has seen the file list.\n\n## 7. Backups and a checkpoint\n\n- Weekly backups are free on every KVM plan; daily backups are a paid add-on. Turning them on or off, or switching to daily, is hPanel → Snapshots & Backups → Manage schedule (or Overview → Edit backup schedule) — not available through the API. Backups are stored in a different data center, do not count against the disk, cannot be downloaded, and the two latest of each type are kept.\n- After the hardening is verified, offer `vps_snapshots_create` as a checkpoint. It replaces any existing snapshot and lasts one day — ask first.\n\n## Not available through the API\n\n- The backup schedule (weekly, daily, off) — hPanel.\n- The Monarx infected-file list and removal licence — hPanel.\n- Reset SSH configuration and Reset firewall configuration (the firewall inside the server: iptables, ufw) — hPanel → Settings → Main settings.\n- Anything inside the OS (sshd, services, the guest firewall) — SSH or the hPanel browser terminal.\n"
523
+ "text": "---\nname: secure-vps\ndescription: \"Harden a Hostinger VPS (KVM plans) to a baseline: a Hostinger firewall group that only opens the ports in use, SSH keys alongside or instead of password login, the Monarx malware scanner, and a check of the backup status and of the ports reachable from outside. Reads first, proposes each change with what it closes or removes, applies it only after the user agrees, and never locks the user out. Triggers: secure my VPS, lock down my server, harden my VPS, is my VPS safe, close open ports, set up a firewall on my server, disable password login, enable malware scanning, scan my server for malware, are my VPS backups on.\"\n---\n\n# Secure a VPS\n\nBaseline hardening for one server. Read and report first; each change is proposed with what it closes or removes and made only after the user agrees. The rule that matters most: never lock the user, or the agent, out of SSH. An account-wide review is `audit-vps`; a server that is already broken is `troubleshoot-vps`.\n\n## Calling the operations\n\n- Read the `inputSchema` that `search` returns before the first call of each operation. If a name below is rejected as unknown, `search` for what the step does (e.g. \"firewall rule\").\n- Only the public operations that `search` returns can be called. The backup schedule, the Monarx file list and the SSH and firewall resets live in hPanel; say where when a step needs them.\n- Batch reads with `multi-execute`; values pass between steps as `$steps.<i>.<path>`. A batch stops at its first failure.\n- `Too Many Attempts` is the API rate limit: wait about a minute, then retry that call once, and send no other calls meanwhile. `[VPS:9999] Request failed` (HTTP 500) is usually temporary: retry a read once later. Never resend a change that failed with 500 straight away: it may have gone through, so check the outcome with the matching read or `vps_actions_list` first, and tell the user what you found.\n- A VPS runs one action at a time. Most changes return an action: poll `vps_actions_get`, waiting longer between checks, until `state` is `success` or `error`. Firewall sync and delete answer `Request accepted` instead; check the result with the matching read operation.\n- Confirm with the user before each of these, listing exactly what changes: `vps_firewall_activate` (closes every port without an accept rule), `vps_firewall_replace-all-rules-in-group`, `vps_firewall_delete-rule`, `vps_firewall_update-rule`, `vps_firewall_deactivate`, `vps_firewall_delete`, `vps_ssh-keys_remove-virtual-machine`, turning off password login, `vps_monarx_install` (locks the VPS for up to an hour), `vps_monarx_uninstall`, and `vps_snapshots_create` (replaces the snapshot).\n- SSH keys: `vps_ssh-keys_*`; the `vps_public-keys_*` operations are deprecated. Firewall sync: `vps_firewall_sync-to-all-assigned-v-ms`; `vps_firewall_sync` is deprecated.\n\n## 1. Find the server\n\n`vps_virtual-machines_list`; keep `id`, `ipv4[0].address`, `state` (must be `running`), `template.name` and `firewall_group_id`. `.hostinger/vps.json` in the project names the server from an earlier deploy.\n\n## 2. Read the current state (read-only)\n\nOne batch:\n\n- `vps_firewall_get` with `firewall_group_id`: rules (`protocol`, `port`, `source`, `source_detail`) and `is_synced`. `vps_firewall_list` and `vps_virtual-machines_list` show which other servers share the group.\n- `vps_ssh-keys_list-virtual-machine`: keys on `root` added through Hostinger. Keys added on the server by hand do not appear, so an empty list does not prove password-only login. The SSH check below shows it.\n- `vps_backups_list`: the newest backup. Backups are weekly by default; on the weekly schedule the first one appears after a full 7-day cycle (on daily, within a day). The API cannot show or change the schedule.\n- `vps_monarx_scan-metrics`, alone or last in the batch: `[VPS:2042] Monarx is not installed` means it is not installed, and the error stops the batch; otherwise it returns the `malicious` and `compromised` counts.\n\nFrom outside, which ports actually answer:\n\n```bash\nnc -zv -w 3 IP 21; nc -zv -w 3 IP 22; nc -zv -w 3 IP 25; nc -zv -w 3 IP 80; nc -zv -w 3 IP 443; nc -zv -w 3 IP 3306\nnc -zv -w 3 IP 5432; nc -zv -w 3 IP 6379; nc -zv -w 3 IP 8080; nc -zv -w 3 IP 9200; nc -zv -w 3 IP 11211; nc -zv -w 3 IP 27017\n```\n\nRun each port as its own `nc`, with the IP written out: a loop or a shell variable makes Claude Code ask for approval every time, and macOS `nc` stops after the first port when given a list. Run the same commands against `192.0.2.1`, a reserved address with no server, first. Any port that answers there is faked by the local network (a VPN or proxy; 80, 443 and 8080 are common), so judge it with `curl` instead. On macOS add `-G 3` to `nc`; without it a port that drops traffic hangs for over a minute.\n\nOver SSH, what listens and how SSH is set up:\n\n```bash\nss -ltnp\nsshd -T | grep -Ei '^(permitrootlogin|passwordauthentication|pubkeyauthentication) '\nufw status 2>/dev/null | head -3\n```\n\n## 3. Report and propose\n\n```\nsrv123.hstgr.cloud (203.0.113.10) — Ubuntu 24.04\n- No Hostinger firewall group; 22, 80, 443 and 3306 (MySQL) answer from anywhere\n- Password login on, 1 SSH key on root\n- Monarx: not installed\n- Backups: last one 3 days ago (weekly)\n\nProposed:\n1. Firewall group \"web-srv123\": SSH 22, HTTP 80, HTTPS 443 from any; 3306 closed (only this server's app uses it)\n2. Turn off SSH password login (your key works — tested)\n3. Install Monarx (free, detects only; the VPS is locked for up to an hour while it installs)\n```\n\nEvery port that answers from outside must be either in the proposed rules or named as closing. Ask which services from `ss -ltnp` must stay reachable when it is not obvious. Wait for the user to agree, item by item if they prefer.\n\n## 4. Hostinger firewall\n\nAn active group drops all inbound traffic that no accept rule matches, on IPv4 and IPv6, and needs at least one rule. Each server has at most one active group. It applies before the guest firewall: a Hostinger drop wins over an accept in ufw or iptables, and rules in both places must agree.\n\n1. No group: `vps_firewall_create` (name like `web-<hostname>`), then `vps_firewall_create-rule` per port — `protocol: \"SSH\"` with `port: \"22\"`, `\"HTTP\"`/`\"80\"`, `\"HTTPS\"`/`\"443\"`, `\"TCP\"` with the app's port for anything else, `source: \"any\"` with `source_detail: \"any\"`, or `source: \"custom\"` with an IP or CIDR for admin ports. Then `vps_firewall_activate` with the group and the server, and once it succeeds, `vps_firewall_sync-to-all-assigned-v-ms`: a new group reads `is_synced: false` until it is synced, even though activation already applied its rules.\n2. Existing group: change only the agreed rules, or `vps_firewall_replace-all-rules-in-group` with the complete new set and `sync: true`. A shared group changes every server using it — say which.\n3. The SSH rule stays. Restrict it to the user's IP only when they ask, after confirming their current public IP; agent and laptop addresses change.\n4. `vps_firewall_sync-to-all-assigned-v-ms` after rule changes. It answers `Request accepted`, not an action; check `vps_firewall_get` until it shows `is_synced: true`. New connections follow the new rules within about two minutes; open connections are kept.\n5. Re-run the outside port check. Only the agreed ports may answer.\n\n## 5. SSH keys and password login\n\n1. No key yet: `vps_ssh-keys_add-virtual-machine` with `keys: [\"<contents of the .pub file>\"]`.\n2. Prove key login in a new connection: `ssh -o BatchMode=yes -o PasswordAuthentication=no root@IP true`. Do not continue until it works.\n3. With the user's agreement, keeping the current session open:\n\n```bash\nprintf 'PasswordAuthentication no\\nKbdInteractiveAuthentication no\\n' > /etc/ssh/sshd_config.d/10-hardening.conf\nsshd -t && (systemctl reload ssh 2>/dev/null || systemctl reload sshd)\nsshd -T | grep -Ei '^(passwordauthentication|kbdinteractiveauthentication) '\n```\n\nThe unit is `ssh` on Debian and Ubuntu and `sshd` on AlmaLinux, Rocky and CentOS. Both lines from `sshd -T` must say `no`. If either does not, this `sshd_config` does not read `sshd_config.d/` (older images such as CentOS 7 and AlmaLinux 8) or sets the option earlier: set both options in `/etc/ssh/sshd_config` itself, reload, and check again. Test key login again from a new connection; if it fails, undo the change and reload from the open session. Tell the user the way back if they are ever locked out: hPanel → Settings → Reset SSH configuration restores the default `sshd_config`, and the hPanel browser terminal works without SSH.\n\n4. Unknown keys in `vps_ssh-keys_list-virtual-machine`: name them and ask. Remove only the ones the user identifies: `vps_ssh-keys_remove-virtual-machine` with `keys: [\"<the full public key line>\"]` (the OpenSSH key text, not a name or id), then confirm with `vps_ssh-keys_list-virtual-machine`. If the key is still listed, delete its line from `/root/.ssh/authorized_keys` over SSH. List again after the next reboot — a removed key can come back from cloud-init.\n\n## 6. Malware scanning\n\n`vps_monarx_install` installs the free Monarx agent, which detects malware in files but does not remove it; automatic removal needs a paid licence bought in hPanel. Installing can take up to 60 minutes and the VPS accepts no other actions meanwhile — poll the action at long intervals, or tell the user it is installing and check later. Results and the list of infected files are in hPanel → Security → Malware Scanner; `vps_monarx_scan-metrics` gives only the counts. Propose cleaning only after the user has seen the file list.\n\n## 7. Backups and a checkpoint\n\n- Weekly backups are free on every KVM plan; daily backups are a paid add-on. Turning them on or off, or switching to daily, is hPanel → Snapshots & Backups → Manage schedule (or Overview → Edit backup schedule) — not available through the API. Backups are stored in a different data center, do not count against the disk, cannot be downloaded, and the two latest of each type are kept.\n- After the hardening is verified, offer `vps_snapshots_create` as a checkpoint. It replaces any existing snapshot and lasts one day — ask first.\n\n## Not available through the API\n\n- The backup schedule (weekly, daily, off) — hPanel.\n- The Monarx infected-file list and removal licence — hPanel.\n- Reset SSH configuration and Reset firewall configuration (the firewall inside the server: iptables, ufw) — hPanel → Settings → Main settings.\n- Anything inside the OS (sshd, services, the guest firewall) — SSH or the hPanel browser terminal.\n"
524
524
  }
525
525
  ]
526
526
  },
@@ -533,10 +533,10 @@ const skills: Skill[] = [
533
533
  "resources": [
534
534
  {
535
535
  "uri": "skill://troubleshoot-vps/SKILL.md",
536
- "digest": "sha256:7e29477e4a79cf52020ae2a928b417971b693a4358b77507adcd2f8feb4414b3",
537
- "size": 10625,
536
+ "digest": "sha256:18110e9b2072c54aa04ad9dfe40f1a37796d34f8e5c23584306b88dccdb8934d",
537
+ "size": 11030,
538
538
  "mimeType": "text/markdown",
539
- "text": "---\nname: troubleshoot-vps\ndescription: \"Diagnose and fix a Hostinger VPS (KVM plans) that is unreachable, down, slow, out of disk or running a broken service. Checks the server from outside, reads state, actions, metrics, firewall and Docker Manager logs through the Hostinger MCP, continues over SSH or the hPanel browser terminal, names the cause with evidence, and applies the fix once the user agrees; hPanel resets, emergency mode and restores are the last resorts. Triggers: my VPS is down, can't SSH into my server, connection refused, site on my VPS not loading, 502 from my server, server is slow, high CPU, CPU limited, disk full, docker container keeps restarting, my VPS is suspended, I lost my root password.\"\n---\n\n# Troubleshoot a VPS\n\nOne server and one symptom in; a named cause, the evidence for it, and a fix out. Stay read-only until the cause is stated and the user agrees to the fix. Deploying something new is `deploy-to-vps`; reinstalling is `provision-vps`.\n\n## Calling the operations\n\n- Read the `inputSchema` that `search` returns before the first call of each operation. If a name below is rejected as unknown, `search` for what the step does (e.g. \"virtual machine metrics\").\n- Only the public operations that `search` returns can be called. Several fixes exist only in hPanel or Hostinger Agent — resetting SSH or the guest firewall, removing a CPU limit, cleaning the disk, running commands without SSH. When the fix needs one, tell the user where it is in hPanel.\n- Batch reads with `multi-execute`; values pass between steps as `$steps.<i>.<path>`. A batch stops at its first failure. The Hostinger Connector runs `vps` and `dns` as separate servers.\n- A VPS runs one action at a time. Most changes return an action: poll `vps_actions_get`, waiting longer between checks, until `state` is `success` or `error` (`created`, `sent`, `delayed`, `started` are still running). Firewall sync and delete answer `Request accepted` instead; check the result with the matching read operation. Typical durations: start and stop up to 5 minutes, restart up to 10, emergency mode up to 20, a backup restore from 10 minutes to a few hours.\n- Confirm with the user before each of these, naming the server and what happens: `vps_virtual-machines_restart` and `vps_virtual-machines_stop` (downtime), `vps_virtual-machines_set-root-password`, `vps_recovery_start` and `vps_recovery_stop` (reboots), `vps_snapshots_restore` and `vps_backups_restore` (overwrite the disk), `vps_snapshots_create` (replaces the snapshot). A request to fix the server is not consent to any of them.\n\n## 1. Find the server and its state\n\n`vps_virtual-machines_list`; keep `id`, `ipv4[0].address`, `state`, `actions_lock`, `template.name`, `plan`, `memory` and `disk` (MB), `bandwidth` and `firewall_group_id`. Then `vps_actions_list`: a recent `error`, or a restore or reinstall the user did not mention, is often the whole story.\n\n| `state` | Meaning | Next |\n| --- | --- | --- |\n| `running` | the hypervisor sees it up | step 2 |\n| `stopped` | stopped from the dashboard, or by Hostinger after malware was found; data is kept | ask the user whether they stopped it; if not, check hPanel and email for a malware notice before `vps_virtual-machines_start` |\n| `suspended` | suspended for non-payment or abuse | non-payment: renew in hPanel (data kept for up to 21 days after expiry). Abuse: the suspension email gives the reason; fix it and reply to that email. Nothing the API can do |\n| `initial` | bought, waiting for setup | `provision-vps` |\n| `error` | the last operation failed | Hostinger support; the VPS stays locked until they act |\n| any other (`starting`, `stopping`, `restoring`, `recreating`, …) with `actions_lock: locked` | an action is running | wait and poll `vps_actions_list`. An action `sent` for 12 hours is stuck — Hostinger support |\n\nA server shown as `running` can still have an expired plan; `billing_subscriptions_list` tells.\n\n## 2. Look at it from outside\n\n```bash\nping -c 3 IP\nnc -zv -w 5 IP 22; nc -zv -w 5 IP 80; nc -zv -w 5 IP 443\ncurl -sS -o /dev/null -w \"%{http_code} ttfb=%{time_starttransfer}s\\n\" http://IP/\ndig +short A DOMAIN\n```\n\nBefore trusting `nc`, run it against `192.0.2.1`, a reserved address with no server. Any port that answers there is faked by the local network (a VPN or proxy; 80, 443 and 8080 are common), so judge those ports only by an HTTP answer from `curl`. On macOS add `-G 5` to `nc`; without it a port that drops traffic hangs for over a minute.\n\n- Every port closed, state `running` → firewall (step 3) or the guest OS (step 4 through the browser terminal).\n- Port 22 closed, 80/443 open → SSH rule missing (step 3), or sshd or the guest firewall (step 6).\n- Ports open, HTTP `502`/`503` → the app or proxy (step 4).\n- Slow → step 5.\n- `dig` returns another IP → DNS, not the server: `dns_records_list` and `deploy-to-vps` step 6.\n\n## 3. Hostinger firewall\n\n`firewall_group_id` set → `vps_firewall_get`. An active group drops all inbound traffic without an accept rule, on IPv4 and IPv6, and overrides any accept rule inside the OS. Check there is a rule for every port the user expects (an SSH rule restricted to an old IP is a classic cause) and that `is_synced` is true; `false` means changes are not pushed — `vps_firewall_sync-to-all-assigned-v-ms`, which answers `Request accepted`; confirm with `vps_firewall_get` showing `is_synced: true`. Missing rule → propose `vps_firewall_create-rule`, then sync. Changes reach new connections within about two minutes.\n\n## 4. Inside the server\n\n`ssh root@IP`, or the hPanel browser terminal (Web Console on the VPS Overview), which works without SSH. Collect before changing anything:\n\n```bash\nuptime; free -m; df -h /; df -i /\nsystemctl --failed\njournalctl -p err -n 50 --no-pager | grep -v 'sshd-session.*preauth'\nss -ltnp\ndocker ps -a 2>/dev/null\n```\n\nThe `grep` drops failed SSH logins from the internet, which are normal noise on a public server and would hide the real errors.\n\n| Evidence | Cause | Fix to propose |\n| --- | --- | --- |\n| `df -h /` near 100 % | disk full | find the growth (`du -xh / --max-depth=2 \\| sort -h \\| tail`, `journalctl --disk-usage`, `docker system df`) and remove what the user agrees to. If `/var/log` is what grew, hPanel → Settings → Main settings → Delete unnecessary logs clears it; the public API has no cleanup operation |\n| a service in `systemctl --failed`, error in its journal | the app crashed | the log line names it; fix config or env, then restart the service |\n| `Out of memory: Killed process` in the journal | memory exhaustion | fewer workers or containers, swap, or a plan upgrade |\n| a container `Restarting` | crash loop | `docker logs <name>`, or `vps_docker_logs` for a Docker Manager project |\n| nginx or the app not listening in `ss` | the service is down | `systemctl status <service>`, its journal, then restart |\n\nDocker Manager projects: `vps_docker_list` (`[VPS:2044]` means this server has no Docker Manager; availability does not follow the template name), `vps_docker_containers` for `status` and `health`, `vps_docker_logs` for the last 300 lines; `vps_docker_restart` after the log shows the cause.\n\n## 5. Slow server\n\n- `vps_virtual-machines_metrics` with `date_from`/`date_to` for the last 24 h: `cpu_usage` (%), `ram_usage` and `disk_space` (bytes, compare with `memory` and `disk` in MB), traffic and `uptime`. Over SSH, `top -bn1 | head -20` names the process.\n- **CPU limit.** Sustained high CPU makes Hostinger limit the VPS. The user sees \"resources limited due to CPU overuse\" in hPanel; inside the server it shows as steal time (`st` in `top`). The limit lifts on its own after CPU use drops, or the user can press \"Remove limitations\" in hPanel once every 7 days. Find and fix the process first, or the limit returns.\n- **Bandwidth.** Inbound plus outbound traffic over the plan's monthly `bandwidth` is throttled until the quota resets; it is not charged. Sum the month's traffic from the metrics to check.\n- A legitimately busy server needs a bigger plan — hPanel Upgrade.\n\n## 6. Locked out, or the server will not boot\n\nIn this order, each confirmed with the user first:\n\n1. **hPanel resets** (user, in hPanel → Settings): Reset SSH configuration restores the default `sshd_config` (port 22, standard authentication) and keeps passwords and keys; Reset firewall configuration is the documented way back when a firewall locked the user out — Hostinger's documents disagree on whether it resets the guest firewall (ufw, iptables, fail2ban bans) or the Hostinger firewall group, so tell the user to check the firewall rules afterwards. The API has neither.\n2. **Root password**: `vps_virtual-machines_set-root-password` (password rules as in `provision-vps`), then add a key with `vps_ssh-keys_add-virtual-machine`.\n3. **Restart**: `vps_virtual-machines_restart`; loses nothing on disk.\n4. **Emergency mode**: `vps_recovery_start` with a temporary `root_password` that applies only to the rescue system. The server boots a separate rescue system with the original disk mounted under `/mnt` (find the main partition with `lsblk`, e.g. `/mnt/sda1`; `chroot` into it to act as the server). SSH and the browser terminal work in it for up to 24 hours, but the Hostinger firewall may still block SSH — check step 3 first. Say what will change before changing files, then `vps_recovery_stop`.\n5. **Restore** — overwrites the whole disk, cannot be stopped or undone, and deletes the current snapshot:\n - `vps_snapshots_restore`: the single snapshot, kept for one day only (`vps_snapshots_get` for its `created_at`; 404 means none).\n - `vps_backups_restore` with a `backupId` from `vps_backups_list`: weekly by default, the two latest kept (plus two daily with the paid add-on). A backup taken on another OS brings that OS back.\n Name the date and everything that will be lost after it, and wait for the user's \"yes\".\n6. **Reinstall**: a clean OS, everything on the disk gone — only when the user asks; `provision-vps` step 5.\n\n## Apply the fix\n\nState the cause, the evidence and the single change proposed, and make it only after the user agrees. Re-run the step 2 checks to show the symptom is gone.\n\n## Not available through the API\n\n- Running commands without SSH, resetting SSH or the guest firewall, disk cleanup, removing a CPU limit — hPanel (Web Console, Settings, the CPU warning).\n- Lifting a suspension — renew, or answer the abuse email.\n- Downloading a backup — copy data off a running server with `rsync` or SFTP.\n- Restoring a backup onto a different server — not self-service.\n"
539
+ "text": "---\nname: troubleshoot-vps\ndescription: \"Diagnose and fix a Hostinger VPS (KVM plans) that is unreachable, down, slow, out of disk or running a broken service. Checks the server from outside, reads state, actions, metrics, firewall and Docker Manager logs through the Hostinger MCP, continues over SSH or the hPanel browser terminal, names the cause with evidence, and applies the fix once the user agrees; hPanel resets, emergency mode and restores are the last resorts. Triggers: my VPS is down, can't SSH into my server, connection refused, site on my VPS not loading, 502 from my server, server is slow, high CPU, CPU limited, disk full, docker container keeps restarting, my VPS is suspended, I lost my root password.\"\n---\n\n# Troubleshoot a VPS\n\nOne server and one symptom in; a named cause, the evidence for it, and a fix out. Stay read-only until the cause is stated and the user agrees to the fix. Deploying something new is `deploy-to-vps`; reinstalling is `provision-vps`.\n\n## Calling the operations\n\n- Read the `inputSchema` that `search` returns before the first call of each operation. If a name below is rejected as unknown, `search` for what the step does (e.g. \"virtual machine metrics\").\n- Only the public operations that `search` returns can be called. Several fixes exist only in hPanel or Hostinger Agent — resetting SSH or the guest firewall, removing a CPU limit, cleaning the disk, running commands without SSH. When the fix needs one, tell the user where it is in hPanel.\n- Batch reads with `multi-execute`; values pass between steps as `$steps.<i>.<path>`. A batch stops at its first failure. The Hostinger Connector runs `vps` and `dns` as separate servers.\n- `Too Many Attempts` is the API rate limit: wait about a minute, then retry that call once, and send no other calls meanwhile. `[VPS:9999] Request failed` (HTTP 500) is usually temporary: retry a read once later. Never resend a change that failed with 500 straight away: it may have gone through, so check the outcome with the matching read or `vps_actions_list` first, and tell the user what you found.\n- A VPS runs one action at a time. Most changes return an action: poll `vps_actions_get`, waiting longer between checks, until `state` is `success` or `error` (`created`, `sent`, `delayed`, `started` are still running). Firewall sync and delete answer `Request accepted` instead; check the result with the matching read operation. Typical durations: start and stop up to 5 minutes, restart up to 10, emergency mode up to 20, a backup restore from 10 minutes to a few hours.\n- Confirm with the user before each of these, naming the server and what happens: `vps_virtual-machines_restart` and `vps_virtual-machines_stop` (downtime), `vps_virtual-machines_set-root-password`, `vps_recovery_start` and `vps_recovery_stop` (reboots), `vps_snapshots_restore` and `vps_backups_restore` (overwrite the disk), `vps_snapshots_create` (replaces the snapshot). A request to fix the server is not consent to any of them.\n\n## 1. Find the server and its state\n\n`vps_virtual-machines_list`; keep `id`, `ipv4[0].address`, `state`, `actions_lock`, `template.name`, `plan`, `memory` and `disk` (MB), `bandwidth` and `firewall_group_id`. Then `vps_actions_list`: a recent `error`, or a restore or reinstall the user did not mention, is often the whole story.\n\n| `state` | Meaning | Next |\n| --- | --- | --- |\n| `running` | the hypervisor sees it up | step 2 |\n| `stopped` | stopped from the dashboard, or by Hostinger after malware was found; data is kept | ask the user whether they stopped it; if not, check hPanel and email for a malware notice before `vps_virtual-machines_start` |\n| `suspended` | suspended for non-payment or abuse | non-payment: renew in hPanel (data kept for up to 21 days after expiry). Abuse: the suspension email gives the reason; fix it and reply to that email. Nothing the API can do |\n| `initial` | bought, waiting for setup | `provision-vps` |\n| `error` | the last operation failed | Hostinger support; the VPS stays locked until they act |\n| any other (`starting`, `stopping`, `restoring`, `recreating`, …) with `actions_lock: locked` | an action is running | wait and poll `vps_actions_list`. An action `sent` for 12 hours is stuck — Hostinger support |\n\nA server shown as `running` can still have an expired plan; `billing_subscriptions_list` tells.\n\n## 2. Look at it from outside\n\n```bash\nping -c 3 IP\nnc -zv -w 5 IP 22; nc -zv -w 5 IP 80; nc -zv -w 5 IP 443\ncurl -sS -o /dev/null -w \"%{http_code} ttfb=%{time_starttransfer}s\\n\" http://IP/\ndig +short A DOMAIN\n```\n\nBefore trusting `nc`, run it against `192.0.2.1`, a reserved address with no server. Any port that answers there is faked by the local network (a VPN or proxy; 80, 443 and 8080 are common), so judge those ports only by an HTTP answer from `curl`. On macOS add `-G 5` to `nc`; without it a port that drops traffic hangs for over a minute.\n\n- Every port closed, state `running` → firewall (step 3) or the guest OS (step 4 through the browser terminal).\n- Port 22 closed, 80/443 open → SSH rule missing (step 3), or sshd or the guest firewall (step 6).\n- Ports open, HTTP `502`/`503` → the app or proxy (step 4).\n- Slow → step 5.\n- `dig` returns another IP → DNS, not the server: `dns_records_list` and `deploy-to-vps` step 6.\n\n## 3. Hostinger firewall\n\n`firewall_group_id` set → `vps_firewall_get`. An active group drops all inbound traffic without an accept rule, on IPv4 and IPv6, and overrides any accept rule inside the OS. Check there is a rule for every port the user expects (an SSH rule restricted to an old IP is a classic cause) and that `is_synced` is true; `false` means changes are not pushed — `vps_firewall_sync-to-all-assigned-v-ms`, which answers `Request accepted`; confirm with `vps_firewall_get` showing `is_synced: true`. Missing rule → propose `vps_firewall_create-rule`, then sync. Changes reach new connections within about two minutes.\n\n## 4. Inside the server\n\n`ssh root@IP`, or the hPanel browser terminal (Web Console on the VPS Overview), which works without SSH. Collect before changing anything:\n\n```bash\nuptime; free -m; df -h /; df -i /\nsystemctl --failed\njournalctl -p err -n 50 --no-pager | grep -v 'sshd-session.*preauth'\nss -ltnp\ndocker ps -a 2>/dev/null\n```\n\nThe `grep` drops failed SSH logins from the internet, which are normal noise on a public server and would hide the real errors.\n\n| Evidence | Cause | Fix to propose |\n| --- | --- | --- |\n| `df -h /` near 100 % | disk full | find the growth (`du -xh / --max-depth=2 \\| sort -h \\| tail`, `journalctl --disk-usage`, `docker system df`) and remove what the user agrees to. If `/var/log` is what grew, hPanel → Settings → Main settings → Delete unnecessary logs clears it; the public API has no cleanup operation |\n| a service in `systemctl --failed`, error in its journal | the app crashed | the log line names it; fix config or env, then restart the service |\n| `Out of memory: Killed process` in the journal | memory exhaustion | fewer workers or containers, swap, or a plan upgrade |\n| a container `Restarting` | crash loop | `docker logs <name>`, or `vps_docker_logs` for a Docker Manager project |\n| nginx or the app not listening in `ss` | the service is down | `systemctl status <service>`, its journal, then restart |\n\nDocker Manager projects: `vps_docker_list` (`[VPS:2044]` means this server has no Docker Manager; availability does not follow the template name), `vps_docker_containers` for `status` and `health`, `vps_docker_logs` for the last 300 lines; `vps_docker_restart` after the log shows the cause.\n\n## 5. Slow server\n\n- `vps_virtual-machines_metrics` with `date_from`/`date_to` for the last 24 h: `cpu_usage` (%), `ram_usage` and `disk_space` (bytes, compare with `memory` and `disk` in MB), traffic and `uptime`. Over SSH, `top -bn1 | head -20` names the process.\n- **CPU limit.** Sustained high CPU makes Hostinger limit the VPS. The user sees \"resources limited due to CPU overuse\" in hPanel; inside the server it shows as steal time (`st` in `top`). The limit lifts on its own after CPU use drops, or the user can press \"Remove limitations\" in hPanel once every 7 days. Find and fix the process first, or the limit returns.\n- **Bandwidth.** Inbound plus outbound traffic over the plan's monthly `bandwidth` is throttled until the quota resets; it is not charged. Sum the month's traffic from the metrics to check.\n- A legitimately busy server needs a bigger plan — hPanel Upgrade.\n\n## 6. Locked out, or the server will not boot\n\nIn this order, each confirmed with the user first:\n\n1. **hPanel resets** (user, in hPanel → Settings): Reset SSH configuration restores the default `sshd_config` (port 22, standard authentication) and keeps passwords and keys; Reset firewall configuration is the documented way back when a firewall locked the user out — Hostinger's documents disagree on whether it resets the guest firewall (ufw, iptables, fail2ban bans) or the Hostinger firewall group, so tell the user to check the firewall rules afterwards. The API has neither.\n2. **Root password**: `vps_virtual-machines_set-root-password` (password rules as in `provision-vps`), then add a key with `vps_ssh-keys_add-virtual-machine`.\n3. **Restart**: `vps_virtual-machines_restart`; loses nothing on disk.\n4. **Emergency mode**: `vps_recovery_start` with a temporary `root_password` that applies only to the rescue system. The server boots a separate rescue system with the original disk mounted under `/mnt` (find the main partition with `lsblk`, e.g. `/mnt/sda1`; `chroot` into it to act as the server). SSH and the browser terminal work in it for up to 24 hours, but the Hostinger firewall may still block SSH — check step 3 first. Say what will change before changing files, then `vps_recovery_stop`.\n5. **Restore** — overwrites the whole disk, cannot be stopped or undone, and deletes the current snapshot:\n - `vps_snapshots_restore`: the single snapshot, kept for one day only (`vps_snapshots_get` for its `created_at`; 404 means none).\n - `vps_backups_restore` with a `backupId` from `vps_backups_list`: weekly by default, the two latest kept (plus two daily with the paid add-on). A backup taken on another OS brings that OS back.\n Name the date and everything that will be lost after it, and wait for the user's \"yes\".\n6. **Reinstall**: a clean OS, everything on the disk gone — only when the user asks; `provision-vps` step 5.\n\n## Apply the fix\n\nState the cause, the evidence and the single change proposed, and make it only after the user agrees. Re-run the step 2 checks to show the symptom is gone.\n\n## Not available through the API\n\n- Running commands without SSH, resetting SSH or the guest firewall, disk cleanup, removing a CPU limit — hPanel (Web Console, Settings, the CPU warning).\n- Lifting a suspension — renew, or answer the abuse email.\n- Downloading a backup — copy data off a running server with `rsync` or SFTP.\n- Restoring a backup onto a different server — not self-service.\n"
540
540
  }
541
541
  ]
542
542
  },
@@ -4,4 +4,4 @@ import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/agency-hosting.js';
5
5
  import instructions from '../core/instructions.agency-hosting.js';
6
6
 
7
- startServer({ name: 'hostinger-agency-hosting-mcp', version: '4.11.0', tools, instructions });
7
+ startServer({ name: 'hostinger-agency-hosting-mcp', version: '4.12.1', tools, instructions });
@@ -4,4 +4,4 @@ import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/agency-hosting.js';
5
5
  import instructions from '../core/instructions.agency-hosting.js';
6
6
 
7
- startServer({ name: 'hostinger-agency-hosting-mcp', version: '4.11.0', tools, instructions });
7
+ startServer({ name: 'hostinger-agency-hosting-mcp', version: '4.12.1', tools, instructions });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/agent-readiness.js';
5
5
 
6
- startServer({ name: 'hostinger-agent-readiness-mcp', version: '4.11.0', tools });
6
+ startServer({ name: 'hostinger-agent-readiness-mcp', version: '4.12.1', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/agent-readiness.js';
5
5
 
6
- startServer({ name: 'hostinger-agent-readiness-mcp', version: '4.11.0', tools });
6
+ startServer({ name: 'hostinger-agent-readiness-mcp', version: '4.12.1', tools });
@@ -5,4 +5,4 @@ import tools from '../core/tools/all.js';
5
5
  import instructions from '../core/instructions.js';
6
6
  import skills from '../core/skills.js';
7
7
 
8
- startServer({ name: 'hostinger-api-mcp', version: '4.11.0', tools, instructions, skills });
8
+ startServer({ name: 'hostinger-api-mcp', version: '4.12.1', tools, instructions, skills });
@@ -5,4 +5,4 @@ import tools from '../core/tools/all.js';
5
5
  import instructions from '../core/instructions.js';
6
6
  import skills from '../core/skills.js';
7
7
 
8
- startServer({ name: 'hostinger-api-mcp', version: '4.11.0', tools, instructions, skills });
8
+ startServer({ name: 'hostinger-api-mcp', version: '4.12.1', tools, instructions, skills });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/billing.js';
5
5
 
6
- startServer({ name: 'hostinger-billing-mcp', version: '4.11.0', tools });
6
+ startServer({ name: 'hostinger-billing-mcp', version: '4.12.1', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/billing.js';
5
5
 
6
- startServer({ name: 'hostinger-billing-mcp', version: '4.11.0', tools });
6
+ startServer({ name: 'hostinger-billing-mcp', version: '4.12.1', tools });
@@ -3,4 +3,4 @@
3
3
  import { startServer } from '../core/runtime.js';
4
4
  import tools from '../core/tools/dns.js';
5
5
 
6
- startServer({ name: 'hostinger-dns-mcp', version: '4.11.0', tools });
6
+ startServer({ name: 'hostinger-dns-mcp', version: '4.12.1', tools });