new(core.gbapp): Start of #321, https for every custom bot domain.

This commit is contained in:
rodrigorodriguez 2023-02-23 16:44:56 -03:00
parent 00434bd788
commit cc15b7cc3a
2 changed files with 3 additions and 1 deletions

View file

@ -47,6 +47,7 @@ export class RootData {
public files: {}; // List of uploaded files handled.
public publicAddress: string; // URI for BotServer.
public server: any; // Express reference.
public httpsServer: any; // Express reference (HTTPS).
public sysPackages: any[]; // Loaded system package list.
public appPackages: any[]; // Loaded .gbapp package list.
public minService: GBMinService; // Minimalist service core.

View file

@ -85,6 +85,7 @@ export class GBServer {
const server = express();
GBServer.globals.server = server;
GBServer.globals.httpsServer = null;
GBServer.globals.webSessions = {};
GBServer.globals.processes = {};
GBServer.globals.files = {};
@ -256,7 +257,7 @@ export class GBServer {
pfx: Fs.readFileSync(process.env.CERTIFICATE_PFX)
};
const httpsServer = https.createServer(options1, server).listen(port, mainCallback);
GBServer.globals.httpsServer = httpsServer;
if (process.env.CERTIFICATE2_PFX) {
const options2 = {
passphrase: process.env.CERTIFICATE2_PASSPHRASE,