客服推送处理+后台操作

This commit is contained in:
Yeomai committed 2026-09-30 20:57:47 +08:00
1 parent b652132957
commit a81c637a98
11 files changed
+302 -54

No files matched your search

+40 -18
View File
@@ -23,27 +23,38 @@ $Config = @{
NginxBin = '/www/server/nginx/sbin/nginx'
# ---- yelaymaths_api ----
# The build runs on your machine; the server only receives build output.
Api = @{
Key = 'api'
Label = 'yelaymaths_api (server API)'
LocalPath = 'yelaymaths_api'
RemotePath = '/www/wwwroot/yelaymaths/yelaymaths_api'
# Build output only. 'prisma' carries the schema + migrations so you can still run
# `pnpm prisma:migrate` on the server. Source (src / tools / tsconfig …) is never uploaded.
DeployPaths = @(
'src', 'prisma', 'tools',
'package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml',
'tsconfig.json', 'tsconfig.build.json', 'nest-cli.json',
'.env.example'
'dist', 'prisma',
'package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml'
)
InstallCmd = 'pnpm install --frozen-lockfile'
BuildCmd = 'pnpm build'
# Compile locally so the server never spends CPU on a build.
LocalBuildCmd = 'pnpm prisma:generate && pnpm build'
# Opt-in via -WithInstall. The server's global pnpm is 8.x and cannot read our
# v9+ lockfile, so npx fetches a matching pnpm into its cache instead.
InstallCmd = 'npx --yes pnpm@10.27.0 install --frozen-lockfile'
# Already built locally — do not rebuild on the server.
BuildCmd = ''
# Directories to delete on the server before unpacking, so files removed locally do
# not linger. Leave empty ('@()') when the build output is fully overwritten.
CleanPaths = @()
# Restart command. Run `pm2 list` on the server to find the process name.
# Leave empty ('') if you restart the process some other way.
RestartCmd = 'pm2 restart yelaymaths-api'
# Start command. Used when killing the old process is not enough
# (BT Panel does not bring it back automatically). setsid + nohup keeps
# the process alive after the SSH session ends. Leave empty to skip.
# Restart command: kills the old process so the new build is picked up
# (Node reads code into memory at startup — uploading alone changes nothing).
# If PM2 / systemd already keeps it running, use e.g. 'pm2 restart yelaymaths-api'
# and leave StartCmd empty ('').
RestartCmd = 'pkill -f "dist/main.js" || true'
# Start command. BT Panel does not bring the process back after it is killed,
# so we start it ourselves; setsid + nohup keeps it alive after the SSH session ends.
# `node` resolves through the NodeBin PATH exported by the remote script.
# Leave empty ('') to skip.
StartCmd = 'setsid nohup node dist/main.js >> /www/wwwlogs/yelaymaths-api.out.log 2>&1 < /dev/null &'
# Probe after start. The deploy fails if this URL does not answer in 30s.
HealthUrl = 'http://127.0.0.1:3002/healthz'
@@ -53,19 +64,30 @@ $Config = @{
# NOTE: NEXT_PUBLIC_* values are inlined at build time, so .env.local must already
# exist on the server before the first deploy. It is never uploaded (it is gitignored
# and not in the whitelist).
# As with the API, the build runs on your machine and only output is uploaded.
Admin = @{
Key = 'admin'
Label = 'yelaymaths_admin (admin console)'
LocalPath = 'yelaymaths_admin'
RemotePath = '/www/wwwroot/yelaymaths/yelaymaths_admin'
# Build output only: `next start` needs .next and next.config.ts at runtime.
DeployPaths = @(
'src',
'package.json', 'pnpm-lock.yaml',
'tsconfig.json', 'next.config.ts', 'postcss.config.mjs'
'.next',
'package.json', 'pnpm-lock.yaml', 'next.config.ts'
)
InstallCmd = 'pnpm install --frozen-lockfile'
BuildCmd = 'pnpm build'
RestartCmd = 'pm2 restart yelaymaths-admin'
# ~73 MB of build cache inside .next is not needed at runtime.
ExcludePaths = @('.next/cache', '.next/diagnostics', '.next/trace', '.next/types')
# Next serves pre-rendered pages straight from .next/cache instead of reading the files
# on disk, so a stale cache means "deployed and restarted, page unchanged".
CleanPaths = @('.next/cache')
# Same as the API: built locally, never rebuilt on the server.
LocalBuildCmd = 'pnpm build'
InstallCmd = 'npx --yes pnpm@10.27.0 install --frozen-lockfile'
BuildCmd = ''
# next start reads pages into memory as well — restart or the old build keeps serving.
# 'next-server' is its process name.
RestartCmd = 'pkill -f "next-server" || true'
# Kill first, then bring it back up ourselves; no BT Panel click needed.
StartCmd = 'setsid nohup node node_modules/next/dist/bin/next start -p 3001 >> /www/wwwlogs/yelaymaths-admin.out.log 2>&1 < /dev/null &'
HealthUrl = 'http://127.0.0.1:3001/'
}