fix(system-helpers): wrong usage of openssl

This commit is contained in:
Nicolas Meienberger 2023-08-22 20:30:13 +02:00 committed by Nicolas Meienberger
parent ecf1eff86b
commit 021b088c41
2 changed files with 1 additions and 6 deletions

View file

@ -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;

View file

@ -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);