http mode fixes

This commit is contained in:
mrfry 2023-04-07 16:39:43 +02:00
parent c27d72bf40
commit 2fc64811e2

View file

@ -151,6 +151,7 @@ let certs: { key: string; cert: string; ca: string }
// https://certbot.eff.org/ // https://certbot.eff.org/
if ( if (
!process.env.NS_NO_HTTPS_FORCE &&
utils.FileExists(paths.privkeyFile) && utils.FileExists(paths.privkeyFile) &&
utils.FileExists(paths.fullchainFile) && utils.FileExists(paths.fullchainFile) &&
utils.FileExists(paths.chainFile) utils.FileExists(paths.chainFile)
@ -171,7 +172,7 @@ if (
const app = express() const app = express()
const httpServer = http.createServer(app) const httpServer = http.createServer(app)
let httpsServer: https.Server let httpsServer: https.Server
if (certsLoaded) { if (!process.env.NS_NO_HTTPS_FORCE && certsLoaded) {
httpsServer = https.createServer(certs, app) httpsServer = https.createServer(certs, app)
logger.Log('Listening on port: ' + httpsport + ' (https)') logger.Log('Listening on port: ' + httpsport + ' (https)')
} else { } else {
@ -203,7 +204,6 @@ app.use(
cors({ cors({
credentials: true, credentials: true,
origin: true, origin: true,
// origin: [ /\.frylabs\.net$/ ]
}) })
) )