diff --git a/server/app/api/instances/route.ts b/server/app/api/instances/route.ts index 73dcd0b..2375ef5 100644 --- a/server/app/api/instances/route.ts +++ b/server/app/api/instances/route.ts @@ -115,7 +115,18 @@ export async function PATCH(req: NextRequest) { }); if (!sent) await prisma.instance.update({ where: { id }, data: { status: "error" } }); } else if (action === "reset") { - sendToNode(instance.nodeId, { action: "reset", instanceId: instance.id }); + const sent = sendToNode(instance.nodeId, { + action: "reset", + instanceId: instance.id, + type: instance.template.type, + port: instance.port, + composeConfig: instance.template.composeConfig + .replace(/{PORT}/g, String(instance.port)) + .replace(/{INSTANCE_ID}/g, instance.id) + .replace(/{PUBLIC_URL}/g, publicUrl || `http://localhost:${instance.port}`) + .replace(/{PUBLIC_DOMAIN}/g, domain || "localhost"), + }); + if (!sent) await prisma.instance.update({ where: { id }, data: { status: "error" } }); } return NextResponse.json({ ok: true });