[feat] WSL2 容器化代理部署 — Closes #6#7
Open
visail wants to merge 9 commits into
Open
Conversation
基于 python:3.11-slim,非 root 运行(csswitch 用户),零 pip 依赖。 .dockerignore 排除 .git、.sandbox、findings、desktop 等无关文件。 .env.example 提供完整的环境变量模板与注释。 Co-Authored-By: Claude <noreply@anthropic.com>
…ddy TLS Compose 编排:csswitch-proxy 服务(env_file、端口映射、健康检查、 自动重启、日志卷)。提供可选 Caddy TLS 反代(--profile tls), 在 WSL2 内部用自签名证书保护 path secret 的传输安全。 Co-Authored-By: Claude <noreply@anthropic.com>
新增 docs/wsl2-container-deployment.md:前置条件、快速开始 (PowerShell 与 WSL2 内)、配置、网络说明、可选 Caddy TLS、 故障排查、安全提示、限制。 README.md 增加 WSL2/Docker 徽章与入口链接。 Co-Authored-By: Claude <noreply@anthropic.com>
新增 [容器 / WSL2] 诊断段:检测 docker CLI 与 compose 插件、 检测 WSL2 环境(/proc/version 或 WSL_DISTRO_NAME)、 只读检查 csswitch-proxy:latest 镜像是否存在。 Co-Authored-By: Claude <noreply@anthropic.com>
新增 test/test_container.sh(RUN_CONTAINER_TESTS=1 时启用): 构建镜像、创建临时 .env、启动容器、健康检查、/v1/models 验证、清理。 test/run_all.sh 新增 container test 调用。 Co-Authored-By: Claude <noreply@anthropic.com>
记录本次 feature/wsl2-containerized-deployment 分支的全部变更: proxy --host 参数、Dockerfile/compose、WSL2 脚本与 PowerShell 包装、 部署文档、doctor 诊断增强、容器冒烟测试。 Co-Authored-By: Claude <noreply@anthropic.com>
Tippye
pushed a commit
to Tippye/CSswitch
that referenced
this pull request
Jul 3, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
概述
在 WSL2 中以 Docker 容器运行 CSSwitch 翻译代理,实现 WSL2 内 Claude Science 推理走第三方 API。
Closes #6
变更清单
翻译代理
proxy/csswitch_proxy.py新增--host/CSSWITCH_BIND_HOST,支持绑0.0.0.0容器 (docker/)
Dockerfile— python:3.11-slim,非 root,零 pipdocker-compose.yml— 健康检查 + 自动重启 + 可选 Caddy TLS.dockerignore/.env.example/Caddyfile部署脚本
wsl2-deploy/stop/logs.ps1+ 共用模块wsl2-common.ps1wsl2-deploy/stop/logs.sh+docker-build.sh文档
docs/wsl2-container-deployment.md— 完整部署指南(含踩坑记录:ANTHROPIC_BASE_URL 用 127.0.0.1、AF_UNIX 路径限制、Docker WSL 集成 等 7 条踩坑记录)工程
.gitattributes— 强制 LF 行尾scripts/doctor.sh— 新增 Docker/WSL2 检测test/test_container.sh— 容器冒烟测试README.md/CHANGELOG.md更新验证
已在 WSL2 Ubuntu-24.04 + Docker Desktop 环境完整验证链路:
代理日志确认:
CONNECT claude.ai:443 -> 401+POST /<secret>/v1/messages均已出现,从 OAuth 到推理全链打通。