Repository navigation
security: remove embedded DeepSeek API keys; require user/local model setup - #85
Merged
Merged
Conversation
… setup Stop desktop packaging from copying maintainer .env into the org sidecar. Never seed or prefill a real cloud API key; prefer local Ollama and block empty-key cloud calls with a clear error. Add a CI scan for DeepSeek-like secrets in packaged config templates. Co-authored-by: XYAI Labs <haoboy8@gmail.com>
Co-authored-by: XYAI Labs <haoboy8@gmail.com>
Admin fetch-models now returns PROVIDER_API_KEY_REQUIRED copy (API Key / 密钥), not a literal api_key substring. Co-authored-by: XYAI Labs <haoboy8@gmail.com>
First-run must not persist DeepSeek from DEEPSEEK_API_KEY/OPENAI_API_KEY. Refuse to zip staging trees that contain .env, octop.db, or .freeos. Desktop CI workflow does not inject LLM secrets. Co-authored-by: XYAI Labs <haoboy8@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
桌面安装包不得再携带维护者的云厂商 API Key。本 PR 清除源码与打包路径中可能把真实密钥打进安装包的入口,首次运行不再预填云密钥,空密钥会阻断云调用,并增加 CI / 打包扫描防止回归。
必须立刻做(本 PR 不会代做)
补充证据(不含真实密钥)
providers已有一行:name=DeepSeek,base_url=https://api.deepseek.com/v1,api_key为真实sk-…,且settings.active_model=DeepSeek/deepseek-v4-flash。这与设置向导_apply_provider_draft写入的 DeepSeek 预设完全一致,说明问题是首次安装即写入,不是用户后来手填。.github/workflows/octop-desktop.yml未引用LLM_API_KEY/DEEPSEEK_API_KEY/LIVE_OPENAI_*。官方 CI 打包不会从 Actions secrets 注入云密钥。调查结论(根因)
已提交源码与
v0.0.1–v0.0.4标签中没有硬编码的sk-+32hex 密钥。官方 CI 也不会注入 LLM secret。更吻合证据的路径是:本地打安装包时把开发机密钥带进产物,首次运行再写进宿主
providers:bundle-org-sidecar.sh的rsync会拷贝维护者modules/openxyos/.env(含LLM_API_KEY);sidecarseed.ts曾把process.env.LLM_API_KEY写入配置。~/.freeos、octop.db或 dotenv 打进 zip,用户解包后第一次启动就会带着维护者的 DeepSeek 行(active_model=DeepSeek/deepseek-v4-flash)。DEEPSEEK_API_KEY/OPENAI_API_KEY/LLM_API_KEY填云厂商api_key,并有测试锁定。改动
.env/.freeos/octop.db;package.sh打 zip 前扫描 staging;发现密钥文件或 DeepSeek 形态sk-则失败。PROVIDER_API_KEY_REQUIRED,不从环境变量预填;空密钥阻断云探测/拉模型。LLM_API_KEY;种子llm_api_key恒为空。octop-desktop.yml不注入 LLM secret;向导在 env 有假密钥时仍拒绝空 draft。范围外
验证
uv run pytest tests/unit/desktop/test_packaged_secrets.py tests/integration/test_setup_wizard.py tests/integration/test_provider_fetch_models.py tests/unit/test_green_launch.py -q→ 通过