Files
SimpleRemoter/server/go/deploy/yama-server.env.example
T
yuanyuanxianganddeepseek-flash d4f10db1f2 Feature(Go): verify_tools --subset and MCP deployment docs
Add a third mode to verify_tools.py that validates the Go server end to
end: it fetches /mcp tools/list and requires the name set to equal the
nine implemented tools exactly (seven in readonly mode), compares
description / inputSchema / outputSchema field by field against
mcp/tools.json, and also checks the published order. Unlike --live,
extra or missing tools are failures, not notes.

The field-comparison loop is factored into report_field_diffs so
--offline / --live and --subset share one comparison, diff printer and
FIELDS tuple.

Document and deploy the endpoint: the systemd env example gains
YAMA_MCP_TOKEN / READONLY / TERM_IDLE / MAX_CONCURRENCY / READ_MAX,
the design doc moves to implemented and its section 10 now matches the
code (embedded tools_minimal.json, the three packet dispatch groups).
The tools README explains gen_go_tools.py --check and --subset.

Verified against a freshly built debug Go server on 16543/18090:
read-write mode passes with 9 tools, YAMA_MCP_READONLY=1 passes with 7,
and both mismatch directions (extra tools, missing tools) fail with
exit 1. gen_go_tools.py --check stays clean; no Go code changed.

Co-Authored-By: deepseek-flash
2026-11-12 23:09:33 +01:00

96 lines
3.9 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ============================================================
# YAMA 服务端环境变量(完整版)
# systemd 通过 EnvironmentFile=-/etc/yama/server.env 读取
# 行首 "#" = 未启用(保持默认);去掉 "#" 即生效
# ============================================================
# ---------- 账号 / 密码 ----------
# Web 管理员账号 "admin" 的初始密码。回退链:
# YAMA_WEB_ADMIN_PASS → YAMA_PWD → 硬编码 "admin"
# 生产环境务必设置,否则会以 admin/admin 裸奔(启动日志会红色告警)
YAMA_WEB_ADMIN_PASS=ChangeMe_Strong
# 超级密码(明文)。TCP 授权用,也是上面 Web 管理员密码的回退来源
#YAMA_PWD=
# TCP 授权的密码哈希(SHA-256 十六进制)。与 YAMA_PWD 二选一;
# 未设置时用内置占位默认值(生产应覆盖)
#YAMA_PWDHASH=
# 持久化 Web 用户文件路径(默认相对工作目录的 users.json)
#YAMA_USERS_FILE=/opt/yama/users.json
# ---------- 网页端 / 反向代理 ----------
# 子路径部署前缀(方案B)。空 = 根路径(方案A);有值须与 nginx location 一致
YAMA_WEB_BASE_PATH=/remoter
# "1" = 信任反向代理的 X-Forwarded-For(nginx 在 Go 前面时务必开启,
# 否则登录限流会把所有客户端当成 nginx 同一个 IP)
YAMA_WEB_TRUST_PROXY=1
# WebSocket Origin 白名单(逗号分隔)。空 = 仅允许同源
#YAMA_WEB_ALLOWED_ORIGINS=https://你的域名
# ---------- MCP 端点(可选)----------
# 设计见 docs/Mcp_Go_Minimal_Design.md;启用后挂在同一个 Web 端口的 /mcp。
# 静态 Bearer Token(客户端填同一个值)。空 = 不注册 /mcp(404)。
# 不会自动生成:只出现在日志里的秘密不算秘密
#YAMA_MCP_TOKEN=
# "1" = 只读模式:隐藏并拒收 terminal_exec / terminal_close(会创建/关闭会话)
#YAMA_MCP_READONLY=1
# 终端会话空闲回收(秒,默认 180)
#YAMA_MCP_TERM_IDLE=180
# 全球在途 tools/call 上限(默认 16,超出返回 -32003)
#YAMA_MCP_MAX_CONCURRENCY=16
# read_file 单文件上限(字节,默认 2 MiB;超限提示改用 download_file)
#YAMA_MCP_READ_MAX=2097152
# ---------- SSO(单点登录,可选)----------
# 共享的 HS256 签名密钥。设置后启用 SSO:YAMA 校验父域名(如 FMS 网关)下发的
# auth_token JWT,通过后为门户管理员铸一枚 YAMA 会话、免二次登录。
# 取值必须与上游门户的签名密钥一致(FMS 即 SERVER_PRIVATE_KEY)。
# ⚠️ 仅 admin 角色的门户用户会被自动登录;其他角色(viewer / 未知)即使已登录
# 门户,也必须再输一遍 YAMA 自己的 Web 登录密码(/sso 返回 401 → 回退登录页)。
#YAMA_SSO_JWT_SECRET=
# ---------- 授权 / 许可(signer)----------
# 优先级:YAMA_SIGN_PASSWORD > YAMA_LICENSE_DISABLED=1 > YAMA_LICENSE_TOKEN > 匿名试用
# 本地签名主密钥(HMAC)。设置即进入 LocalSigner 模式(运营方自部署)
#YAMA_SIGN_PASSWORD=
# "1" = 关闭授权校验(NoOpSigner,离线/开发用;客户端将拒绝屏幕/文件功能)
#YAMA_LICENSE_DISABLED=1
# 许可服务器 URL(RemoteSigner 付费客户 / 试用模式的默认地址)
#YAMA_LICENSE_SERVER=
# 客户 JWT(付费客户解锁设备配额)
#YAMA_LICENSE_TOKEN=
# ⚠️ EnvironmentFile 只在服务启动时读一次:改本文件后必须 systemctl restart <服务>,
# 否则改动不生效(现象:启动日志仍是 "Signer mode: TRIAL" 而非 REMOTE)
# 缓存 TTL(小时,RemoteSigner 离线缓存,默认 24)
#YAMA_LICENSE_OFFLINE_HRS=24
# ---------- 兼做许可服务器(可选,LocalSigner-as-LS)----------
# issue-token 子命令用:RSA 私钥 PEM 路径(与公钥配对)
#YAMA_LICENSE_PRIVATE_KEY=
# 对外签发许可用:RSA 公钥 PEM 路径 + 监听地址(如 ":8443")
#YAMA_LICENSE_PUBLIC_KEY=
#YAMA_LICENSE_HTTP_ADDR=:8443
# 配额状态持久化文件路径
#YAMA_LICENSE_STATE_PATH=/opt/yama/license_state.json