feat: add task workflow and asset downloads

This commit is contained in:
inman
2026-05-29 12:32:02 +08:00
parent f9c3393f84
commit 63e62d444c
61 changed files with 2773 additions and 2181 deletions

View File

@@ -8,19 +8,19 @@ export function rootDir(): string {
}
export function runtimeDir(): string {
return process.env.NIANXXPLAY_RUNTIME_DIR || join(rootDir(), ".runtime");
return process.env.ZHINIAN_RUNTIME_DIR || join(rootDir(), ".runtime");
}
export function dataDir(): string {
return process.env.NIANXXPLAY_DATA_DIR || join(runtimeDir(), "data");
return process.env.ZHINIAN_DATA_DIR || join(runtimeDir(), "data");
}
export function uploadDir(): string {
return process.env.NIANXXPLAY_UPLOAD_DIR || join(runtimeDir(), "uploads");
return process.env.ZHINIAN_UPLOAD_DIR || join(runtimeDir(), "uploads");
}
export function resultDir(): string {
return process.env.NIANXXPLAY_RESULT_DIR || join(runtimeDir(), "generated-results");
return process.env.ZHINIAN_RESULT_DIR || join(runtimeDir(), "generated-results");
}
export async function ensureRuntimeDirs(): Promise<void> {
@@ -36,7 +36,7 @@ export function localRuntimePath(...parts: string[]): string {
}
export function requestOrigin(request: Request): string {
const configured = process.env.NEXT_PUBLIC_APP_URL || process.env.NIANXXPLAY_PUBLIC_BASE_URL;
const configured = process.env.NEXT_PUBLIC_APP_URL || process.env.ZHINIAN_PUBLIC_BASE_URL;
if (configured) return normalizePublicOrigin(configured);
return normalizePublicOrigin(new URL(request.url).origin);
}