dont execute any commands on startup

This commit is contained in:
blek 2023-03-26 12:52:14 +10:00
parent 0da9c4f88f
commit df62d899a1
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 1 additions and 26 deletions

View File

@ -2,8 +2,6 @@ console.log('Executing startup jobs...');
const fs = require('fs'); const fs = require('fs');
const { crc32 } = require('easy-crc'); const { crc32 } = require('easy-crc');
const glob = require('glob');
const { exec } = require('child_process');
const hrt = () => { const hrt = () => {
let hr = process.hrtime(); let hr = process.hrtime();
@ -29,36 +27,13 @@ if (process.env.APP_DEBUG == 'true') {
// build resume page // build resume page
if ((!fs.existsSync('public/static/dist/resume.js')) && (!process.env.APP_DEBUG)) { if ((!fs.existsSync('public/static/dist/resume.js')) && (!process.env.APP_DEBUG)) {
console.log('Resume files do not exist, building it automatically...'); console.log('Resume files do not exist!');
exec('react/resume/build.sh');
} }
// load key // load key
if (!process.env.APP_KEY) if (!process.env.APP_KEY)
throw new Error('APP_KEY is not set.') throw new Error('APP_KEY is not set.')
// import gpg keys
glob('data/userdata/*_gpgkey', async (err, files) => {
if (err) {
console.error(err);
process.exit(-1);
}
files.filter(
file => {
return !file.startsWith('.')
}
).forEach(file => {
exec('gpg --import ' + file, (err, stdout, stderr) => {
if (err) {
console.error(`Errors while importing ${file}: ${err}`);
process.exit(-1);
}
console.log(`Imported ${file} key`);
});
});
});
console.log('Using a key with CRC32: ' + crc32('CRC-32', process.env.APP_KEY)); console.log('Using a key with CRC32: ' + crc32('CRC-32', process.env.APP_KEY));
async function startup() { async function startup() {