Skip to content

修复 Docker Compose 未读取 .env 中的 MUSE2API_KEY - #2

Merged
czg86389-hub merged 1 commit into
czg86389-hub:mainfrom
cpt-kenvie:fix/docker-compose-api-key
Oct 2, 2026
Merged

czg86389-hub merged 1 commit into
czg86389-hub:mainfrom
cpt-kenvie:fix/docker-compose-api-key

Conversation

@cpt-kenvie

Copy link
Copy Markdown
Contributor

问题

Docker Compose 文件把 MUSE2API_KEY 写死为示例值,覆盖了部署目录 .env 中的实际密钥,导致管理页面请求返回 401,无法添加账号。

修复

  • 从 .env 或宿主环境读取 MUSE2API_KEY。
  • 未配置时保留自动生成密钥的行为。
  • 在部署文档中说明密钥读取方式。

验证

  • docker compose config --quiet
  • 使用临时 MUSE2API_KEY 验证 Compose 插值结果。
  • python -m compileall -q app.py config.py cdp.py engine.py store.py

- Use the MUSE2API_KEY value from .env or the host environment\n- Preserve automatic key generation when no value is configured\n- Document Compose key precedence for deployments
@czg86389-hub

Copy link
Copy Markdown
Owner

感谢贡献!PR 已成功合入主分支。已将您加入项目贡献者致谢名单,感谢对 MUSE2API 的支持与维护!🤝

its-benjamin added a commit to its-benjamin/muse2api that referenced this pull request Oct 2, 2026
Upstream commits merged:
- fix(compose): read MUSE2API_KEY from .env via ${MUSE2API_KEY:-} (kenvie, PR czg86389-hub#2)
- feat: Tampermonkey cookie importer + keepalive for disabled accounts (CarloCPP, PR czg86389-hub#6)
- fix(stream): role chunk, token pacer, high-frequency 60ms DOM poll, warm tab reuse (57dd7b8)
- docs: contributors section (9ee9864)

Changes:
app.py  - _pace_text() helper for smooth 2-char/12ms micro-token SSE output
        - Emit role:assistant chunk immediately on stream open
        - All sync_stream() yield sites wrap _pace_text()
        - keepalive runner respects CFG.keepalive_disabled_accounts
config.py - keepalive_disabled_accounts field (MUSE2API_KEEPALIVE_DISABLED_ACCOUNTS, default off)
engine.py - _POLL_CHAT_JS: scoped to main/chat-scroll container; nonEmpty bubble filter;
            returns cnt (non-empty), total (all), txt, stop
          - reset_thread: scoped bubble count; nav threshold 16->24 bubbles
          - chat_stream: 60ms poll (was 80/100ms); first_token_deadline 30->40s;
            phase-1 yields first delta inline; phase-2 stable-3 exit (no Stop button)
            or stable-80 dead-man's-switch (Stop still showing); 14s VM stall check
docker-compose.yml - MUSE2API_KEY=${MUSE2API_KEY:-} (no more hardcoded example value)
.env.example - MUSE2API_KEEPALIVE_DISABLED_ACCOUNTS=0 entry
README.md - Chrome extension section expanded to include Tampermonkey Option B
          - Contributors section crediting cpt-kenvie and CarloCPP
tools/muse2api_cookie_importer.user.js - new Tampermonkey userscript (upstream v1.1.0)
its-benjamin added a commit to its-benjamin/muse2api that referenced this pull request Oct 2, 2026
Upstream commits merged:
- fix(compose): read MUSE2API_KEY from .env via ${MUSE2API_KEY:-} (kenvie, PR czg86389-hub#2)
- feat: Tampermonkey cookie importer + keepalive for disabled accounts (CarloCPP, PR czg86389-hub#6)
- fix(stream): role chunk, token pacer, high-frequency 60ms DOM poll, warm tab reuse (57dd7b8)
- docs: contributors section (9ee9864)

Changes:
app.py  - _pace_text() helper for smooth 2-char/12ms micro-token SSE output
        - Emit role:assistant chunk immediately on stream open
        - All sync_stream() yield sites wrap _pace_text()
        - keepalive runner respects CFG.keepalive_disabled_accounts
config.py - keepalive_disabled_accounts field (MUSE2API_KEEPALIVE_DISABLED_ACCOUNTS, default off)
engine.py - _POLL_CHAT_JS: scoped to main/chat-scroll container; nonEmpty bubble filter;
            returns cnt (non-empty), total (all), txt, stop
          - reset_thread: scoped bubble count; nav threshold 16->24 bubbles
          - chat_stream: 60ms poll (was 80/100ms); first_token_deadline 30->40s;
            phase-1 yields first delta inline; phase-2 stable-3 exit (no Stop button)
            or stable-80 dead-man's-switch (Stop still showing); 14s VM stall check
docker-compose.yml - MUSE2API_KEY=${MUSE2API_KEY:-} (no more hardcoded example value)
.env.example - MUSE2API_KEEPALIVE_DISABLED_ACCOUNTS=0 entry
README.md - Chrome extension section expanded to include Tampermonkey Option B
          - Contributors section crediting cpt-kenvie and CarloCPP
tools/muse2api_cookie_importer.user.js - new Tampermonkey userscript (upstream v1.1.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants