fix dhparam generation

it cannot be created in default config creation time since it is
already run pre-VM snapshot time
This commit is contained in:
Girish Ramakrishnan
2021-11-17 11:48:06 -08:00
parent 515b1db9d0
commit 2ab2255115
3 changed files with 16 additions and 9 deletions

View File

@@ -490,7 +490,7 @@ async function writeAppNginxConfig(app, fqdn, bundle) {
hasIPv6: sysinfo.hasIPv6(),
ip: app.containerIp,
port: app.manifest.httpPort,
endpoint: endpoint,
endpoint,
certFilePath: bundle.certFilePath,
keyFilePath: bundle.keyFilePath,
robotsTxtQuoted,
@@ -767,13 +767,6 @@ async function writeDefaultConfig(options) {
}
}
if (!fs.existsSync(paths.DHPARAMS_FILE)) {
debug('writeDefaultConfig: generating dhparams');
const dhparams = safe.child_process.execSync('openssl dhparam -dsaparam 2048');
if (!dhparams) throw new BoxError(BoxError.OPENSSL_ERROR, safe.error);
if (!safe.fs.writeFileSync(paths.DHPARAMS_FILE, dhparams)) throw new BoxError(BoxError.FS_ERROR, `Could not save dhparams.pem: ${safe.error.message}`);
}
const data = {
sourceDir: path.resolve(__dirname, '..'),
vhost: '',