fix(server/api): envoi du ComposeConfig lors d'un reset d'instance
- Le reset ne transmettait que l'ID, l'agent écrivait un docker-compose.yml vide - Correction pour envoyer type, port et composeConfig comme au start
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user