Files
beaver_project/app-instance
steven_li ebfa242862 feat(outlook): 添加Outlook集成功能支持
添加完整的Outlook MCP集成,包括邮件和日历功能,通过AuthZ模式进行认证和权限管理,
支持邮箱连接、断开、状态检查和数据同步等功能。

fix(config): 统一配置文件路径从.nanobot到.beaver

将配置文件路径从/root/.nanobot统一更改为/root/.beaver,更新Dockerfile中的环境变量定义,
确保所有组件使用一致的配置目录结构。

feat(agent): 添加代理删除功能和助手身份提示

为代理注册表添加delete_agent方法,实现代理的动态删除功能;同时添加海狸助手身份提示,
确保AI助手在交互中保持一致的身份认知。

feat(engine): 增强引擎循环并添加意图决策快照

扩展AgentLoop类,添加intent_agent_decision参数用于意图驱动的代理决策,并在会话中记录
决策快照,便于后续分析和调试。

feat(authz): 扩展认证客户端功能

为AuthzClient添加设置权限、用户注册、后端注册和Outlook设置管理等新方法,增强系统
的认证和授权能力。
2026-05-14 16:01:46 +08:00
..
2026-03-18 14:22:00 +08:00
2026-03-13 16:40:08 +08:00
2026-03-13 16:40:08 +08:00
2026-03-13 16:40:08 +08:00
2026-03-13 16:40:08 +08:00

app-instance

单实例应用单元:

  • 一个 Docker 容器里同时运行前端、后端和 Nginx 反代
  • 前端走 /
  • 后端 API 走 /api
  • WebSocket 走 /ws

关键文件

  • Dockerfile
    • 统一镜像构建入口
  • entrypoint.sh
    • 容器内启动前端、后端、Nginx
  • create-instance.sh
    • 创建实例目录、生成配置、启动容器、写注册表
  • remove-instance.sh
    • 删除容器、移除注册表、可选清理实例目录
  • list-instances.sh
    • 查看当前注册实例
  • instance-registry.py
    • 维护 runtime/registry/instances.json

注册表

默认注册表路径:

runtime/registry/instances.json

每条记录至少包含:

  • instance_id
  • instance_slug
  • container_name
  • host_port
  • public_url
  • instance_root
  • image_name

常用命令

1. 构建镜像

docker build -t nano/app-instance:latest .

2. 创建实例

./create-instance.sh \
  --image nano/app-instance:latest \
  --instance-id demo-001 \
  --auth-username admin \
  --auth-password 123456 \
  --api-key 'your-api-key'

可选参数:

  • --host-port
  • --public-url
  • --username
  • --email
  • --instance-host
  • --authz-base-url
  • --backend-id
  • --client-id
  • --client-secret
  • --network
  • --host-bind-ip
  • --build
  • --replace

3. 查看实例

./list-instances.sh
./list-instances.sh --json

4. 删除实例

./remove-instance.sh --instance-id demo-001

如果要把实例目录也一并清掉:

./remove-instance.sh --instance-id demo-001 --purge-data

目录约定

默认实例数据目录:

runtime/instances/<instance-slug>/

其中会生成:

runtime/instances/<instance-slug>/
└── beaver-home
    ├── config.json
    ├── web_auth_users.json
    └── workspace/

这个目录是单用户 sandbox 的配置与数据边界。容器内会把它挂到:

/root/.beaver/

并设置:

BEAVER_CONFIG_PATH=/root/.beaver/config.json
BEAVER_WORKSPACE=/root/.beaver/workspace

所以模型 provider/api_key/api_base/model 配一次即可Web / channel 请求不需要、也不应该携带 API Key。

当前状态

这层已经支持:

  • 统一镜像构建
  • 镜像内安装并启动新的 beaver 后端
  • 实例创建
  • 实例删除
  • 实例列表
  • 基于注册表的端口分配
  • 为 deploy-control / router-proxy 记录用户名和实例 host

生产注意

  • 实例容器的宿主机端口默认只绑定 127.0.0.1
  • 外部访问应统一走 router-proxy
  • 如果你确实要把单个实例端口直接暴露到公网,再显式传 --host-bind-ip 0.0.0.0

下一步可以继续接:

  • portal 调用创建实例
  • URL 分配和反向代理
  • 实例续期 / 停用 / 启用