启动时同步打包 api_key 到用户 config + 轮换新 Gemini Key
机制: config_util.sync_bundled_api_key(user_config_path) 启动时调用: - frozen 态才生效 (开发态不干涉) - 打包 config.json 的 api_key 和用户目录的比较 - 不一致时只覆盖 api_key 这一个字段 - saved_prompts / last_user / saved_password_hash / db_config 全部保留 - 多重 fail-safe: 打包 config 缺失/解析失败/api_key 空/用户 config 解析失败 → 全都不动 新 Gemini Key 已写入 repo 的 config.json。两周过渡计划: - D0 (本次发布): 新 Key 随 bundled config 分发,升级用户启动瞬间自动切到新 Key; 老用户暂不升级,config.json 里还是老 Key,Google Cloud 两把 Key 并行 - D14: Google Cloud Console 作废老 Key; 已升级用户零感知,没升级用户此时才 401,被迫升级 注: 企业内部软件,有用户名密码保护,Key 内置到 repo 可接受
Showing
3 changed files
with
98 additions
and
2 deletions
-
Please register or sign in to post a comment