feat(deploy): production deployment setup and fixes

- Debian-based api image (bookworm-slim), docker/debian mirrors, prisma
  binaryTargets for openssl 3.0
- nginx: admin SPA under /admin, TLS via acme.sh (ZeroSSL) + auto-renewal
  cron, http->https redirect
- prisma: add origin_goods.delisted migration, sync missing schema
  (good_image/tag_font_color/good_tags), fix users.createdAt Timestamptz
- api: CORS wildcard reflection, helmet CORP cross-origin, price
  backfill in persistProductDetail, categoryIcon ancestor fallback,
  mediaByColor per-color gallery in public goods detail
- admin: /admin base path (vite + router)
- import-data.mjs: udt_name casting, serial sequence advance fix
This commit is contained in:
yeuimu
2026-08-26 14:23:09 +08:00
parent be0b90e68f
commit 6c61a4e871
982 changed files with 74156 additions and 179393 deletions
@@ -1,51 +0,0 @@
#!/usr/bin/env node
/**
* CLI helper: discard pending manual edits from the buffer without applying.
*
* Reads .impeccable/live/pending-manual-edits.json, drops entries, writes back.
* No source-file writes. Use this when the user wants to throw away unsaved
* manual edits.
*
* Trigger: only when the user explicitly asks the AI to discard / throw away /
* clear pending manual edits.
*
* Usage:
* node live-discard-manual-edits.mjs # discard all pending
* node live-discard-manual-edits.mjs --page-url=/ # discard only entries for "/"
*
* Output JSON: { discarded: N, entries: [...discardedEntries], totalCount: N }
*/
import { readBuffer, removeEntries, truncateBuffer } from './live-manual-edits-buffer.mjs';
function argVal(args, name) {
const prefix = name + '=';
for (const a of args) {
if (a === name) return true;
if (a.startsWith(prefix)) return a.slice(prefix.length);
}
return null;
}
const args = process.argv.slice(2);
if (args.includes('--help') || args.includes('-h')) {
console.log('Usage: node live-discard-manual-edits.mjs [--page-url=<url>]');
process.exit(0);
}
const pageUrlFilter = argVal(args, '--page-url');
const cwd = process.cwd();
let discarded;
let entries;
const buffer = readBuffer(cwd);
if (pageUrlFilter) {
entries = buffer.entries.filter((entry) => entry.pageUrl === pageUrlFilter);
discarded = removeEntries(cwd, (entry) => entry.pageUrl === pageUrlFilter);
} else {
entries = buffer.entries;
discarded = truncateBuffer(cwd);
}
const remaining = readBuffer(cwd).entries.reduce((n, e) => n + e.ops.length, 0);
console.log(JSON.stringify({ discarded, entries, totalCount: remaining }));