feat(docker): prepare portable images with runtime hotel configuration
This commit is contained in:
1 parent
745d0b7247
commit
c4496e710b
28 files changed
+622
-104
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import { type NextRequest, NextResponse } from "next/server";
|
||||
import sharp from "sharp";
|
||||
import { resolveImagerBase } from "@/lib/imager";
|
||||
import { resolveImagerBase } from "@/lib/runtime-asset-config";
|
||||
|
||||
const FIGURE_RE = /^([a-z]{2}-\d+)(\.[a-z]{2}-\d+)*$/i;
|
||||
const FIGURE_RE = /^[a-z]{2}-\d+(?:-\d+)*(?:\.[a-z]{2}-\d+(?:-\d+)*)*$/i;
|
||||
const FIGURE_MAX_LEN = 512;
|
||||
const FIGURE_MAX_PARTS = 24;
|
||||
const UPSTREAM_TIMEOUT_MS = 10_000;
|
||||
@@ -82,8 +82,9 @@ export async function GET(request: NextRequest) {
|
||||
|
||||
const format = resolveFormat(searchParams.get("format"));
|
||||
|
||||
const upstream = resolveImagerBase();
|
||||
const upstreamUrl = `${upstream}?${params.toString()}`;
|
||||
const upstream = resolveImagerBase(new URL(request.url).origin);
|
||||
const upstreamUrl = new URL(upstream);
|
||||
for (const [key, value] of params) upstreamUrl.searchParams.set(key, value);
|
||||
|
||||
try {
|
||||
const res = await fetch(upstreamUrl, {
|
||||
|
||||
Reference in new issue
Block a user