dep updates/enable ssl_dyn_rec_enable/fix nginx in background/remove tempwrite

Signed-off-by: Zoey <zoey@z0ey.de>
This commit is contained in:
renovate[bot]
2023-06-16 14:16:51 +00:00
committed by Zoey
parent cd058f1382
commit c6ecb61c9b
16 changed files with 94 additions and 36 deletions

View File

@@ -96,7 +96,7 @@ const generateKeys = () => {
try {
fs.writeFileSync(keysFile, JSON.stringify(keys, null, 2));
} catch (err) {
logger.error('Could not write JWT key pair to config file: ' + keysFile + ': ' . err.message);
logger.error('Could not write JWT key pair to config file: ' + keysFile + ': ' + err.message);
process.exit(1);
}
logger.info('Wrote JWT key pair to config file: ' + keysFile);
@@ -150,7 +150,7 @@ module.exports = {
},
/**
* Are we running in debug mdoe?
* Are we running in debug mode?
*
* @returns {boolean}
*/

View File

@@ -1,5 +1,6 @@
const _ = require('lodash');
const exec = require('child_process').exec;
const spawn = require('child_process').spawn;
const execFile = require('child_process').execFile;
const { Liquid } = require('liquidjs');
const logger = require('../logger').global;
@@ -22,6 +23,33 @@ module.exports = {
});
},
/**
* @param {String} cmd
* @returns {Promise}
*/
execfg: function (cmd) {
return new Promise((resolve, reject) => {
const childProcess = spawn(cmd, {
shell: true,
detached: true,
stdio: 'inherit' // Use the same stdio as the current process
});
childProcess.on('error', (err) => {
reject(err);
});
childProcess.on('close', (code) => {
if (code !== 0) {
reject(new Error(`Command '${cmd}' exited with code ${code}`));
} else {
resolve();
}
});
});
},
/**
* @param {String} cmd
* @param {Array} args