{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "onboard_wireguard_user",
  "type": "object",
  "properties": {
    "interface": {
      "type": "string",
      "description": "Existing WireGuard SERVER interface, e.g. 'wg-server'"
    },
    "user": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._@-]{0,62}$",
      "description": "User/device label, e.g. 'alice-laptop'"
    },
    "address": {
      "description": "Tunnel IP for the client, e.g. '10.20.0.50'. Omit to take the lowest free one.",
      "type": "string"
    },
    "expires": {
      "description": "Last day the user may connect, e.g. '2026-12-31'",
      "type": "string"
    },
    "save": {
      "default": false,
      "description": "Write <user>.conf and a <user>.png QR code on the MCP host",
      "type": "boolean"
    },
    "email_to": {
      "description": "Email the profile to this address (needs the alert email channel)",
      "type": "string",
      "pattern": "^[^\\s<>@,;]+@[^\\s<>@,;]+$"
    },
    "endpoint": {
      "type": "string",
      "description": "Server public endpoint host:port, e.g. 'vpn.example.com:13231'"
    },
    "dns": {
      "description": "DNS for the client, e.g. '10.20.0.1'",
      "type": "string"
    },
    "allowed_ips": {
      "default": "0.0.0.0/0",
      "description": "Client AllowedIPs: '0.0.0.0/0' full-tunnel, or a LAN subnet for split-tunnel",
      "type": "string"
    },
    "keepalive": {
      "default": "25",
      "description": "PersistentKeepalive seconds",
      "type": "string"
    }
  },
  "required": ["interface", "user", "save", "endpoint", "allowed_ips", "keepalive"],
  "additionalProperties": false
}
