Remove .env file and enhance SSL error handling in server configuration
All checks were successful
Deploy Production (ss-tools.crewsportswear.app) / deploy (push) Successful in 1m15s
All checks were successful
Deploy Production (ss-tools.crewsportswear.app) / deploy (push) Successful in 1m15s
This commit is contained in:
@@ -2,10 +2,18 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// SSL Configuration (optional - only needed if not using Traefik/reverse proxy)
|
||||
const sslConfig = process.env.USE_SSL === 'true' ? {
|
||||
key: fs.readFileSync(process.env.SSL_KEY_PATH || '/etc/httpd/ssl/crewsportswear_app.key', 'utf8'),
|
||||
cert: fs.readFileSync(process.env.SSL_CERT_PATH || '/etc/httpd/ssl/certs/current_cert.crt', 'utf8')
|
||||
} : null;
|
||||
let sslConfig = null;
|
||||
if (process.env.USE_SSL === 'true') {
|
||||
try {
|
||||
sslConfig = {
|
||||
key: fs.readFileSync(process.env.SSL_KEY_PATH || '/etc/httpd/ssl/crewsportswear_app.key', 'utf8'),
|
||||
cert: fs.readFileSync(process.env.SSL_CERT_PATH || '/etc/httpd/ssl/certs/current_cert.crt', 'utf8')
|
||||
};
|
||||
} catch (err) {
|
||||
console.error('Failed to read SSL certificates:', err.message);
|
||||
console.log('Falling back to HTTP mode');
|
||||
}
|
||||
}
|
||||
|
||||
// CORS Configuration
|
||||
const allowedOrigins = [
|
||||
|
||||
Reference in New Issue
Block a user