Re-implement the IAM-only rip on the re-rooted @hanzochat main (the old
auth/iam-only branch shares no history and is unmergeable). @hanzo/iam owns
every credential step via redirect-PKCE to hanzo.id; /auth/callback completes
the token exchange.
Client
- iam.ts: one always-configured IAM SDK singleton (env + prod defaults
hanzo.id / hanzo-chat), redirect_uri ${origin}/auth/callback
- Login.tsx: single "Log in with Hanzo" -> signinRedirect(); auto-redirect
on mount unless ?redirect=false
- drop LoginForm, Registration, ResetPassword, RequestPasswordReset,
SocialButton, SocialLoginRender (+ specs); drop the register / forgot /
reset routes
- GuestLimitDialog / LandingPage / login.ts: login = IAM signinRedirect
Server
- delete local + third-party passport strategies (local, apple, discord,
facebook, github, google, ldap, saml) and their specs
- keep jwt / openid / openidJwt strategies for IAM JWT validation
- socialLogins: Hanzo IAM (OpenID Connect) only
- auth routes: drop /login, /register, /requestPasswordReset, /resetPassword
- remove dead requireLocalAuth / requireLdapAuth middleware + LoginController
Build
- give the @hanzochat/api rollup enough heap (cross-env
NODE_OPTIONS=--max-old-space-size=8192) to fix the OOM exit 134
- raise the Dockerfile heap default to 8192 to match
67 lines
2.5 KiB
Docker
67 lines
2.5 KiB
Docker
# v0.8.3-rc1
|
|
|
|
# Base node image — Hanzo Node 24 (Alpine) base: node:sqlite (DatabaseSync) is
|
|
# built in and native better-sqlite3 compiles (build-base + python3 + g++ baked
|
|
# in), so the CHAT_STORE_SQLITE document store runs. Node 20 lacked node:sqlite.
|
|
FROM ghcr.io/hanzoai/nodejs:v24.18.0 AS node
|
|
|
|
# Install jemalloc
|
|
RUN apk add --no-cache jemalloc
|
|
RUN apk add --no-cache python3 py3-pip uv
|
|
|
|
# Set environment variable to use jemalloc
|
|
ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2
|
|
|
|
# Enable pnpm via corepack
|
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
|
|
# Add `uv` for extended MCP support
|
|
COPY --from=ghcr.io/astral-sh/uv:0.9.5-python3.12-alpine /usr/local/bin/uv /usr/local/bin/uvx /bin/
|
|
RUN uv --version
|
|
|
|
# Set configurable max-old-space-size with default
|
|
ARG NODE_MAX_OLD_SPACE_SIZE=8192
|
|
|
|
RUN mkdir -p /app && chown node:node /app
|
|
WORKDIR /app
|
|
|
|
USER node
|
|
|
|
COPY --chown=node:node package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
|
|
COPY --chown=node:node api/package.json ./api/package.json
|
|
COPY --chown=node:node client/package.json ./client/package.json
|
|
COPY --chown=node:node packages/data-provider/package.json ./packages/data-provider/package.json
|
|
COPY --chown=node:node packages/data-schemas/package.json ./packages/data-schemas/package.json
|
|
COPY --chown=node:node packages/api/package.json ./packages/api/package.json
|
|
COPY --chown=node:node packages/client/package.json ./packages/client/package.json
|
|
|
|
RUN \
|
|
# Allow mounting of these files, which have no default
|
|
touch .env ; \
|
|
# Create directories for the volumes to inherit the correct permissions
|
|
mkdir -p /app/client/public/images /app/logs /app/uploads ; \
|
|
pnpm install --frozen-lockfile
|
|
|
|
COPY --chown=node:node . .
|
|
|
|
# Bake the Umami analytics website id into the Vite build so the index.html
|
|
# %VITE_ANALYTICS_SITE_ID% placeholder is substituted at build time. Vite's HTML
|
|
# env replacement (loadEnv, envPrefix includes VITE_) picks this up from process.env.
|
|
# Without it the tracker POSTs a literal "%VITE_ANALYTICS_SITE_ID%" as the website
|
|
# id and analytics.hanzo.ai/api/send answers 400. Public site identifier (it appears
|
|
# in the served HTML), safe to default here; override with --build-arg if needed.
|
|
ARG VITE_ANALYTICS_SITE_ID=2f72b944-f1f8-4d2d-8f6c-26063bde0d1a
|
|
ENV VITE_ANALYTICS_SITE_ID=$VITE_ANALYTICS_SITE_ID
|
|
|
|
RUN \
|
|
# React client build with configurable memory
|
|
NODE_OPTIONS="--max-old-space-size=${NODE_MAX_OLD_SPACE_SIZE}" pnpm run frontend; \
|
|
pnpm store prune
|
|
|
|
# Node API setup
|
|
EXPOSE 3080
|
|
ENV HOST=0.0.0.0
|
|
CMD ["pnpm", "run", "backend"]
|
|
|
|
# cache-bust: 1774514777
|