Commit Graph
255 Commits
Author SHA1 Message Date

2026-08-12

lezi 56a5fc903e Update README.md 2026-08-12 10:49:50 +08:00
lezi-fun ac0bd3fe0e chore: add Next.js agent guidance 2026-08-12 10:25:35 +08:00
lezi-fun bbf3262aff feat: animate user profile transitions 2026-08-12 10:24:20 +08:00
lezi 8e67e82eb0 Update docker-compose.yml 2026-08-12 09:57:01 +08:00
lezi-fun 9ae54dff29 fix: synchronize post return handoff 2026-08-12 09:55:13 +08:00
lezi-fun 5e9909ac7a fix: reverse post return transition 2026-08-12 09:34:28 +08:00
lezi-fun 3b4b598ce5 fix: smooth pinned and loading animations 2026-08-12 09:14:55 +08:00
lezi-fun b9d6ca5da8 security: server-owned audit logs + fullscreen custom pages
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
2026-08-12 09:06:50 +08:00

2026-08-11

lezi-fun 45ace3ba75 cleanup: remove chain view + show-more, all replies always visible 2026-08-11 22:26:02 +08:00
lezi-fun 0aac277aea Revert "feat: reply chain view (sub-thread folding)"
This reverts commit 4c0f146338.
2026-08-11 22:22:18 +08:00
lezi-fun 4c0f146338 feat: reply chain view (sub-thread folding)
Build reply tree, show up to 3 children per reply. '继续此消息串' opens a dedicated chain view (only that reply + all descendants). '返回所有回复' goes back.
2026-08-11 22:21:09 +08:00
lezi-fun 84616ff4a1 feat: remove reply indicator, dynamic folding (min 3 replies)
Remove per-reply '正在回复 @xxx' indicator. Collapse replies: show count based on viewport height (min 3). Clean up unused CSS.
2026-08-11 22:07:10 +08:00
lezi-fun a57d29ceed feat: collapse replies (show last 5, 继续此消息串)
When >5 replies, show the latest 5 and a '继续此消息串 (还有N条回复)' button. Click to expand all. Discourse-style folding.
2026-08-11 22:03:12 +08:00
lezi-fun b18cd05455 fix: narrow-only reply-header wrap
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).
2026-08-11 22:00:52 +08:00
lezi-fun 32fc3cb599 fix: reply-header flex-wrap (natural wrap, no 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).
2026-08-11 21:47:39 +08:00
lezi-fun f3586ef2aa fix: narrow screen compact reply buttons
Media query (max-width:480px): reply-header flex-wrap, smaller btn padding/ font-size, prevent overflow beyond card border.
2026-08-11 21:43:55 +08:00
lezi-fun 56912d28d6 fix: reply-delete-btn white-space:nowrap (prevent narrow-wrap split) 2026-08-11 21:41:43 +08:00
lezi-fun 6c100ff3a1 fix: reply chain uses reply_to_id (UUID) instead of reply_to_username
- 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
2026-08-11 21:38:45 +08:00
lezi-fun 59d5fb89c0 fix: nested replies keep border-radius (was set to 0 by indent rule) 2026-08-11 21:33:44 +08:00
lezi-fun 16af1cfd41 fix: reply nesting depth + post detail card radius
- 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)
2026-08-11 21:31:06 +08:00
lezi-fun d9c4079619 style: reply hierarchy + cleaner reply-preview bar
- 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)
2026-08-11 21:22:20 +08:00
lezi-fun 4d0d5edec3 feat: Discourse-style reply-to indicator (↩ @username)
- replies table: add reply_to_username column
- POST /api/replies: accept reply_to_username param
- GET /api/replies: LEFT JOIN users to return reply_to_username
- ReplyList: submit replyTo as reply_to_username on create
- UI: each reply shows '↩ 正在回复 @username' indicator (clickable,
  scrolls to target reply)
- data-username attribute on .reply-item for scroll targeting
2026-08-11 21:18:18 +08:00
lezi-fun 7bf9e37036 fix: reply button always visible (mail-style icon), works on own replies
- 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)
2026-08-11 21:08:55 +08:00
lezi-fun 2bb1f4227e feat: hover reply button → quote + scroll to reply box
- 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)
2026-08-11 20:57:48 +08:00
lezi-fun d757bde780 feat: super admin badge — earliest admin shows 超级管理员 in user list
- /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)
2026-08-11 20:40:02 +08:00
lezi-fun f0867935ac fix: mobile narrow — post action buttons wrap to own row
@media (max-width:640px): .post-header flex-wrap; .post-detail-controls
full-width right-aligned row (no more icon/text split across lines).
2026-08-11 20:34:05 +08:00
lezi-fun 7188d07aea security: server-side CAPTCHA (HMAC-signed) + magic-byte upload sniff + pagination bounds
Port upstream ac4af62 + PR #14/#17:
- lib/captcha.js: HMAC(CAPTCHA_SECRET, id:answer) challenge; GET
  /api/captcha returns {id, text, sig}; register/createPost/createReply
  verify answer server-side (bad answer / forged sig rejected)
