Port upstream PR #22 + Lite style updates:
- lib/audit.js: server-side logAudit(req, action, userId), records
IP from x-forwarded-for / cf-connecting-ip
- login/register/create_post/create_reply record server-side
- Remove client logEvent calls (AppProvider/NewPost/ReplyList)
- Remove forgeable POST /api/event-logs endpoint
- CustomPage: fullscreen immersive (fixed, 100vh-nav, mobile 56px
nav offset) matching upstream Lite
Remove global flex-wrap, add @media (max-width:480px) flex-wrap: wrap. Wide: one line. Narrow: flex-wrap naturally wraps buttons as whole units (white-space:nowrap prevents text split).
Removed compact media query. reply-header gets flex-wrap: wrap so buttons wrap as whole units when width is insufficient (white-space:nowrap prevents text splitting).
- reply_to_id UUID FK: precise parent tracking (username was ambiguous
when same user wrote multiple replies in a chain)
- GET /api/replies: JOIN replies + users to return reply_to_username
- POST /api/replies: accept reply_to_id (UUID) instead of reply_to_username
- Frontend depth calc: follow reply_to_id chain (not username)
- Preview bar: resolve username from local replies by ID
- Indicator scroll: target by data-reply-id
- Replies: compute nesting depth via reply_to_username chain (depth
tracking, max 5 levels, 18px indent per level)
- Post detail card: add border-radius var(--radius)
- Reply preview bar: cleaner bottom-border style (no blue box)
- Replies with a reply_to target get left-border + indent (Discourse
thread feel) via :has() selector
- Reply-box preview bar: removed blue box, now a clean bottom-border
row (回复 @user + 取消 button)
- reply-to indicator: left border line, primary on hover
- Works in light & dark mode (uses --border/--text-light vars)
- Reply button: always visible (opacity 0.5), only icon (no text),
hover → full opacity + primary color
- Works on own replies (no restriction on replying to self)
- Removed .reply-item:hover .reply-btn (was requiring parent hover)
- Each reply shows a 回复 button on hover (always visible on touch)
- Click: sets '正在回复 @user' banner, smooth-scrolls to reply box,
focuses textarea; 取消 clears it
- New reply icon (corner-up-left); clear replyTo after submit
- Reply markdown already rendered via renderMarkdown (sanitized)
- /api/users: mark is_super for the earliest-registered admin (matches
the auto-promotion migration semantics)
- AdminUsers: render 超级管理员 badge for is_super, 管理员 otherwise
- i18n keys admin.user.roleSuper (zh/en)
- Mobile settings nav: active tab gets top-left/top-right rounded
corners only (desktop unchanged)
users PK is UUID (no uid=1), so bootstrap super admin via semantics:
if no admin exists, promote the user with earliest created_at. Idempotent
(no-op when an admin already exists), safe on any existing database.
Matches the admin-list ordering (earliest user at the bottom).
Root becomes flex column (header fixed, layout flex:1); scroll
container uses flex:1 + minHeight:0 instead of fixed height:70vh so
portrait/phone screens get full remaining height instead of a short
squished panel.
Dev-only origin allowlist stays 127.0.0.1 by default; LAN devices can
be enabled per-machine via ALLOWED_DEV_ORIGINS=ip1,ip2 without touching
the repo.
One build job pushes linux/amd64 + linux/arm64 together — buildx
creates the multi-arch :next manifest automatically. No manifest job,
no PAT, no repo filter. Node 24.
- IMAGE_NAME pinned to lezi-fun/forumlify-deploy (not github.repository)
- login uses secrets.GHCR_TOKEN (PAT with packages:write) so any repo
(upstream Furrium/forumlify included) can publish to lezi-fun GHCR
- removed repo filter
Add job-level if: github.repository == 'lezi-fun/forumlify-deploy' so
pushes to Furrium/forumlify don't trigger broken builds (uppercase repo
name invalid for docker, and image would target wrong GHCR).
Separate amd64/arm64 jobs push :next-amd64 / :next-arm64; add manifest
job that merges them into :next, :main, semver and sha tags so the
branch tag is a real multi-arch manifest (both platforms).
node:24-windowsservercore* / nanoserver don't exist on Docker Hub (Node
stopped publishing Windows container images; even node:20 Windows tags
are gone). Keep linux/amd64 + linux/arm64 on node 24.
- Linux: build-push-action platforms linux/amd64,linux/arm64
- Windows: separate job on windows-latest (switch to Windows container
engine, native docker build with Dockerfile.windows) → :next-windows
- Dockerfile.windows: node:20-windowsservercore-ltsc2022, bun install,
standalone output
- posts API: ORDER BY is_pinned DESC, pinned_at DESC NULLS LAST before
sort (matches upstream) — pinned posts now appear first
- docker-compose: app service pulls ghcr.io/lezi-fun/forumlify-deploy:next
instead of local build (auto-rebuilt on push)
initOpenNextCloudflareForDev() runs when next.config.js loads → spawns
workerd binary (missing in Docker/node:20-alpine) → build crashes with
ENOENT. The hook is only for opennextjs-cloudflare preview (dev);
production build/deploy doesn't need it.
Docker build failed at npm run build: stale package-lock.json pins
react@18 while next@16 requires react@19. Switch builder to bun install
(bun.lock is current). Add .dockerignore (was shipping 700MB context).
- layout (server): derive language from cookie (user choice) > browser
Accept-Language; set <html lang> accordingly
- I18nInit → I18nProvider: sync initI18n(lng) before children render
(SSR/CSR first render same language, no hydration mismatch)
- setAppLanguage also writes cookie so SSR first paint uses chosen lang
- Verified: en browser → lang=en, zh → zh-CN, cookie overrides
- PostDetail: replies open as drawer (grid-rows animation) automatically
after post loads — no toggle button
- SettingsPage: outer frame overflow hidden (100vh), only inner panel
scrolls; hide #app layout when not on feed (fixes navbar moving when
scrolling settings)
- Title: metadata 'Loading...' → 'Forumlify' (Next resets <title> to
metadata on re-render → title became Loading... after load); unify
title effect (rotate Loading. only while !ready && !forumNameLoaded)
- AdminLinks: link divider uses var(--border) (was #f1f5f9, invisible
in dark mode); add admin.link i18n keys
- AdminPage i18n nav labels