Get the installer for a key via:
/dev/null. They won’t slow your shell startup or hang your boot if the mantis server is unreachable.
Example: alert me on every SSH login
Web-embed snippets (CSS / JS)
In addition to host-event installers, the same/install endpoint generates two web-embed snippets you can paste into your own website:
\6c for l, etc.) so the canary URL is less obvious to a casual reader of the stylesheet — browsers parse it identically.
The JS snippet sends explicit ?l=<location>&r=<referrer> query params alongside the canary URL so you can identify the cloning site even when the Referer header is stripped (strict referrer policies, mixed-protocol downgrades, etc.).
Physical snippets (NFC)
The/install endpoint also generates an NFC URL record:
?src=nfc, which the trigger endpoint promotes into host_context.source = "nfc"
when the tag is tapped. The printable nfc-label PDF is a QR/sticker
companion for the same key; it only fires when scanned or tapped, not when the
PDF itself is opened.
Smart-home snippets (Home Assistant / Scrypted)
The/install endpoint also generates smart-home snippets:
--profile on the install command to decide which server the generated
snippet reports to. The snippet stores a literal URL, so changing the CLI’s
current profile later does not affect already-installed Home Assistant or
Scrypted automations.
Drive an action when a hit fires
The snippets above let Home Assistant trigger a mantis. The reverse also works: ahome_assistant notification destination lets a hit drive HA — flip a
switch, cut a VLAN, fire a scene, or push a phone notification. Point it at an HA
webhook automation:
mantis.hit JSON payload (memo, IP, user-agent, and the
full host_context) to that webhook. The target URL must end in
/api/webhook/<id>. To scaffold the HA side, generate a ready-to-paste
automation skeleton — it listens on the webhook, drops the activation ping, and
shows example actions (switch toggle, mobile push, logbook entry):
ALLOW_PRIVATE_WEBHOOKS=1 (an instance-wide switch — prefer
restricting egress at the network layer).
For devices that do not expose useful webhooks, iot-helper/ can watch LAN neighbor tables and log files, then fire the same Mantis URL for unexpected online/login events.
What information each installer captures
Each installer sendsX-Mantis-* headers alongside the hit, which the server parses into a structured host_context object exposed on the API + dashboard + CLI.
(Boot-time installers don’t include
X-Mantis-User because no user is logged in yet.)
The big win is $SSH_CLIENT — when someone SSHes into your machine and the shell snippet fires, the mantis records the SSH client’s IP, not just the machine’s own public IP. The dashboard surfaces this prominently as ← <client-ip> next to the user/host context. The CLI shows the same: