Repository navigation
Conversation
- 新增 docker-compose.public.yml:叠加 Caddy 入口,应用端口改绑回环, TRUST_PROXY/HOST/ALLOWED_HOSTS/PUBLIC_BASE_URL 一并按公网口径修正 - 新增 deploy/caddy/Caddyfile:自动签发续期、HTTP→HTTPS、SSE 逐帧不缓冲、 XFF 覆盖式写入、/metrics 公网摘除 - README(中/英)新增「公网部署(Docker + Caddy)」一节 + 快速开始互链 - .env.example 补 PUBLIC_DOMAIN / ACME_EMAIL;TECHNICAL 目录表同步 - CI compose job 校验覆盖文件与 Caddyfile 语法 Refs #26
|
服务器没有绑定域名,只有公网IP可以正常部署,https吗? |
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.
Closes #26
做了什么
按 issue 要求把「Caddy + override + README『公网部署(Docker)』」落成可合并的 PR。
docker-compose.public.yml(新增):在基础 compose 上叠一个 Caddy 入口。!override改绑127.0.0.1:${PORT}—— 不留明文 http 旁路TRUST_PROXY=true+HOST=0.0.0.0+PUBLIC_BASE_URL=https://<域名>ALLOWED_HOSTS显式补域名 +127.0.0.1:非空即「完全替换」语义,漏了会让全站 400 或 healthcheck 永远失败depends_on: service_healthy,证书落具名卷caddy_datadeploy/caddy/Caddyfile(新增):自动签发 / 续期、HTTP→HTTPS 308、flush_interval -1保 SSE 逐帧、X-Forwarded-For覆盖式写入(客户端伪造无效)、/metrics公网返 404、反代不设超时上限(交给应用STREAM_*/UPSTREAM_COMPLETE_TIMEOUT_SECONDS).env.example:补PUBLIC_DOMAIN/ACME_EMAIL;TECHNICAL.md 目录表同步config --quiet与caddy validate两步验证
docker compose config(base)+ 覆盖文件均通过;缺PUBLIC_DOMAIN时按预期报错coding2apihealthy →coding2api-caddy起来;https://localhost/health200、/metrics404、http 80 → 308、SSE 逐帧 0.3s 间隔到达、客户端伪造的X-Forwarded-For: 1.2.3.4被改写为真实对端caddy validate通过(v2.11.7);docker build通过ruff+pytest --cov-fail-under=100→ 100%影响
PUBLIC_DOMAIN,基础 compose 行为不变!override标签)