6 Commits

Author SHA1 Message Date
zyc
7168e50a6e fix: prod login + env-file driven config + scroll-snap bounce
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 6m54s
- env: 解封 .env / .env.production 提交, 仅忽略 .env.local 系列;
  .env.production 承载 DATABASE_URL / AUTH_SECRET / AUTH_URL /
  SMS_* / NEXT_PUBLIC_TOS_DOMAIN, Dockerfile runner 阶段 COPY 进
  运行时镜像, Next.js standalone 启动自动加载
- ci: 移除 kubectl 注入 secret 步骤(env 已烧入镜像), 保留占位避免
  envFrom optional 引用告警, 修复 /api/auth/providers 500 (缺 AUTH_SECRET)
- auth: signIn 失败透传 NextAuth 真实错误码, 不再被"验证码错误"一刀切掩盖
- home: 首页 scroll-snap-type 由 mandatory 改 proximity, 修复滚动到
  底部被强制吸回候选区顶部的回弹

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 17:31:00 +08:00
iye
cfd44403cb fix(deploy): inject NEXT_PUBLIC_TOS_DOMAIN at docker build time
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 6m17s
线上 https://cyberstar.airlabs.art 立绘 + 视频全部缺失, 因为部署镜像里
NEXT_PUBLIC_TOS_DOMAIN 是空字符串, 触发 tosUrl() fallback 走相对路径
(/portraits/001.webp 等), 而 public/portraits 已经 .gitignore 不入镜像 → 全 404。

根因: Next.js 把 NEXT_PUBLIC_* 编译进 client bundle, 必须 build 时注入,
运行时通过 envFrom secret 注入无效。

修复:
- Dockerfile builder 阶段加 ARG NEXT_PUBLIC_TOS_DOMAIN + ENV, 在 next build 前生效
- .gitea/workflows/deploy.yaml docker build 步骤加 --build-arg NEXT_PUBLIC_TOS_DOMAIN=...

推送后 CI 自动重建镜像, 部署后 HTML 里 src 会变成完整 TOS URL。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 19:03:35 +08:00
zyc
7506372abd fix(ci): hoisted node_modules + alpine binary target for Prisma in Docker
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 5m45s
Root cause (from build log):
1. Prisma 6 generates client into @prisma/client package dir (not .prisma/client)
2. pnpm default isolated linker puts everything in .pnpm/ store with symlinks
   at top-level — Docker COPY of @prisma followed broken/incomplete symlinks
3. node:22-alpine needs linux-musl-openssl-3.0.x engine binary

Fixes:
- .npmrc: node-linker=hoisted → flat node_modules, COPY behaves like npm
- schema.prisma: add linux-musl-openssl-3.0.x to binaryTargets
- Dockerfile: drop dead .prisma/client checks, copy only @prisma (where
  Prisma 6 actually writes the client) plus standalone output

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 14:13:37 +08:00
zyc
d2b8c0afdc fix(ci): explicit prisma generate + ignore-scripts in Docker build
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
Root cause: pnpm 10+ skips lifecycle scripts in root/CI environments by
default, so the project's postinstall (prisma generate) never ran. The
runner stage then failed to COPY node_modules/.prisma because builder
never produced it.

Fix: install with --ignore-scripts, then call `pnpm exec prisma generate`
explicitly in both deps and builder stages, with ls assertions to surface
any future regression early.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 14:06:47 +08:00
zyc
6155638549 fix(ci): bump base image to node:22-alpine
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 6m21s
corepack-installed pnpm 11 requires node:sqlite (Node 22+).
Build was failing in deps stage with ERR_UNKNOWN_BUILTIN_MODULE.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 13:58:47 +08:00
zyc
c19b3b7b05 ci: add CI/CD pipeline for cyberstar.airlabs.art
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 6m41s
- Dockerfile: multi-stage Next.js standalone build with pnpm + prisma
- k8s manifests: single web deployment + Traefik ingress + LE TLS
- Gitea workflow: build/push to Volcano CR, deploy to K3s, log-center failure reporting
- next.config: enable standalone output for slim container image

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 13:44:04 +08:00