Browse Source

fix(system-helpers): wrong usage of openssl

Nicolas Meienberger 1 year ago
parent
commit
021b088c41

+ 0 - 5
packages/cli/src/executors/app/app.executors.ts

@@ -1,16 +1,11 @@
-import { appInfoSchema } from '@runtipi/shared';
 import fs from 'fs';
 import path from 'path';
-import { promisify } from 'util';
-import { exec } from 'child_process';
 import { getEnv } from '@/utils/environment/environment';
 import { pathExists } from '@/utils/fs-helpers';
 import { compose } from '@/utils/docker-helpers';
 import { copyDataDir, generateEnvFile } from './app.helpers';
 import { fileLogger } from '@/utils/logger/file-logger';
 
-const execAsync = promisify(exec);
-
 export class AppExecutors {
   private readonly rootFolderHost: string;
 

+ 1 - 1
packages/cli/src/executors/system/system.helpers.ts

@@ -255,7 +255,7 @@ export const generateTlsCertificates = async (data: { domain?: string }) => {
   const subjectAltName = `DNS:*.${data.domain},DNS:${data.domain}`;
 
   try {
-    await execAsync(`openssl req -x509 -newkey rsa:4096 -keyout traefik/tls/key.pem -out traefik/tls/cert.pem -days 365 -subj "${subject}" -addext "${subjectAltName}" -nodes`);
+    await execAsync(`openssl req -x509 -newkey rsa:4096 -keyout traefik/tls/key.pem -out traefik/tls/cert.pem -days 365 -subj "${subject}" -addext "subjectAltName = ${subjectAltName}" -nodes`);
     await fs.promises.writeFile(path.join(process.cwd(), 'traefik', 'tls', `${data.domain}.txt`), '');
   } catch (error) {
     fileLogger.error(error);