Commit cf78f00
fix(deploy): AUTH_URL 透传 + 强制重建容器(生产 SignIn / /api/events 全都失效的根因) (#11)
* fix(deploy): AUTH_URL 透传 + 强制重建容器
修两条独立但叠加的生产部署 bug:
1) docker-compose.yml 的 environment 缺 AUTH_URL 透传。
application.properties 里 justauth redirect-uri 是
${AUTH_URL:http://localhost:3000}/api/auth/callback/github,
compose 不显式透传时 .env 的 AUTH_URL=https://involutionhell.com
进不到容器,生产 /oauth/render/github 302 的 redirect_uri
变成 localhost,跳 GitHub 必报 redirect_uri_mismatch。
docker inspect 查到运行中容器 AUTH_URL=http://localhost:3010
是老容器手工 docker run 遗留。
2) deploy.yml 的 docker compose up -d 没加 --force-recreate。
CI 的 docker build 会把 :latest 标签指向新 sha,但 compose 看
image 名没变就不重建容器,:latest 指向新 sha 而运行中容器仍
绑死老 sha —— PR #9 / #10 的 SaToken /api/events 白名单、
events controller 全都躺在新镜像里没生效,/api/events 一直 401。
合起来就是"部署全 success 但生产没变化"的伪成功。
后续 merge 这个 PR 触发 deploy workflow 后,验证:
curl -I https://api.involutionhell.com/oauth/render/github | grep -i location
# → redirect_uri=https%3A%2F%2Finvolutionhell.com%2Fapi%2Fauth%2Fcallback%2Fgithub
curl https://api.involutionhell.com/api/events
# → {"success":true,"data":[...]}
1 parent 46e5c1b commit cf78f00
2 files changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
71 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
72 | 78 | | |
73 | 79 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
0 commit comments