fix(core): Refactor filesystem usage to smartfs async provider, update dependencies, tests and nginx config paths
This commit is contained in:
@@ -116,10 +116,9 @@ export class SmartNginx {
|
||||
this.hostCandidates.wipe();
|
||||
|
||||
// write base config
|
||||
plugins.smartfile.fs.ensureDirSync(paths.nginxConfigDirPath);
|
||||
plugins.smartfile.memory.toFsSync(
|
||||
snippets.getBaseConfigString(this.options.defaultProxyUrl),
|
||||
paths.nginxConfFile
|
||||
await plugins.fs.directory(paths.nginxConfigDirPath).recursive().create();
|
||||
await plugins.fs.file(paths.nginxConfFile).write(
|
||||
snippets.getBaseConfigString(this.options.defaultProxyUrl)
|
||||
);
|
||||
|
||||
// write standard self signed certificate
|
||||
@@ -129,15 +128,13 @@ export class SmartNginx {
|
||||
);
|
||||
|
||||
// deploy hosts
|
||||
plugins.smartfile.fs.ensureDirSync(paths.nginxHostDirPath);
|
||||
plugins.smartfile.memory.toFsSync(
|
||||
selfsignedCert.private,
|
||||
await plugins.fs.directory(paths.nginxHostDirPath).recursive().create();
|
||||
await plugins.fs.file(
|
||||
plugins.path.join(paths.nginxHostDirPath, './default.private.pem')
|
||||
);
|
||||
plugins.smartfile.memory.toFsSync(
|
||||
selfsignedCert.cert,
|
||||
).write(selfsignedCert.private);
|
||||
await plugins.fs.file(
|
||||
plugins.path.join(paths.nginxHostDirPath, './default.public.pem')
|
||||
);
|
||||
).write(selfsignedCert.cert);
|
||||
for (const host of this.deployedHosts.getArray()) {
|
||||
await host.deploy();
|
||||
this.logger.log('info', `Host ${host.hostName} deployed!`);
|
||||
|
||||
Reference in New Issue
Block a user