{
  "schemaVersion": "1.0",
  "item": {
    "slug": "failover-gateway-pub",
    "name": "Failover Gateway Pub",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/ember-claw/failover-gateway-pub",
    "canonicalUrl": "https://clawhub.ai/ember-claw/failover-gateway-pub",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/failover-gateway-pub",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=failover-gateway-pub",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/health-monitor.sh"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/failover-gateway-pub"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/failover-gateway-pub",
    "agentPageUrl": "https://openagent3.xyz/skills/failover-gateway-pub/agent",
    "manifestUrl": "https://openagent3.xyz/skills/failover-gateway-pub/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/failover-gateway-pub/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Failover Gateway for OpenClaw",
        "body": "Deploy a standby OpenClaw gateway that automatically takes over when your primary goes down. Active-passive design with auto-promotion and auto-demotion."
      },
      {
        "title": "What You Get",
        "body": "~30 second failover — health monitor detects primary down, promotes standby\nAuto-recovery — when primary comes back, standby demotes itself\nZero split-brain — primary and standby use different channels (no duplicate messages)\nGit-synced workspace — standby pulls latest workspace on promotion\n$12/month — runs on a minimal VPS"
      },
      {
        "title": "Architecture",
        "body": "PRIMARY (your main VPS)          STANDBY (failover VPS)\n├─ Full stack (all channels)     ├─ Single channel only (e.g., Discord DM)\n├─ All cron jobs                 ├─ No crons (recovery mode)\n├─ Gateway active ✅              ├─ Gateway stopped 💤\n└─ Pushes workspace to git       └─ Health monitor watches primary\n                                      │\n                                      ├─ Primary healthy → sleep\n                                      ├─ Primary down 30s → PROMOTE\n                                      └─ Primary back → DEMOTE\n\nThe key insight: split your channels between primary and standby. Don't share credentials — give each node exclusive ownership of different channels. This eliminates split-brain entirely."
      },
      {
        "title": "Channel Split Examples",
        "body": "SetupPrimaryStandbyRC + DiscordRocket.Chat (full)Discord DM onlyDiscord + TelegramDiscord (full)Telegram DM onlySlack + DiscordSlack (full)Discord DM only\n\nYour primary handles everything. The standby is minimal recovery — just enough to stay reachable."
      },
      {
        "title": "Prerequisites",
        "body": "Primary OpenClaw instance running on a VPS\nA second VPS for the standby ($6-12/mo, any provider)\nTailscale mesh network (or any VPN/private network)\nGit repository for workspace sync (GitHub, GitLab, etc.)\nA second messaging channel for the standby (different from primary)"
      },
      {
        "title": "Phase 1: Provision the Standby VPS",
        "body": "Any cheap VPS works. Recommended: 2GB RAM, Ubuntu 24.04.\n\n# Harden the box\nufw allow 22/tcp\nufw enable\napt install -y fail2ban unattended-upgrades\n\n# Create openclaw user\nadduser openclaw --disabled-password\nusermod -aG sudo openclaw\n# Copy your SSH key to openclaw user\n\n# Install Tailscale\ncurl -fsSL https://tailscale.com/install.sh | sh\ntailscale up --hostname=your-failover-name"
      },
      {
        "title": "Phase 2: Install OpenClaw",
        "body": "# As openclaw user\ncurl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\nsource ~/.bashrc\nnvm install --lts\nnpm install -g openclaw\n\n# Clone workspace\ngit clone <your-workspace-repo> ~/.openclaw/workspace"
      },
      {
        "title": "Phase 3: Failover Config",
        "body": "Create a minimal OpenClaw config on the standby. Only enable the standby channel:\n\n{\n  \"agents\": {\n    \"defaults\": {\n      \"model\": {\n        \"primary\": \"anthropic/claude-opus-4-6\",\n        \"fallbacks\": [\"anthropic/claude-sonnet-4-5\"]\n      },\n      \"workspace\": \"/home/openclaw/.openclaw/workspace\"\n    },\n    \"list\": [{ \"id\": \"main\", \"default\": true }]\n  },\n  \"channels\": {\n    \"discord\": {\n      \"enabled\": true,\n      \"token\": \"<YOUR_DISCORD_BOT_TOKEN>\",\n      \"dm\": {\n        \"policy\": \"allowlist\",\n        \"allowFrom\": [\"<YOUR_DISCORD_USER_ID>\"]\n      }\n    }\n  },\n  \"gateway\": {\n    \"port\": 18789,\n    \"mode\": \"local\",\n    \"bind\": \"tailnet\"\n  }\n}\n\nImportant: Disable this channel on your primary to avoid conflicts.\n\nTest it works: openclaw gateway run — verify the bot connects and responds, then stop it."
      },
      {
        "title": "Phase 4: Deploy Health Monitor",
        "body": "Copy the included scripts/health-monitor.sh to the standby:\n\nsudo cp health-monitor.sh /usr/local/bin/openclaw-health-monitor.sh\nsudo chmod +x /usr/local/bin/openclaw-health-monitor.sh\n\nEdit the variables at the top:\n\nPRIMARY_IP — your primary's Tailscale IP\nPRIMARY_PORT — your primary's gateway port (default: 18789)\nSECRETS_HOST — (optional) host to rsync secrets from on promotion\n\nCreate the systemd services:\n\n/etc/systemd/system/openclaw-health-monitor.service\n\n[Unit]\nDescription=OpenClaw Failover Health Monitor\nAfter=network-online.target tailscaled.service\nWants=network-online.target\n\n[Service]\nType=simple\nExecStart=/usr/local/bin/openclaw-health-monitor.sh\nRestart=always\nRestartSec=10\n\n[Install]\nWantedBy=multi-user.target\n\n/etc/systemd/system/openclaw.service\n\n[Unit]\nDescription=OpenClaw Gateway (Failover)\nAfter=network-online.target tailscaled.service\nWants=network-online.target\n\n[Service]\nType=simple\nUser=openclaw\nGroup=openclaw\nWorkingDirectory=/home/openclaw/.openclaw/workspace\nExecStart=/usr/bin/openclaw gateway run\nRestart=on-failure\nRestartSec=5\nEnvironment=HOME=/home/openclaw\nEnvironment=NODE_ENV=production\n\n[Install]\nWantedBy=multi-user.target\n\nEnable the monitor (but NOT the gateway — the monitor starts it on promotion):\n\nsudo systemctl daemon-reload\nsudo systemctl enable openclaw-health-monitor\nsudo systemctl start openclaw-health-monitor\n# Do NOT enable openclaw.service — the monitor controls it"
      },
      {
        "title": "Phase 5: Disable Standby Channel on Primary",
        "body": "This is critical. Remove or disable the standby's channel from your primary config:\n\n{\n  \"channels\": {\n    \"discord\": { \"enabled\": false }\n  }\n}\n\nEach node owns its channels exclusively. No sharing, no conflicts."
      },
      {
        "title": "Phase 6: Test",
        "body": "# On primary — simulate failure\nsudo systemctl stop openclaw-gateway  # or kill the process\n\n# Watch the standby logs\njournalctl -u openclaw-health-monitor -f\n\n# Expected: 3 failed checks → PROMOTE → gateway starts → standby channel live\n\n# On primary — recover\nsudo systemctl start openclaw-gateway\n\n# Expected: standby detects primary → DEMOTE → gateway stops"
      },
      {
        "title": "Failover Timeline",
        "body": "TimeEvent0sPrimary goes down10sFirst health check fails20sSecond check fails30sThird check fails → PROMOTE35sGit pull, secrets sync40sGateway starting45sStandby channel active~60sYou're reachable again"
      },
      {
        "title": "Edge Cases",
        "body": "ScenarioResultPrimary diesStandby promotes in ~30-60sPrimary + standby dieYou're offline (add a third node?)Network partitionStandby may promote while primary is still running — but since they use different channels, no conflictsStandby rebootsHealth monitor auto-restarts (systemd), resumes watchingPrimary flapsPromote/demote cycles — health monitor handles it, but consider increasing FAIL_THRESHOLD"
      },
      {
        "title": "Failback",
        "body": "Recovery is automatic. When the primary comes back:\n\nHealth monitor detects primary healthy\nStops the standby gateway\nPrimary resumes all channels\nStandby returns to watching\n\nNo manual intervention needed."
      },
      {
        "title": "Cost",
        "body": "ComponentCostVPS (2GB RAM)$6-12/moTailscaleFree (personal)Git repoFreeTotal$6-12/mo"
      },
      {
        "title": "Tips",
        "body": "Test monthly. Kill your primary, verify failover works. Trust but verify.\nKeep the standby minimal. No crons, no extra channels. It's recovery mode.\nGit push frequently. The standby's workspace is only as fresh as your last push.\nUse Tailscale. It makes cross-VPS networking trivial. No firewall rules, no port forwarding.\nDifferent bot tokens. If using Discord on both, you need two bot applications. Same bot token = last-connect-wins.\nMonitor the monitor. Check journalctl -u openclaw-health-monitor occasionally to make sure it's running."
      }
    ],
    "body": "Failover Gateway for OpenClaw\n\nDeploy a standby OpenClaw gateway that automatically takes over when your primary goes down. Active-passive design with auto-promotion and auto-demotion.\n\nWhat You Get\n~30 second failover — health monitor detects primary down, promotes standby\nAuto-recovery — when primary comes back, standby demotes itself\nZero split-brain — primary and standby use different channels (no duplicate messages)\nGit-synced workspace — standby pulls latest workspace on promotion\n$12/month — runs on a minimal VPS\nArchitecture\nPRIMARY (your main VPS)          STANDBY (failover VPS)\n├─ Full stack (all channels)     ├─ Single channel only (e.g., Discord DM)\n├─ All cron jobs                 ├─ No crons (recovery mode)\n├─ Gateway active ✅              ├─ Gateway stopped 💤\n└─ Pushes workspace to git       └─ Health monitor watches primary\n                                      │\n                                      ├─ Primary healthy → sleep\n                                      ├─ Primary down 30s → PROMOTE\n                                      └─ Primary back → DEMOTE\n\n\nThe key insight: split your channels between primary and standby. Don't share credentials — give each node exclusive ownership of different channels. This eliminates split-brain entirely.\n\nChannel Split Examples\nSetup\tPrimary\tStandby\nRC + Discord\tRocket.Chat (full)\tDiscord DM only\nDiscord + Telegram\tDiscord (full)\tTelegram DM only\nSlack + Discord\tSlack (full)\tDiscord DM only\n\nYour primary handles everything. The standby is minimal recovery — just enough to stay reachable.\n\nPrerequisites\nPrimary OpenClaw instance running on a VPS\nA second VPS for the standby ($6-12/mo, any provider)\nTailscale mesh network (or any VPN/private network)\nGit repository for workspace sync (GitHub, GitLab, etc.)\nA second messaging channel for the standby (different from primary)\nStep-by-Step Deployment\nPhase 1: Provision the Standby VPS\n\nAny cheap VPS works. Recommended: 2GB RAM, Ubuntu 24.04.\n\n# Harden the box\nufw allow 22/tcp\nufw enable\napt install -y fail2ban unattended-upgrades\n\n# Create openclaw user\nadduser openclaw --disabled-password\nusermod -aG sudo openclaw\n# Copy your SSH key to openclaw user\n\n# Install Tailscale\ncurl -fsSL https://tailscale.com/install.sh | sh\ntailscale up --hostname=your-failover-name\n\nPhase 2: Install OpenClaw\n# As openclaw user\ncurl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\nsource ~/.bashrc\nnvm install --lts\nnpm install -g openclaw\n\n# Clone workspace\ngit clone <your-workspace-repo> ~/.openclaw/workspace\n\nPhase 3: Failover Config\n\nCreate a minimal OpenClaw config on the standby. Only enable the standby channel:\n\n{\n  \"agents\": {\n    \"defaults\": {\n      \"model\": {\n        \"primary\": \"anthropic/claude-opus-4-6\",\n        \"fallbacks\": [\"anthropic/claude-sonnet-4-5\"]\n      },\n      \"workspace\": \"/home/openclaw/.openclaw/workspace\"\n    },\n    \"list\": [{ \"id\": \"main\", \"default\": true }]\n  },\n  \"channels\": {\n    \"discord\": {\n      \"enabled\": true,\n      \"token\": \"<YOUR_DISCORD_BOT_TOKEN>\",\n      \"dm\": {\n        \"policy\": \"allowlist\",\n        \"allowFrom\": [\"<YOUR_DISCORD_USER_ID>\"]\n      }\n    }\n  },\n  \"gateway\": {\n    \"port\": 18789,\n    \"mode\": \"local\",\n    \"bind\": \"tailnet\"\n  }\n}\n\n\nImportant: Disable this channel on your primary to avoid conflicts.\n\nTest it works: openclaw gateway run — verify the bot connects and responds, then stop it.\n\nPhase 4: Deploy Health Monitor\n\nCopy the included scripts/health-monitor.sh to the standby:\n\nsudo cp health-monitor.sh /usr/local/bin/openclaw-health-monitor.sh\nsudo chmod +x /usr/local/bin/openclaw-health-monitor.sh\n\n\nEdit the variables at the top:\n\nPRIMARY_IP — your primary's Tailscale IP\nPRIMARY_PORT — your primary's gateway port (default: 18789)\nSECRETS_HOST — (optional) host to rsync secrets from on promotion\n\nCreate the systemd services:\n\n/etc/systemd/system/openclaw-health-monitor.service\n\n[Unit]\nDescription=OpenClaw Failover Health Monitor\nAfter=network-online.target tailscaled.service\nWants=network-online.target\n\n[Service]\nType=simple\nExecStart=/usr/local/bin/openclaw-health-monitor.sh\nRestart=always\nRestartSec=10\n\n[Install]\nWantedBy=multi-user.target\n\n\n/etc/systemd/system/openclaw.service\n\n[Unit]\nDescription=OpenClaw Gateway (Failover)\nAfter=network-online.target tailscaled.service\nWants=network-online.target\n\n[Service]\nType=simple\nUser=openclaw\nGroup=openclaw\nWorkingDirectory=/home/openclaw/.openclaw/workspace\nExecStart=/usr/bin/openclaw gateway run\nRestart=on-failure\nRestartSec=5\nEnvironment=HOME=/home/openclaw\nEnvironment=NODE_ENV=production\n\n[Install]\nWantedBy=multi-user.target\n\n\nEnable the monitor (but NOT the gateway — the monitor starts it on promotion):\n\nsudo systemctl daemon-reload\nsudo systemctl enable openclaw-health-monitor\nsudo systemctl start openclaw-health-monitor\n# Do NOT enable openclaw.service — the monitor controls it\n\nPhase 5: Disable Standby Channel on Primary\n\nThis is critical. Remove or disable the standby's channel from your primary config:\n\n{\n  \"channels\": {\n    \"discord\": { \"enabled\": false }\n  }\n}\n\n\nEach node owns its channels exclusively. No sharing, no conflicts.\n\nPhase 6: Test\n# On primary — simulate failure\nsudo systemctl stop openclaw-gateway  # or kill the process\n\n# Watch the standby logs\njournalctl -u openclaw-health-monitor -f\n\n# Expected: 3 failed checks → PROMOTE → gateway starts → standby channel live\n\n# On primary — recover\nsudo systemctl start openclaw-gateway\n\n# Expected: standby detects primary → DEMOTE → gateway stops\n\nFailover Timeline\nTime\tEvent\n0s\tPrimary goes down\n10s\tFirst health check fails\n20s\tSecond check fails\n30s\tThird check fails → PROMOTE\n35s\tGit pull, secrets sync\n40s\tGateway starting\n45s\tStandby channel active\n~60s\tYou're reachable again\nEdge Cases\nScenario\tResult\nPrimary dies\tStandby promotes in ~30-60s\nPrimary + standby die\tYou're offline (add a third node?)\nNetwork partition\tStandby may promote while primary is still running — but since they use different channels, no conflicts\nStandby reboots\tHealth monitor auto-restarts (systemd), resumes watching\nPrimary flaps\tPromote/demote cycles — health monitor handles it, but consider increasing FAIL_THRESHOLD\nFailback\n\nRecovery is automatic. When the primary comes back:\n\nHealth monitor detects primary healthy\nStops the standby gateway\nPrimary resumes all channels\nStandby returns to watching\n\nNo manual intervention needed.\n\nCost\nComponent\tCost\nVPS (2GB RAM)\t$6-12/mo\nTailscale\tFree (personal)\nGit repo\tFree\nTotal\t$6-12/mo\nTips\nTest monthly. Kill your primary, verify failover works. Trust but verify.\nKeep the standby minimal. No crons, no extra channels. It's recovery mode.\nGit push frequently. The standby's workspace is only as fresh as your last push.\nUse Tailscale. It makes cross-VPS networking trivial. No firewall rules, no port forwarding.\nDifferent bot tokens. If using Discord on both, you need two bot applications. Same bot token = last-connect-wins.\nMonitor the monitor. Check journalctl -u openclaw-health-monitor occasionally to make sure it's running."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/ember-claw/failover-gateway-pub",
    "publisherUrl": "https://clawhub.ai/ember-claw/failover-gateway-pub",
    "owner": "ember-claw",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/failover-gateway-pub",
    "downloadUrl": "https://openagent3.xyz/downloads/failover-gateway-pub",
    "agentUrl": "https://openagent3.xyz/skills/failover-gateway-pub/agent",
    "manifestUrl": "https://openagent3.xyz/skills/failover-gateway-pub/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/failover-gateway-pub/agent.md"
  }
}