# 共享知识库 - 运维环境配置总览

更新时间：2026-05-17T13:47:47+0800

> 安全原则：本文档只记录连接方式、密钥变量名、密钥所在文件/系统位置，以及 present/missing 状态；不记录任何明文密钥、密码、token、cookie、AppSecret。

## 当前共享工作区

```text
NAS SMB share: root_for_ai
共享工作区目录: 00_共享区
共享知识库目录: 00_共享区/共享知识库
```

## 1. 本地电脑/设备

当前已知电脑为 **2 台**：

| 设备 | 地址/主机名 | 用户 | 用途 | 连接方式 |
|---|---|---|---|---|
| Mac mini | `192.168.1.10` / `bot1deMac-mini.local` | `bot1` | Hermes 本地机器人、知识库/RAG、本地自动化 | 当前机器；局域网 SSH |
| MacBook Pro | `192.168.1.7` / `qianliyun-mbpro` / `qianliyundeMacBook-Pro.local` | `qianliyun` | 用户主力电脑 | 从 bot1 可用 SSH host `qianliyun-mbpro` |

相关 SSH 配置：

```text
/Users/bot1/.ssh/config
Host qianliyun-mbpro
  HostName qianliyundeMacBook-Pro.local
  User qianliyun
  IdentityFile /Users/bot1/.ssh/id_ed25519_qianliyun_mbpro
```

NAS 不是电脑，但作为共享存储：

| 设备 | 地址 | SMB share | API |
|---|---|---|---|
| UGREEN NAS DXP4800-DAFC | `192.168.1.4` | `root_for_ai` | `https://192.168.1.4:9443` |

当前 NAS host 以实时挂载、环境变量和网络探测为准；本机当前挂载点为 `/Users/bot1/Volumes/root_for_ai`。

## 2. 云服务器连接方式

| 项 | 值 |
|---|---|
| SSH Host alias | `wwyl-cloud` |
| 公网 IP | `175.27.229.243` |
| SSH 用户 | `ubuntu` |
| SSH key | `/Users/bot1/.ssh/id_ed25519_wwyl_cloud` |
| 公开 HTTPS 域名 | `https://wwyl.yipeng.online/` |
| Cloud Hermes home | `/home/ubuntu/.hermes` |
| Cloud shared knowledge base | `/srv/shared-knowledge` |
| Cloud generated outputs | `/srv/agent-outputs` |

连接命令：

```bash
ssh wwyl-cloud
# 等价于：ssh -i /Users/bot1/.ssh/id_ed25519_wwyl_cloud ubuntu@175.27.229.243
```

用户-facing 外链优先使用：

```text
https://wwyl.yipeng.online/
```

不要把 `http://175.27.229.243/` 当成用户-facing 默认链接；它只作为运维/IP 兼容信息。

## 3. Key / Secret 应该写在哪里

### 3.1 本地 Hermes profile `.env` 密钥

Hermes profile-local key 统一写在各 profile 的 `.env`，权限应为 `600`。不要写入记忆、skill、Markdown 文档正文或 Git 仓库。

| profile | .env path | MX_AI_API_KEY | MX_AI_API_KEY_2 | MX_AI_API_KEYS | LIBTV_ACCESS_KEY | NAS_SMB_PASSWORD | OPENAI_API_KEY | OPENROUTER_API_KEY | FEISHU_APP_ID | FEISHU_APP_SECRET |
|---|---|---|---|---|---|---|---|---|---|---|
| `default` | `/Users/bot1/.hermes/.env` | present | present | present | present | missing | missing | missing | present | present |
| `designer1` | `/Users/bot1/.hermes/profiles/designer1/.env` | present | present | present | present | missing | missing | missing | present | present |
| `designer2` | `/Users/bot1/.hermes/profiles/designer2/.env` | present | present | present | present | missing | missing | missing | present | present |
| `designer3` | `/Users/bot1/.hermes/profiles/designer3/.env` | present | missing | missing | present | missing | missing | missing | present | present |
| `finance` | `/Users/bot1/.hermes/profiles/finance/.env` | present | missing | missing | present | missing | missing | missing | present | present |
| `it` | `/Users/bot1/.hermes/profiles/it/.env` | present | present | present | missing | missing | missing | missing | present | present |
| `legal` | `/Users/bot1/.hermes/profiles/legal/.env` | present | missing | missing | present | missing | missing | missing | present | present |
| `meow-chan` | `/Users/bot1/.hermes/profiles/meow-chan/.env` | present | missing | missing | present | missing | missing | missing | present | present |
| `obsidian-bone` | `/Users/bot1/.hermes/profiles/obsidian-bone/.env` | present | missing | missing | present | missing | missing | missing | present | present |
| `operations` | `/Users/bot1/.hermes/profiles/operations/.env` | present | missing | missing | present | missing | missing | missing | present | present |
| `queens-favorite` | `/Users/bot1/.hermes/profiles/queens-favorite/.env` | present | missing | missing | present | missing | missing | missing | present | present |
| `visual-operator` | `/Users/bot1/.hermes/profiles/visual-operator/.env` | present | missing | missing | present | missing | missing | missing | present | present |
| `wenshu` | `/Users/bot1/.hermes/profiles/wenshu/.env` | missing | missing | missing | missing | missing | missing | missing | present | present |

