Extract memind_adm admin server, add local dev tooling, and remove image-generation.

Split platform admin and ops APIs into standalone admin-server.mjs with network guards; simplify billing to RMB token pricing, refactor user auth, and add rsync deploy plus local-test scripts and docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Your Name
2026-06-17 16:39:39 -07:00
parent ab0718938e
commit b0f5d6a51c
98 changed files with 5394 additions and 3010 deletions
+2 -6
View File
@@ -1,5 +1,4 @@
import crypto from 'node:crypto';
import { loadBillingConfig } from './billing.mjs';
export function loadRechargeConfig() {
const tiers = (process.env.H5_RECHARGE_TIERS_CENTS ?? '500,1000,3000,5000,10000,20000')
@@ -9,8 +8,8 @@ export function loadRechargeConfig() {
return {
tiersCents: tiers.length ? tiers : [500, 1000, 3000, 5000, 10000, 20000],
minRechargeCents: Number(process.env.H5_MIN_RECHARGE_CENTS ?? 500),
orderTtlMs: Number(process.env.H5_RECHARGE_ORDER_TTL_MS ?? 3 * 60 * 1000),
maxPendingOrders: Number(process.env.H5_RECHARGE_MAX_PENDING ?? 5),
orderTtlMs: Number(process.env.H5_RECHARGE_ORDER_TTL_MS ?? 15 * 60 * 1000),
maxPendingOrders: Number(process.env.H5_RECHARGE_MAX_PENDING ?? 3),
dailyLimitCents: Number(process.env.H5_RECHARGE_DAILY_LIMIT_CENTS ?? 200_000),
};
}
@@ -105,14 +104,11 @@ export function createRechargeService(pool, { userAuth, wechatPay, config = load
const getBillingConfig = async (userId) => {
const user = await userAuth.getUserById(userId);
const billing = loadBillingConfig();
return {
wechatEnabled: Boolean(wechatPay?.enabled),
tiersCents: config.tiersCents,
minRechargeCents: config.minRechargeCents,
balanceCents: user ? Number(user.balance_cents ?? 0) : 0,
inputCentsPer1k: billing.inputCentsPer1k,
outputCentsPer1k: billing.outputCentsPer1k,
};
};