fix(core): update

This commit is contained in:
2019-08-20 22:30:31 +02:00
parent 5c4d5a4a85
commit 5438f83a40
22 changed files with 399 additions and 51 deletions

View File

@ -115,15 +115,27 @@ export class SmartNginx {
// write base config
plugins.smartfile.fs.ensureDirSync(paths.nginxConfigDirPath);
plugins.smartfile.memory.toFsSync(snippets.getBaseConfigString(this.options.defaultProxyUrl), paths.nginxConfFile);
plugins.smartfile.memory.toFsSync(
snippets.getBaseConfigString(this.options.defaultProxyUrl),
paths.nginxConfFile
);
// write standard self signed certificate
const selfsignedCert = plugins.selfsigned.generate([{ name: 'commonName', value: 'selfsigned.git.zone' }], { days: 365});
const selfsignedCert = plugins.selfsigned.generate(
[{ name: 'commonName', value: 'selfsigned.git.zone' }],
{ days: 365 }
);
// deploy hosts
plugins.smartfile.fs.ensureDirSync(paths.nginxHostDirPath);
plugins.smartfile.memory.toFsSync(selfsignedCert.private, plugins.path.join(paths.nginxHostDirPath, './default.private.pem'));
plugins.smartfile.memory.toFsSync(selfsignedCert.cert, plugins.path.join(paths.nginxHostDirPath, './default.public.pem'));
plugins.smartfile.memory.toFsSync(
selfsignedCert.private,
plugins.path.join(paths.nginxHostDirPath, './default.private.pem')
);
plugins.smartfile.memory.toFsSync(
selfsignedCert.cert,
plugins.path.join(paths.nginxHostDirPath, './default.public.pem')
);
for (const host of this.deployedHosts.getArray()) {
await host.deploy();
this.logger.log('info', `Host ${host.hostName} deployed!`);