mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-25 22:52:48 -05:00
Add command line flag for enabling production cert
This commit is contained in:
@@ -41,6 +41,9 @@ async function main() {
|
||||
.option('cert-dir', {
|
||||
describe: 'Private directory to store SSL certificate in',
|
||||
})
|
||||
.option('cert-production', {
|
||||
describe: 'Obtain a real SSL certificate using production servers',
|
||||
})
|
||||
.option('email', {
|
||||
describe: 'Email for owner of SSL certificate',
|
||||
})
|
||||
@@ -105,6 +108,7 @@ async function main() {
|
||||
if (argv.webserver) {
|
||||
;({ broadcastState } = await initWebServer({
|
||||
certDir: argv.certDir,
|
||||
certProduction: argv.certProduction,
|
||||
email: argv.email,
|
||||
url: argv.webserver,
|
||||
hostname: argv.hostname,
|
||||
|
||||
@@ -79,6 +79,7 @@ function initApp({ username, password, baseURL, getInitialState, onMessage }) {
|
||||
|
||||
export default async function initWebServer({
|
||||
certDir,
|
||||
certProduction,
|
||||
email,
|
||||
url: baseURL,
|
||||
hostname: overrideHostname,
|
||||
@@ -110,7 +111,7 @@ export default async function initWebServer({
|
||||
dataDir: certDir,
|
||||
commonName: hostname,
|
||||
email,
|
||||
production: process.env.NODE_DEV === 'production',
|
||||
production: certProduction,
|
||||
serverHost: overrideHostname || hostname,
|
||||
})
|
||||
server = https.createServer({ key, cert }, app.callback())
|
||||
|
||||
Reference in New Issue
Block a user