🔀 Merge pull request #785 from flechaig/patch-1

Allow specifying a host on which to listen even with SSL
This commit is contained in:
Alicia Sykes 2022-07-07 18:09:01 +01:00 committed by GitHub
commit 6ba7d6d918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,8 @@ const https = require('https');
const promise = util.promisify;
const stat = promise(fs.stat);
const host = process.env.HOST || '0.0.0.0';
const httpsCerts = {
private: process.env.SSL_PRIV_KEY_PATH || '/etc/ssl/certs/dashy-priv.key',
public: process.env.SSL_PUB_KEY_PATH || '/etc/ssl/certs/dashy-pub.pem',
@ -38,7 +40,7 @@ const startSSLServer = (app) => {
key: fs.readFileSync(httpsCerts.private),
cert: fs.readFileSync(httpsCerts.public),
}, app);
httpsServer.listen(SSLPort, () => { printSuccess(); });
httpsServer.listen(SSLPort, host, () => { printSuccess(); });
}
});
};