feat: 支持自定义订阅节点并兼容现有数据库

This commit is contained in:
2026-09-29 11:52:41 +08:00
parent 3faf960f35
commit ab7d1c937a
27 changed files with 2203 additions and 449 deletions
+15 -6
View File
@@ -18,11 +18,20 @@ export async function GET(
return new NextResponse("node not found", { status: 404 });
}
return new NextResponse(buildNodeHy2Config(node, getOriginFromRequest(request)), {
status: 200,
headers: {
"Content-Type": "application/x-yaml; charset=utf-8",
"Content-Disposition": `attachment; filename="${slug}.config.yaml"`,
if (node.node_type !== "hy2") {
return new NextResponse("hy2 config unavailable for custom node", {
status: 409,
});
}
return new NextResponse(
buildNodeHy2Config(node, getOriginFromRequest(request)),
{
status: 200,
headers: {
"Content-Type": "application/x-yaml; charset=utf-8",
"Content-Disposition": `attachment; filename="${slug}.config.yaml"`,
},
},
});
);
}