Files
knowledge-governance/.env.example
T
姚章浩 ce2a155ebc feat(settings): 知识库绑定按环境一次保存连接与内外库
原「知识库映射 → WeKnora 连接」把地址、文件和绑定分散在多处,页面无法输入密钥,
也看不到候选实例真实可读的库。现在测试 090 / 生产 090 各自一个工作区:草稿填地址
与 API Key,服务器真实分页列库并区分空库/无权限/不可达,选内外库后一次保存连接与
绑定,回读真实生效值。

服务端以修订号 + 行锁 + 单事务写连接、绑定与待入库重排;旧部署无新行时继续使用文件
凭据/默认绑定。密钥只存 AES-256-GCM 密文,主密钥在独立文件;换地址必须重录,旧密钥
不转发、不跨环境取用。消费端(readiness/上传轮询/列库/探活/生产列库)统一从该存储
解析当前连接,避免只保存了页面数据。

验证:go test ./...;前端 606 项;隔离 PostgreSQL 集成用例覆盖保存/冲突/重排/拒错;
make verify 在本提交上执行(结果见交付说明)。
2026-11-19 14:51:47 +08:00

77 lines
3.5 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.
# Optional independent source, disabled by default. Never use the app writer or
# substitute DATABASE_URL. Backend credential file must be a regular 0600 file.
DOBOTAI_OPS_READ_ENABLED=false
DOBOTAI_OPS_READ_DSN_FILE=
DOBOTAI_OPS_TENANT_KEY=
DOBOTAI_OPS_DIAL_MODE=direct
DOBOTAI_OPS_SSH_TARGET=
DOBOTAI_OPS_CONNECT_TIMEOUT=5s
DOBOTAI_OPS_QUERY_TIMEOUT=4s
DOBOTAI_OPS_MAX_CONNS=2
DOBOTAI_OPS_MIN_CONNS=0
# API and worker share this opt-in binding; no browser-selected paths/credentials.
# Runtime root is the read-only existing weekly_report directory (SDK/config and
# private secret file). Python must be compatible and already provide PyYAML.
# Container deployment requires approved runtime/script mounts; not auto-installed.
DOBOTAI_OPS_DIRECTORY_SYNC_ENABLED=false
DOBOTAI_OPS_DIRECTORY_SYNC_PYTHON=
DOBOTAI_OPS_DIRECTORY_SYNC_SCRIPT=
DOBOTAI_OPS_DIRECTORY_SYNC_RUNTIME_ROOT=
DOBOTAI_OPS_DIRECTORY_SYNC_SPOOL_ROOT=
DOBOTAI_OPS_DIRECTORY_SYNC_TIMEOUT=20m
# Independent governance AI: endpoint/model/write-only API key are stored via the admin page.
# Mount the same 32-byte regular 0600 master-key file into API and ordinary worker.
QA_AI_MASTER_KEY_FILE=
# 「知识库绑定」密钥密文的独立主密钥(32字节、0600 常规文件),挂载到 api 与 worker。
# 留空时页面仍能读旧部署的文件凭据/默认绑定,但保存新密钥会被拒绝(不落明文)。
WEKNORA_BINDING_MASTER_KEY_FILE=
# Empty uses system DNS; alidns enables certificate-verified public DNS-over-TLS for this client only.
QA_AI_DNS_OVER_TLS=
# Only opt in behind an already trusted TLS-terminating same-origin reverse proxy.
QA_AI_TRUST_TLS_PROXY=false
APP_ADDR=:8080
DATABASE_URL=postgres://governance@postgres:5432/governance?sslmode=disable
PGPASSFILE=/run/secrets/pgpass
WORKER_ID=worker-1
WORKER_POLL_INTERVAL=1s
WORKER_LEASE_DURATION=30s
WORKER_RETRY_DELAY=5s
RELEASE_WORKER_ENABLED=false
PRODUCTION_RELEASE_REQUESTS_ENABLED=false
# Read-only probe of the production WeKnora endpoint (console shows its real
# state); the publish target itself stays in RELEASE_CONFIG_FILE.
PRODUCTION_WEKNORA_BASE_URL=
PRODUCTION_WEKNORA_API_KEY_FILE=
PRODUCTION_WEKNORA_ALLOW_DOCKER_HTTP=false
PP_SCAN_ENABLED=false
PP_SCAN_HOST_DATA_ROOT=/home/zheromiku/dobot-portal-sync/data
PP_SCAN_CONTAINER_DATA_ROOT=/home/zheromiku/dobot-portal-sync/data
TEST_WEKNORA_ENABLED=false
TEST_WEKNORA_ALLOW_DOCKER_HTTP=false
TEST_WEKNORA_BASE_URL=
MINERU_BASE_URL=
TEST_WEKNORA_KB_ID=
TEST_WEKNORA_API_KEY_FILE=/run/secrets/test_weknora_api_key
GOVERNANCE_SPOOL_ROOT=/var/lib/governance/spool
TEST_WEKNORA_HTTP_TIMEOUT=60s
TEST_WEKNORA_POLL_INITIAL=10s
TEST_WEKNORA_POLL_MAX=60s
TEST_WEKNORA_STALLED_AFTER=30m
TEST_WEKNORA_MAX_UPLOAD_BYTES=52428800
TEST_ACCEPTANCE_POLICY_VERSION=structural-v1
# 「版本记录」页:**匿名只读**远端仓库的提交与 tag(**不使用任何凭据**)。
# 留空即"未接线"(页面降级展示、同步按钮不可用)。只允许下面批准的 origin 与固定仓库,
# 不接受任何调用方传入的 URL;`VERSION_HISTORY_REPO` 必须是 owner/name。
VERSION_HISTORY_GITEA_BASE_URL=
VERSION_HISTORY_REPO=Weknora/knowledge-governance
VERSION_HISTORY_ALLOWED_ORIGINS=
# 页面上的「查看提交 / 查看 tag」链接用哪个 origin —— 抓取可以走内网,但链接必须能被
# **点它的人**打开(否则点开是空白)。留空 = 与上面的抓取地址相同。
VERSION_HISTORY_LINK_ORIGIN=https://gitea.zheromiku.top
VERSION_HISTORY_HTTP_TIMEOUT=15s
VERSION_HISTORY_MAX_PAGES=200