### 3.2 Hermes OpenAI Codex 登录凭证集中化

bot1 上多 profile 的 OpenAI Codex / ChatGPT OAuth 登录凭证已经集中到：

```text
/Users/bot1/.hermes/shared-auth/openai-codex-auth.json
```

当前已检查：`default`、`designer1`、`designer2`、`designer3`、`finance`、`it`、`legal`、`meow-chan`、`obsidian-bone`、`operations`、`queens-favorite`、`visual-operator`、`wenshu` 的 `auth.json` 都是指向该文件的 symlink。

维护规则：

- 新 profile 默认不要复制 `auth.json`；应把 profile 的 `auth.json` 链接到中心凭证文件。
- 中心目录 `/Users/bot1/.hermes/shared-auth` 权限应为 `700`，中心文件权限应为 `600`。
- 不要把 `auth.json` 内容写进 NAS、Markdown、Skill、Git、聊天或 memory。
- Feishu/Lark app secret 不在这个集中化范围内，仍然属于各 profile 自己的 `.env`。

详细操作见：`运维环境配置/Hermes多Profile凭证集中化.md`。

### 3.3 SSH key

| 用途 | 私钥路径 | 备注 |
|---|---|---|
| 云服务器 `wwyl-cloud` | `/Users/bot1/.ssh/id_ed25519_wwyl_cloud` | 连接 `ubuntu@175.27.229.243` |
| MacBook Pro | `/Users/bot1/.ssh/id_ed25519_qianliyun_mbpro` | Host alias `qianliyun-mbpro` |
| Gitee bot1 | `/Users/bot1/.ssh/id_ed25519_gitee_bot1` | Gitee Admin key |

### 3.4 云服务器上的 secret/env 位置

| 用途 | 位置 | 备注 |
|---|---|---|
| Cloud Hermes profiles | `/home/ubuntu/.hermes` 及对应 profile `.env` | 不打印 `.env` 值 |
| WeChat JSSDK | `/etc/wechat-jssdk.env` | AppID/AppSecret；禁止打印明文 |
| WeChat JSSDK cache | `/var/lib/wechat-jssdk/cache.json` | access_token/jsapi_ticket 缓存；禁止打印明文 |
| nginx TLS private key | `/etc/nginx/ssl/wwyl.yipeng.online/privkey.key` | 权限应严格控制 |

## 4. 生图 / 生视频插件 key 对应关系

| 插件/能力 | 环境变量名 | 应写入位置 | 备注 |
|---|---|---|---|
| mxai 图片/视频生成 | `MX_AI_API_KEY` | 需要使用 mxai 的 Hermes profile `.env` | 主 key |
| mxai 备用 key | `MX_AI_API_KEY_2` | 同上 | 备用线路/key |
| mxai 多 key 列表 | `MX_AI_API_KEYS` | 同上 | 多 key 轮换，逗号分隔；不在文档写明文 |
| libtv 视频/图片能力 | `LIBTV_ACCESS_KEY` | 需要使用 libtv 的 profile `.env` | 不在文档写明文 |

当前约定：bot1/root、it、designer1、designer2 等需要创作能力的 profile 本地 `.env` 已配置相关变量；实际以表格 present/missing 为准。

## 5. 本地知识库 / RAG

| 项 | 路径 |
|---|---|
| NAS 原始资料 | `00_共享区/共享知识库/原始资料/` |
| NAS 切片资料 | `00_共享区/共享知识库/切片资料/` |
| 本地 RAG 代码/模型/索引 | `/Users/bot1/Documents/knowledge-base` |
| 本地 RAG CLI | `/Users/bot1/Documents/knowledge-base/rag/shared-knowledge/rag-local` |

当前简化边界：NAS 放原始文件和切片后的资料；本地只跑 RAG 代码、模型、索引库和相关运行系统。不要把本地运行数据库、模型缓存、虚拟环境、日志、`.env`、token、`auth.json` 放回 NAS。

“如何把现在机子上的经验总结到 NAS”是单独流程，不混入当前 RAG 简化结构。详见 `运维环境配置/共享知识库RAG本地索引边界.md`。