- Frontend (Modals/NewPost/ReplyList): fetch challenge from server,
  submit id+answer+sig; no more client-side answer check (was bypassable)
- Upload: sniff JPEG/PNG/GIF/WebP magic bytes (ignore client MIME), UUID
  filenames — blocks spoofed HTML-as-image (stored XSS)
- Posts pagination: limit cap 50, page cap (deep-pagination DoS)
- CAPTCHA_SECRET env (falls back to JWT_SECRET)
2026-08-11 20:25:16 +08:00
lezi-fun 2780dab8e2 feat: auto-promote earliest-registered user to super admin (idempotent)
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).
2026-08-11 20:05:36 +08:00
Furrium Network 684d502deb Update README.md 2026-08-11 20:03:42 +08:00
Furrium Network 1fcea44c49 Update README.md 2026-08-11 20:02:25 +08:00
Furrium Network 07cf69b723 Update README.md 2026-08-11 20:01:41 +08:00
lezi-fun 4ff8488587 fix: settings page portrait layout — flex fill instead of fixed 70vh
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.
2026-08-11 19:48:32 +08:00
lezi-fun 8e538fea80 chore: allowedDevOrigins reads ALLOWED_DEV_ORIGINS env (no hardcoded IPs)
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.
2026-08-11 19:40:52 +08:00
lezi-fun dfe3556987 ci: revert to single multi-arch build job (simplest working version)
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.
2026-08-11 19:27:22 +08:00
lezi-fun ab069c4b91 ci: fixed image name + PAT login (publish from upstream next to lezi-fun GHCR)
- 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
2026-08-11 19:26:44 +08:00
lezi-fun 8cbde6dbc4 ci: only build GHCR image in forumlify-deploy repo (skip upstream)
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).
2026-08-11 19:22:35 +08:00
lezi-fun d074e27418 ci: fix manifest merge — newline in tags broke shell loop 2026-08-11 19:18:12 +08:00
lezi-fun f96d21ade7 ci: merge per-arch tags into multi-arch manifests (:next etc.)
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).
2026-08-11 19:13:46 +08:00
lezi-fun de69cd81a1 ci: drop Windows image (official node Windows base images removed)
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.
2026-08-11 19:09:27 +08:00
lezi-fun 1cfc61ff45 ci: node 24 + per-platform jobs (linux-amd64, linux-arm64, win64)
- Dockerfile/Dockerfile.windows: node 20 → 24
- 3 parallel jobs: linux/amd64, linux/arm64 (buildx, -arch tags),
  win64 (windows-latest native Windows containers, :next-windows)
- winarm64 dropped (no official Windows ARM64 node base image)
2026-08-11 19:05:48 +08:00
lezi-fun cc90c93673 ci: multi-arch images — linux/amd64 + linux/arm64 + windows/amd64
- 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
2026-08-11 18:59:22 +08:00
lezi-fun 7c6b816ac7 fix: pinned posts not sorted to top + compose pulls GHCR image
- 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)
2026-08-11 18:55:10 +08:00
lezi-fun d265caa5bf ci: build & push Docker image to GHCR on push/tag
Trigger: push to next/main, semver tags, manual dispatch.
Tags: branch name, semver, git sha. Uses GHA cache.
2026-08-11 18:17:53 +08:00
lezi-fun d349660944 fix: remove stray merge conflict marker in schema.sql
Line '<<<<<<< HEAD' (no matching =======/>>>>>>>) broke postgres
init in Docker (db container exited 3 → all API 500). Remove it.
2026-08-11 18:06:45 +08:00
lezi 66047c0c4b Delete bun.lock 2026-08-11 18:03:28 +08:00
lezi-fun d304e7e863 fix: remove OpenNext dev hook from next.config (spawns workerd in build)
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.
2026-08-11 18:00:03 +08:00
lezi-fun a53304cefa fix(docker): use bun install (npm reads stale lockfile → react 18) + .dockerignore
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).
2026-08-11 17:56:42 +08:00
lezi-fun dce94fd5af feat: auto-detect browser language (SSR Accept-Language + cookie)
- 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
2026-08-11 17:42:08 +08:00
lezi 08302dc0d7 Update LICENSE 2026-08-11 17:36:34 +08:00
lezi-fun 5a9a454ef3 fix: replies drawer auto-expand, settings no-scroll, title bug, admin links
- 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
2026-08-11 17:35:48 +08:00