"feat: Implement SSL configuration for frontend and backend"
This commit is contained in:
@@ -17,12 +17,29 @@ const NEXT_CONFIG_PATH = path.join(__dirname, 'next.config.js');
|
||||
|
||||
console.log('=== Frontend-SSL-Konfiguration ===');
|
||||
|
||||
// Prüfen, ob SSL-Verzeichnis und Zertifikate existieren
|
||||
if (!fs.existsSync(SSL_DIR) ||
|
||||
!fs.existsSync(path.join(SSL_DIR, 'myp.crt')) ||
|
||||
!fs.existsSync(path.join(SSL_DIR, 'myp.key'))) {
|
||||
console.error('SSL-Zertifikate nicht gefunden. Bitte zuerst das Backend-Skript ausführen.');
|
||||
process.exit(1);
|
||||
// Verzeichnis erstellen, falls es nicht existiert
|
||||
if (!fs.existsSync(SSL_DIR)) {
|
||||
console.log(`SSL-Verzeichnis wird erstellt: ${SSL_DIR}`);
|
||||
fs.mkdirSync(SSL_DIR, { recursive: true });
|
||||
}
|
||||
|
||||
// Prüfen, ob SSL-Zertifikate existieren
|
||||
if (!fs.existsSync(path.join(SSL_DIR, 'myp.crt')) || !fs.existsSync(path.join(SSL_DIR, 'myp.key'))) {
|
||||
console.log('SSL-Zertifikate nicht gefunden. Prüfe Backend-Verzeichnis...');
|
||||
|
||||
// Versuche, die Zertifikate aus dem Backend zu kopieren
|
||||
const backendCertPath = path.join('..', 'backend', 'app', 'instance', 'ssl', 'myp.crt');
|
||||
const backendKeyPath = path.join('..', 'backend', 'app', 'instance', 'ssl', 'myp.key');
|
||||
|
||||
if (fs.existsSync(backendCertPath) && fs.existsSync(backendKeyPath)) {
|
||||
console.log('Zertifikate im Backend-Verzeichnis gefunden. Kopiere...');
|
||||
fs.copyFileSync(backendCertPath, path.join(SSL_DIR, 'myp.crt'));
|
||||
fs.copyFileSync(backendKeyPath, path.join(SSL_DIR, 'myp.key'));
|
||||
console.log('Zertifikate erfolgreich in das Frontend-Verzeichnis kopiert.');
|
||||
} else {
|
||||
console.error('SSL-Zertifikate nicht gefunden. Bitte zuerst das Backend-Skript ausführen.');
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('SSL-Zertifikate gefunden. Konfiguriere Frontend...');
|
||||
|
Reference in New Issue
Block a user