Apple design (plans/gtm/APPLE-DESIGN-RULES-2026-11-17.md): rewrote theme tokens in globals.css/tailwind.config.js to neutral black/white + one accent (#0071E3), replacing the GitHub-dark blue+green dual-accent theme; mechanically swept every raw inline hex/rgba literal across app/components that bypassed the CSS vars (506 hex + 326 rgb(a) replacements) since most of the app hardcoded colors rather than using tokens; removed all emoji, decorative gradients (Tailwind bg-gradient-to-* and raw linear/radial- gradient() in inline styles), confetti, and glow/blur decorative orbs; converted Navbar/Navigation to icon-only with aria-label+title. Finished two stopped agents' in-progress work: deleted the fake AnimatedStats/ LiveActivity/ProjectShowcase/Testimonials auth-panel components and cleaned up the emoji-laden feature list in (auth)/layout.tsx. Removed remaining fabricated stats (topics/topics/[slug] posts-per-week/ contributors/followers) per the no-fake-numbers rule. Rithub sign-in: added "Continue with Rithub" as an icon-only OAuth2 button (RithubMark component) on login/register, hidden "Continue with GitHub" when GITHUB_CLIENT_ID is unset (confirmed unset in prod). Backend: authenticateWithGitea in oauthService.ts exchanges the Gitea OAuth2 code, resolves identity via the existing ForgeConnection table (no schema migration needed), issues the same JWT/session as GitHub/Google login. OAuth2 app created live on rithub.dev via its REST API as admin user caelum0x; client id/secret stored in railyard-box's compose file (env files don't ship to the runtime image, so the actual wiring lives in docker-compose.yml, not backend/.env) and in ~/products/.env. Critical bug found and fixed while verifying: services/api.ts's global 401 interceptor redirected every anonymous visitor to /login a couple seconds after ANY page load -- including /login and /register themselves -- because the AuthBootstrap's background GET /auth/me (expected to 401 for signed-out visitors) was treated the same as a real session-expiry 401, triggering a refresh attempt, another 401, and a hard window.location.href redirect, which re-ran AuthBootstrap and repeated. Fixed by excluding /auth/me and /auth/refresh from that redirect path. Verified live with a fresh, cookie-less browser: previously looped /register -> /login forever; now stable after 6s. Also fixed: production CORS/API origin mismatch -- the frontend was built with NEXT_PUBLIC_API_URL pointing at ritgram.ereboslab.com while served from ritgram.rithub.dev, so every API call (login, register, etc.) was blocked by CORS; rebuilt with rithub.dev as canonical and CORS_ORIGIN allowing both domains. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
58 lines
2.0 KiB
Docker
58 lines
2.0 KiB
Docker
FROM node:20-alpine AS base
|
|
|
|
# --- Dependencies ---
|
|
FROM base AS deps
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json* ./
|
|
# Use `npm install` (not `npm ci`) — gitgram/web is an npm-workspace member, so its
|
|
# standalone lockfile can drift from package.json; install tolerates that and resolves
|
|
# the full dependency tree for the isolated image build.
|
|
RUN npm install --ignore-scripts --no-audit --no-fund
|
|
|
|
# --- Builder ---
|
|
FROM base AS builder
|
|
WORKDIR /app
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
# NEXT_PUBLIC_* vars are inlined into the client bundle at build time by Next.js --
|
|
# setting them only as a runtime `environment:` on the container (as the root
|
|
# docker-compose.yml does) has no effect on already-built client JS, so every
|
|
# browser falls back to the http://localhost:4000 default and gets
|
|
# ERR_CONNECTION_REFUSED. Accept them as build args so a real deploy can pass
|
|
# the real public API/WS origin.
|
|
ARG NEXT_PUBLIC_API_URL
|
|
ARG NEXT_PUBLIC_WS_URL
|
|
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
|
ENV NEXT_PUBLIC_WS_URL=${NEXT_PUBLIC_WS_URL}
|
|
# "Sign in with Rithub" OAuth2 (added 2026-11-17) — same build-time-inlining
|
|
# requirement as the API/WS URLs above.
|
|
ARG NEXT_PUBLIC_GITEA_CLIENT_ID
|
|
ARG NEXT_PUBLIC_GITEA_BASE_URL
|
|
ENV NEXT_PUBLIC_GITEA_CLIENT_ID=${NEXT_PUBLIC_GITEA_CLIENT_ID}
|
|
ENV NEXT_PUBLIC_GITEA_BASE_URL=${NEXT_PUBLIC_GITEA_BASE_URL}
|
|
RUN npm run build
|
|
|
|
# --- Production ---
|
|
FROM base AS runner
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
ENV PORT=3000
|
|
ENV HOSTNAME="0.0.0.0"
|
|
|
|
RUN addgroup --system --gid 1001 nodejs && \
|
|
adduser --system --uid 1001 nextjs
|
|
|
|
COPY --from=builder /app/public ./public
|
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
|
|
USER nextjs
|
|
EXPOSE 3000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD wget -qO- http://localhost:3000/ || exit 1
|
|
|
|
CMD ["node", "server.js"]
|