diff --git a/.githooks/post-receive b/.githooks/post-receive index c02ba4e2..d5020949 100755 --- a/.githooks/post-receive +++ b/.githooks/post-receive @@ -11,11 +11,11 @@ REPO_TOPLEVEL="$(git rev-parse --show-toplevel 2>/dev/null || echo "$PWD")" cd "$REPO_TOPLEVEL" || { echo "FATAL: cannot cd to $REPO_TOPLEVEL" >&2; exit 1; } # ============================================================ -# 0. sync_worktree —— 将**工**作**树**同步到**新** push 的 HEAD +# 0. sync_worktree —— 将工作树同步到新 push 的 HEAD # 背景:服务器 .git/config 设了 receive.denyCurrentBranch=updateInstead 时 -# git 自**动**更**新**工作**树**但**会**跳过**此**钩子;**改**为 false 后 -# git **不**会**更**新**工作**树**,**手**动 reset --hard 同步**才**能**让**下**面** -# 的 build **用**上**新**代**码**。 +# git 自动更新工作树但会跳过此钩子;改为 false 后 +# git 不会更新工作树,手动 reset --hard 同步才能让下面 +# 的 build 用上新代码。 # ============================================================ sync_worktree() { echo "=== sync_worktree: git reset --hard HEAD @ $(date -u +%Y-%m-%dT%H:%M:%SZ) ===" @@ -23,7 +23,7 @@ sync_worktree() { } # ============================================================ -# 1. init_log_file —— 定**义** LOG_FILE + 创**建** logs/ 目**录** +# 1. init_log_file —— 定义 LOG_FILE + 创建 logs/ 目录 # ============================================================ init_log_file() { LOG_FILE="$REPO_TOPLEVEL/logs/post-receive.log" @@ -31,7 +31,7 @@ init_log_file() { } # ============================================================ -# 2. write_metadata_header —— **覆**盖写**入**元信息(**首**次**写** → **覆**盖**让日志**开**头是**这**个) +# 2. write_metadata_header —— 覆盖写入元信息(首次写 → 覆盖让日志开头是这个) # ============================================================ write_metadata_header() { { @@ -44,10 +44,10 @@ write_metadata_header() { } # ============================================================ -# 3. copy_env_by_branch —— 根**据**分支选 env-example → .env +# 3. copy_env_by_branch —— 根据分支选 env-example → .env # main 分支 → .env.production(prod 部署) -# test 分支 → .env.local(test **不**碰 .env.production,**避**免**读**到 prod 域名) -# dev 分支 → .env.local(**未**配远端**用**途,**但**保**留**) +# test 分支 → .env.local(test 不碰 .env.production,避免读到 prod 域名) +# dev 分支 → .env.local(未配远端用途,但保留) # ============================================================ copy_env_by_branch() { CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) @@ -72,8 +72,8 @@ copy_env_by_branch() { } # ============================================================ -# 4. run_build —— 跑 `pnpm run build`,输出**丢**,**捕**获退出码写日志 -# 返回:build 退出码(main **用** if ! run_build 决**定**是否**继**续) +# 4. run_build —— 跑 `pnpm run build`,输出丢,捕获退出码写日志 +# 返回:build 退出码(main 用 if ! run_build 决定是否继续) # ============================================================ run_build() { echo "=== build START @ $(date -u +%Y-%m-%dT%H:%M:%SZ) ===" >> "$LOG_FILE" @@ -85,10 +85,10 @@ run_build() { } # ============================================================ -# 5. stop_existing_next —— 两阶段 kill + 等 1s 确**保**端口**完**全释放 -# 1) 优**雅**关**闭**(SIGTERM)—— 旧**进**程**自**己 drain +# 5. stop_existing_next —— 两阶段 kill + 等 1s 确保端口完全释放 +# 1) 优雅关闭(SIGTERM)—— 旧进程自己 drain # 2) 等 2s -# 3) 强杀(SIGKILL)—— **还**在**的**话 +# 3) 强杀(SIGKILL)—— 还在的话 # 4) 等 1s # ============================================================ stop_existing_next() { @@ -104,10 +104,10 @@ stop_existing_next() { } # ============================================================ -# 6. launch_next —— 后**台**启 `pnpm run start`,捕 PID +# 6. launch_next —— 后台启 `pnpm run start`,捕 PID # ============================================================ launch_next() { - # next stdout/stderr 接**到** logs/next-server.log(**覆**盖**模式**,**每**次 deploy **重**新**开**始) + # next stdout/stderr 接到 logs/next-server.log(覆盖模式,每次 deploy 重新开始) NEXT_LOG_FILE="$REPO_TOPLEVEL/logs/next-server.log" echo "=== start LAUNCH @ $(date -u +%Y-%m-%dT%H:%M:%SZ) ===" >> "$LOG_FILE" nohup pnpm run start > "$NEXT_LOG_FILE" 2>&1 & @@ -116,30 +116,30 @@ launch_next() { } # ============================================================ -# 7. log_abort —— build 失败**时**写**结**束**标**记(**不**输**出** START LAUNCH) +# 7. log_abort —— build 失败时写结束标记(不输出 START LAUNCH) # ============================================================ log_abort() { echo "=== ABORTED @ $(date -u +%Y-%m-%dT%H:%M:%SZ) (build failed, start skipped) ===" >> "$LOG_FILE" } # ============================================================ -# main —— 调**度**所**有**步骤 +# main —— 调度所有步骤 # ============================================================ main() { init_log_file - sync_worktree # **先**同步工作**树**到**新** HEAD(**与** git config denyCurrentBranch 配**合**) - write_metadata_header # **先**覆盖写元信息(**这**样 env copy 日**志****能**保留在**后**面) - copy_env_by_branch # **追**加 env copy 日志 + sync_worktree # 先同步工作树到新 HEAD(与 git config denyCurrentBranch 配合) + write_metadata_header # 先覆盖写元信息(这样 env copy 日志能保留在后面) + copy_env_by_branch # 追加 env copy 日志 if ! run_build; then log_abort - exit $BUILD_EXIT # build 失败 → **不**启 start(**避**免**用**旧 .next **跑**新代码) + exit $BUILD_EXIT # build 失败 → 不启 start(避免用旧 .next 跑新代码) fi - stop_existing_next # build 成功 → **先**关旧**进**程 + stop_existing_next # build 成功 → 先关旧进程 launch_next # 再启新 } main "$@" -exit 0 +exit 0 \ No newline at end of file diff --git a/public/images/auth/bg-login.png b/public/images/auth/bg-login.png index c0f41606..b334ec62 100644 Binary files a/public/images/auth/bg-login.png and b/public/images/auth/bg-login.png differ diff --git a/public/images/auth/bg-login@2x.png b/public/images/auth/bg-login@2x.png deleted file mode 100644 index b334ec62..00000000 Binary files a/public/images/auth/bg-login@2x.png and /dev/null differ diff --git a/public/images/auth/bg-login@3x.png b/public/images/auth/bg-login@3x.png deleted file mode 100644 index d0ad877b..00000000 Binary files a/public/images/auth/bg-login@3x.png and /dev/null differ diff --git a/public/images/auth/ic-logo-login.png b/public/images/auth/ic-logo-login.png index d5b13922..5bf0e279 100644 Binary files a/public/images/auth/ic-logo-login.png and b/public/images/auth/ic-logo-login.png differ diff --git a/public/images/auth/ic-logo-login@2x.png b/public/images/auth/ic-logo-login@2x.png deleted file mode 100644 index 5bf0e279..00000000 Binary files a/public/images/auth/ic-logo-login@2x.png and /dev/null differ diff --git a/public/images/auth/ic-logo-login@3x.png b/public/images/auth/ic-logo-login@3x.png deleted file mode 100644 index 8f1c7084..00000000 Binary files a/public/images/auth/ic-logo-login@3x.png and /dev/null differ diff --git a/public/images/chat/bg-chatpage.png b/public/images/chat/bg-chatpage.png index a601d1f7..4c7268bf 100644 Binary files a/public/images/chat/bg-chatpage.png and b/public/images/chat/bg-chatpage.png differ diff --git a/public/images/chat/bg-chatpage@2x.png b/public/images/chat/bg-chatpage@2x.png deleted file mode 100644 index 4c7268bf..00000000 Binary files a/public/images/chat/bg-chatpage@2x.png and /dev/null differ diff --git a/public/images/chat/bg-chatpage@3x.png b/public/images/chat/bg-chatpage@3x.png deleted file mode 100644 index 757e2968..00000000 Binary files a/public/images/chat/bg-chatpage@3x.png and /dev/null differ diff --git a/public/images/chat/pic-chat-elio.png b/public/images/chat/pic-chat-elio.png index bef165af..1241d49f 100644 Binary files a/public/images/chat/pic-chat-elio.png and b/public/images/chat/pic-chat-elio.png differ diff --git a/public/images/chat/pic-chat-elio@2x.png b/public/images/chat/pic-chat-elio@2x.png deleted file mode 100644 index 1241d49f..00000000 Binary files a/public/images/chat/pic-chat-elio@2x.png and /dev/null differ diff --git a/public/images/chat/pic-chat-elio@3x.png b/public/images/chat/pic-chat-elio@3x.png deleted file mode 100644 index 57e5833a..00000000 Binary files a/public/images/chat/pic-chat-elio@3x.png and /dev/null differ diff --git a/public/images/chat/pic-chat-guest.png b/public/images/chat/pic-chat-guest.png index db11c15c..c315eaf8 100644 Binary files a/public/images/chat/pic-chat-guest.png and b/public/images/chat/pic-chat-guest.png differ diff --git a/public/images/chat/pic-chat-guest@2x.png b/public/images/chat/pic-chat-guest@2x.png deleted file mode 100644 index c315eaf8..00000000 Binary files a/public/images/chat/pic-chat-guest@2x.png and /dev/null differ diff --git a/public/images/chat/pic-chat-guest@3x.png b/public/images/chat/pic-chat-guest@3x.png deleted file mode 100644 index 0647382a..00000000 Binary files a/public/images/chat/pic-chat-guest@3x.png and /dev/null differ diff --git a/public/images/icons/ic-loading.png b/public/images/icons/ic-loading.png index d1428a1c..b95742eb 100644 Binary files a/public/images/icons/ic-loading.png and b/public/images/icons/ic-loading.png differ diff --git a/public/images/icons/ic-loading@2x.png b/public/images/icons/ic-loading@2x.png deleted file mode 100644 index b95742eb..00000000 Binary files a/public/images/icons/ic-loading@2x.png and /dev/null differ diff --git a/public/images/icons/ic-loading@3x.png b/public/images/icons/ic-loading@3x.png deleted file mode 100644 index 97aa0df7..00000000 Binary files a/public/images/icons/ic-loading@3x.png and /dev/null differ diff --git a/public/images/icons/icon-add-to-home.png b/public/images/icons/icon-add-to-home.png index 3f1a7ce6..4d4f53b1 100644 Binary files a/public/images/icons/icon-add-to-home.png and b/public/images/icons/icon-add-to-home.png differ diff --git a/public/images/icons/icon-add-to-home@2x.png b/public/images/icons/icon-add-to-home@2x.png deleted file mode 100644 index 4d4f53b1..00000000 Binary files a/public/images/icons/icon-add-to-home@2x.png and /dev/null differ diff --git a/public/images/icons/icon-add-to-home@3x.png b/public/images/icons/icon-add-to-home@3x.png deleted file mode 100644 index 7bf37e60..00000000 Binary files a/public/images/icons/icon-add-to-home@3x.png and /dev/null differ diff --git a/public/images/icons/icon-navigation-guest.png b/public/images/icons/icon-navigation-guest.png index 879fca6d..9e14f6ee 100644 Binary files a/public/images/icons/icon-navigation-guest.png and b/public/images/icons/icon-navigation-guest.png differ diff --git a/public/images/icons/icon-navigation-guest@2x.png b/public/images/icons/icon-navigation-guest@2x.png deleted file mode 100644 index 9e14f6ee..00000000 Binary files a/public/images/icons/icon-navigation-guest@2x.png and /dev/null differ diff --git a/public/images/icons/icon-navigation-guest@3x.png b/public/images/icons/icon-navigation-guest@3x.png deleted file mode 100644 index 5be825d7..00000000 Binary files a/public/images/icons/icon-navigation-guest@3x.png and /dev/null differ diff --git a/public/images/splash/ic-logo-home.png b/public/images/splash/ic-logo-home.png index 5bf3fa0d..b6340a0e 100644 Binary files a/public/images/splash/ic-logo-home.png and b/public/images/splash/ic-logo-home.png differ diff --git a/public/images/splash/ic-logo-home@2x.png b/public/images/splash/ic-logo-home@2x.png deleted file mode 100644 index b6340a0e..00000000 Binary files a/public/images/splash/ic-logo-home@2x.png and /dev/null differ diff --git a/public/images/splash/ic-logo-home@3x.png b/public/images/splash/ic-logo-home@3x.png deleted file mode 100644 index 09d8247e..00000000 Binary files a/public/images/splash/ic-logo-home@3x.png and /dev/null differ diff --git a/public/images/splash/pic-bg-home.png b/public/images/splash/pic-bg-home.png index 8079c6ab..053e9ad6 100644 Binary files a/public/images/splash/pic-bg-home.png and b/public/images/splash/pic-bg-home.png differ diff --git a/public/images/splash/pic-bg-home@2x.png b/public/images/splash/pic-bg-home@2x.png deleted file mode 100644 index 053e9ad6..00000000 Binary files a/public/images/splash/pic-bg-home@2x.png and /dev/null differ diff --git a/public/images/splash/pic-bg-home@3x.png b/public/images/splash/pic-bg-home@3x.png deleted file mode 100644 index 37377076..00000000 Binary files a/public/images/splash/pic-bg-home@3x.png and /dev/null differ