Other Advanced Markdown

Self-Healing Home Server - 自愈家庭服务器

让 OpenClaw 成为具有 SSH 访问和自动 cron 作业的基础设施 Agent,检测、诊断和修复问题。

openclawai-agentsinfrastructurehome-serverautomation

Self-Healing Home Server

让 OpenClaw 成为持久化基础设施 Agent,具有 SSH 访问、自动 cron 作业,以及在问题发生前检测、诊断和修复问题的能力。

解决什么问题

运行家庭服务器意味着 24/7 随时待命。凌晨 3 点服务宕机、证书静默过期、磁盘满了 — 而你正在睡觉。

功能特点

  • 自动化健康监控:基于 cron 的服务、部署和系统资源检查
  • 自愈:通过健康检查检测问题并自主应用修复
  • 基础设施管理:编写和应用 Terraform、Ansible、Kubernetes manifests
  • 每日简报:系统健康、日历、天气和任务板状态
  • 邮件分类:扫描收件箱,标记可操作项目
  • 安全审计:定期扫描硬编码密钥、特权容器

如何设置

第一步:配置 Agent

## Infrastructure Agent

You are Reef, an infrastructure management agent.

Access:
- SSH to all machines on the home network (192.168.1.0/24)
- kubectl for the K3s cluster
- 1Password vault (read-only for credentials)
- Gmail via gog CLI

Rules:
- NEVER hardcode secrets — always use 1Password CLI
- NEVER push directly to main — always create a PR
- Log all infrastructure changes to ~/logs/infra-changes.md

第二步:自动化 Cron 作业

Every 15 minutes: Check kanban board for in-progress tasks
Every hour: Monitor health checks, triage Gmail
Every 6 hours: Knowledge base data entry, self health check
Daily 8 AM: Morning briefing (weather, calendars, system stats)

⚠️ 安全关键

  • AI 会硬编码密钥 — 使用预提交 hooks 扫描
  • Local-first Git — 不要让 Agent 直接推送到公共仓库

成本估算

组件成本
家庭服务器$0-500(一次性)
云服务(可选)$5-20/月