mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-06-04 13:30:32 +08:00
chore(env): expose tenant RBAC + per-user tenant cap as env knobs
Surface two existing config.go env overrides to the canonical deployment artifacts so operators can flip them without reading the Go source: * WEKNORA_TENANT_ENABLE_RBAC — observe / enforce switch for tenant-level role enforcement (PR 1303). Default false keeps the current behaviour; flip to true once role assignments have been audited per docs/rbac.md. * WEKNORA_TENANT_MAX_OWNED_PER_USER — cap on tenants a single non-superuser can self-create. Uses the existing <0 / 0 / >0 sentinel semantics documented on TenantConfig.MaxOwnedPerUser. docker-compose.yml passes both through to the app container, and .env.example gains a "Tenant / RBAC" section with the default values and the same sentinel rules inline so the example is the sole reference operators need. No functional change — both env vars were already honoured by config.go.applyAuthAndTenantDefaults.
This commit is contained in:
16
.env.example
16
.env.example
@@ -431,6 +431,22 @@ WEKNORA_SANDBOX_TIMEOUT=60
|
||||
# 也支持 Go duration 写法(如 30s / 5m / 1h)。
|
||||
# WEKNORA_AGENT_TOOL_APPROVAL_TIMEOUT=600
|
||||
|
||||
# ========== Tenant / RBAC 配置 ==========
|
||||
# 启用租户级 RBAC(基于 tenant_members 表的角色强制鉴权)。
|
||||
# - false(默认):观察模式,记录但不拦截,便于上线初期审计角色分配
|
||||
# - true:开启后,无 active membership 或角色不足的请求会被 403 拒绝
|
||||
# 详细灰度方案见 docs/rbac.md。
|
||||
# 注意:开发环境用 Air 热重载时,修改本变量需重启 dev 脚本(仅源代码变更才重读 .env)。
|
||||
# WEKNORA_TENANT_ENABLE_RBAC=false
|
||||
|
||||
# 单个非超管用户可自助创建(成为 Owner)的租户数上限。
|
||||
# 仅统计 Owner 角色——被邀请为 Admin/Editor/Viewer 的不计入。
|
||||
# 拥有 CanAccessAllTenants 的超管不受此限制。
|
||||
# > 0 :启用该值作为硬上限;超出返回 429
|
||||
# = 0 :使用 handler 默认值
|
||||
# < 0 :彻底关闭限额(不建议在共享部署中使用)
|
||||
# WEKNORA_TENANT_MAX_OWNED_PER_USER=
|
||||
|
||||
# APK 镜像源设置(可选)
|
||||
APK_MIRROR_ARG=mirrors.tencent.com
|
||||
|
||||
|
||||
@@ -170,6 +170,12 @@ services:
|
||||
# Agent LLM call timeout
|
||||
- WEKNORA_AGENT_LLM_TIMEOUT=${WEKNORA_AGENT_LLM_TIMEOUT:-}
|
||||
- WEKNORA_AGENT_TOOL_APPROVAL_TIMEOUT=${WEKNORA_AGENT_TOOL_APPROVAL_TIMEOUT:-}
|
||||
# Tenant / RBAC(详见 docs/rbac.md 与 .env.example 注释)
|
||||
# - WEKNORA_TENANT_ENABLE_RBAC: 是否启用租户角色强制鉴权(true / false),默认 false
|
||||
# - WEKNORA_TENANT_MAX_OWNED_PER_USER: 单个非超管自助创建租户的上限
|
||||
# >0 强制限额;=0 走 handler 默认;<0 关闭限额(不建议共享部署使用)
|
||||
- WEKNORA_TENANT_ENABLE_RBAC=${WEKNORA_TENANT_ENABLE_RBAC:-}
|
||||
- WEKNORA_TENANT_MAX_OWNED_PER_USER=${WEKNORA_TENANT_MAX_OWNED_PER_USER:-}
|
||||
- APK_MIRROR_ARG=${APK_MIRROR_ARG:-}
|
||||
depends_on:
|
||||
redis:
|
||||
|
||||
Reference in New Issue
Block a user