Bug fixes
parent
677e09df9e
commit
e07211d0f8
|
@ -155,7 +155,7 @@ export default class CWG_Create extends Command {
|
||||||
key: '/etc/ssl/private/cloud-libraryofcode-org.key',
|
key: '/etc/ssl/private/cloud-libraryofcode-org.key',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
let cfg = await fs.readFile('/opt/CloudServices/dist/static/nginx.conf', { encoding: 'utf8' });
|
let cfg = await fs.readFile('/opt/CloudServices/src/static/nginx.conf', { encoding: 'utf8' });
|
||||||
cfg = cfg.replace(/\[DOMAIN]/g, domain);
|
cfg = cfg.replace(/\[DOMAIN]/g, domain);
|
||||||
cfg = cfg.replace(/\[PORT]/g, String(port));
|
cfg = cfg.replace(/\[PORT]/g, String(port));
|
||||||
cfg = cfg.replace(/\[CERTIFICATE]/g, x509.cert);
|
cfg = cfg.replace(/\[CERTIFICATE]/g, x509.cert);
|
||||||
|
@ -180,9 +180,8 @@ export default class CWG_Create extends Command {
|
||||||
}
|
}
|
||||||
return entry.save();
|
return entry.save();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await fs.unlink(`/etc/nginx/sites-enabled/${domain}`);
|
const tasks = [fs.unlink(`/etc/nginx/sites-enabled/${domain}`), fs.unlink(`/etc/nginx/sites-available/${domain}`), this.client.db.Domain.deleteMany({ domain })];
|
||||||
await fs.unlink(`/etc/nginx/sites-available/${domain}`);
|
await Promise.allSettled(tasks);
|
||||||
await this.client.db.Domain.deleteMany({ domain });
|
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue