从零到上线 · 一份搞定
我们用纯静态 HTML + Nginx 部署网站,不用任何框架、不依赖 Node.js、不需要构建步骤。
| 类别 | 工具 | 用途 |
|---|---|---|
| Web 服务器 | Nginx | 伺服静态文件、SSL 终端 |
| SSL 证书 | Certbot (Let's Encrypt) | 免费 HTTPS |
| DNS | Namecheap | 域名解析 |
| 前端 | 原生 HTML/CSS/JS | 页面结构和交互 |
| 数据更新 | Cron + JSON | 定时生成数据文件 |
| 金融数据 | 免费 API | CoinGecko、汇率等 |
| AI 助手 | Hermes Agent | 自动生成内容和报告 |
apt-get install -y nginx systemctl start nginx && systemctl enable nginx # 开放防火墙 ufw allow 80/tcp ufw allow 443/tcp ufw reload
/var/www/ ├── html/ # 主站 luis.amt.land │ ├── index.html │ ├── market.html │ └── market-data.json └── 3.luis.amt.land/ # 子站 ├── index.html ├── research.html └── research-data.json
# /etc/nginx/sites-available/default server { listen 80; server_name _; root /var/www/html; index index.html; # JSON 不缓存(数据动态更新) location ~ \.json$ { add_header Cache-Control "no-cache"; add_header Access-Control-Allow-Origin "*"; } # 静态资源缓存 7 天 location ~* \.(js|css|png|jpg|svg|woff2?)$ { expires 7d; } location / { try_files $uri $uri/ =404; } }
# /etc/nginx/sites-available/3.luis.amt.land server { listen 80; server_name 3.luis.amt.land; root /var/www/3.luis.amt.land; index index.html; location / { try_files $uri $uri/ =404; } } # 启用配置 ln -sf /etc/nginx/sites-available/3.luis.amt.land /etc/nginx/sites-enabled/ nginx -t && systemctl reload nginx
apt-get install -y certbot python3-certbot-nginx # 申请证书(自动修改 nginx 配置 + HTTP→HTTPS 重定向) certbot --nginx -d luis.amt.land -d 3.luis.amt.land \ --non-interactive --agree-tos --email admin@amt.land --redirect # 验证 certbot certificates certbot renew --dry-run
| Type | Host | Value | 说明 |
|---|---|---|---|
| A | @ | 服务器 IP | 主域名 |
| A | 3 | 服务器 IP | 子域名 |
每个站点有独立风格,但都遵循:
| 站点 | 风格 | 主色 |
|---|---|---|
| luis.amt.land | 深色金融风 | #0f0f23 深蓝黑 |
| 3.luis.amt.land | 粉色泡泡风 | #FFB5C2 粉 + #E8D5F5 薰衣草 |
<!DOCTYPE html>
<html lang="zh-Hant">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>页面标题</title>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700" rel="stylesheet">
<style>
:root {
/* 在这里定义你的配色 */
--primary: #FFB5C2;
--bg: #FFF8F0;
--text: #4A3F5C;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'Noto Sans TC', sans-serif;
color: var(--text);
background: var(--bg);
line-height: 1.9;
}
/* 卡片通用样式 */
.card {
background: white; border-radius: 20px;
padding: 24px; margin: 16px 0;
box-shadow: 0 2px 16px rgba(0,0,0,0.04);
}
</style>
</head>
<body>
<div class="card">
<h1>你好世界</h1>
</div>
</body>
</html>
我们有现成的专业设计系统,可以直接套用:
| 场景 | 推荐模板 |
|---|---|
| 金融/科技 | Stripe、Coinbase、Revolut、Kraken |
| 简洁高端 | Apple、Vercel、Linear |
| 内容/文档 | Notion、Mintlify、Sanity |
| 暗色主题 | Cursor、Sentry、Supabase |
| 活泼友好 | Figma、PostHog、Zapier、Miro |
不用每次改 HTML 来更新内容。用 JSON 文件存数据,前端 JS 动态渲染:
// research-data.json
{
"last_updated": "2026-04-15T07:30:00+08:00",
"reports": [
{
"date": "2026-04-15",
"title": "投资者情绪与市场行为分析",
"summary": "今日 Fear & Greed 指数偏高...",
"sections": [...]
}
]
}
fetch('research-data.json?t=' + Date.now()) .then(r => r.json()) .then(data => { // 渲染到页面 data.reports.forEach(r => { document.body.innerHTML += `<div class="card"> <h2>${r.title}</h2> <p>${r.summary}</p> </div>`; }); });
?t=时间戳 防止浏览器缓存,确保每次拿到最新数据。| 数据 | API | 免费 |
|---|---|---|
| 加密货币价格 | CoinGecko | ✅ 免费 |
| 汇率 | open.er-api.com | ✅ 免费 |
| Fear & Greed | alternative.me | ✅ 免费 |
| 美股实时 | Yahoo Finance | ⚠️ 受限 |
# 每天早上 8 点和晚上 9 点更新市场数据 0 0,13 * * * /root/.hermes/scripts/market-update.sh # 每晚 23:30(SGT)运行心理学研究 30 15 * * * /root/.hermes/scripts/nightly-research.sh
时区注意:服务器用 UTC,新加坡 = UTC+8。所以 SGT 23:30 = UTC 15:30。
我们用 Hermes Agent 的 cron 系统实现全自动内容生产:
/var/www/ 目录新站点上线前,逐项检查:
| # | 检查项 | 命令/方法 |
|---|---|---|
| 1 | HTML 语法正确 | 浏览器打开检查无报错 |
| 2 | 移动端适配 | Chrome DevTools → 手机模拟 |
| 3 | Nginx 配置有效 | nginx -t |
| 4 | HTTP 可访问 | curl http://域名 |
| 5 | HTTPS 证书正常 | certbot certificates |
| 6 | 443 端口开放 | ufw status |
| 7 | DNS 解析正确 | dig 域名 |
| 8 | JSON API 正常 | 浏览器访问 /data.json |
ufw allow 443/tcp && ufw reloaddig 域名 检查)?t=时间戳 参数/etc/nginx/sites-available/子域名 并 symlink 到 sites-enabled经典英文散文 · AI 发音示范(ElevenLabs)· 录音对比 · 智能评分
8篇精选名著片段:Emerson、Shakespeare、Austen、Orwell 等。先听 AI 标准朗读,再自己录音,系统自动评分发音、流畅度、语速和节奏。
本指南默认你已完成基础安装与配置。我们将直接进入进阶核心:记忆系统、技能自进化、多 Agent 协作、生产化部署与高级调试。
很多人用了 Hermes 一段时间后最大的抱怨就是:"它根本记不住东西"。这通常不是 Bug,而是没有搞清楚它的记忆机制。
Hermes 的记忆系统是内置记忆 + 外部记忆提供商 + 运行时上下文的组合:
| 层级 | 文件 | 用途 | 限制 |
|---|---|---|---|
| 第一层:内置 | MEMORY.md | 工作笔记、环境事实、技巧 | 2,200 字符硬限 |
| 第一层:内置 | USER.md | 用户画像、偏好、风格 | 1,375 字符硬限 |
| 第二层:外部 | Mem0 / Holographic | 长期记忆自动同步 | 可选叠加 |
Hermes 的内置记忆是Agent 策展(Agent-curated)的,不是全量记录:
| 文件 | 路径 | 内容 | 谁维护 |
|---|---|---|---|
| MEMORY.md | ~/.hermes/memories/ | 工作笔记、环境事实 | Agent |
| USER.md | ~/.hermes/memories/ | 用户画像、偏好 | Agent |
| SOUL.md | ~/.hermes/ | 人格、行为准则 | 你自己 |
| AGENTS.md | 项目根目录 | 项目级规范 | 你自己 |
在 config.yaml 中调整记忆反思频率:
memory: nudge_interval: 5 # 每5轮触发一次记忆整理
3~5 起步5~10 起步10~15 左右当 MEMORY.md 中多次记录类似工作流时 → 应该沉淀为 Skill:
记忆解决"记得住",技能解决"用得高效且可复用"。
# 在对话中引导 "我们刚才完成的这个数据处理流程很有价值, 请保存为 Skill,名字叫 data-pipeline, 放在 devops 分类下,确保包含触发条件、 操作步骤、注意事项和验证方法。"
| 标准 | 说明 |
|---|---|
| 触发条件清晰 | Agent 能准确判断什么时候该用它 |
| 步骤可执行 | 每一步都有明确操作,不是空泛描述 |
| 有验证方法 | 执行完后能判断是否成功 |
| 有注意事项 | 记录了踩过的坑 |
# 在对话中引导主 Agent 派生子任务 "这个任务可以并行处理: 子任务 A:抓取 A 股今日涨停板数据 子任务 B:分析北向资金流向 子任务 C:生成市场情绪指数 请派生 3 个子 Agent 并行完成,然后汇总结果。"
# 创建独立 Profile hermes profile create mybot hermes profile create work --clone # 复用配置,独立记忆 hermes profile create backup --clone-all # 完整克隆
# 方式一:Systemd(推荐) hermes gateway install systemctl status hermes-gateway journalctl -u hermes-gateway -f # 方式二:Docker Compose version: "3.8" services: hermes: image: nousresearch/hermes-agent:latest restart: unless-stopped command: gateway run volumes: - ~/.hermes:/opt/data
timedatectl 确认。# 确认时区 timedatectl # 如果不对,修改 sudo timedatectl set-timezone Asia/Shanghai # 添加定时任务 hermes cron add "30 8 * * 1-5" "生成今日A股日报" # 手动测试 hermes cron run 任务名称
hermes doctor 无明显报错.env 中GATEWAY_HEARTBEAT=true# 安装 MCP Filesystem Server npm install -g @modelcontextprotocol/server-filesystem # 在 mcp.json 中配置 { "mcpServers": { "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"] } } }
hermes doctor # 全面健康检查 hermes memory status # 检查记忆系统 hermes mcp status # 检查 MCP 连接 hermes debug share # 生成脱敏调试报告
hermes cron list 确认状态 2) 检查 Gateway 是否运行 3) timedatectl 检查时区 4) 手动 hermes cron run 测试approvals.mode 为 smart 或 off,或加入白名单。agent: max_turns: 90 memory: nudge_interval: 10 provider: mem0 approvals: mode: smart terminal: backend: docker timeout: 60
# 核心 API Key OPENAI_API_KEY=sk-xxx ANTHROPIC_API_KEY=sk-ant-xxx # Gateway 配置 GATEWAY_PORT=8080 GATEWAY_HEARTBEAT=true # 平台接入 TELEGRAM_BOT_TOKEN=123456:ABC-DEF TELEGRAM_ALLOWED_USERS=123456789
hermes doctor 和官方文档为准。