mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-31 09:22:49 -05:00
Add options to override server hostname and port
This commit is contained in:
@@ -31,6 +31,13 @@ async function main() {
|
|||||||
describe: 'Enable control webserver and specify the URL',
|
describe: 'Enable control webserver and specify the URL',
|
||||||
implies: ['cert-dir', 'email', 'username', 'password'],
|
implies: ['cert-dir', 'email', 'username', 'password'],
|
||||||
})
|
})
|
||||||
|
.option('hostname', {
|
||||||
|
describe: 'Override hostname the control server listens on',
|
||||||
|
})
|
||||||
|
.option('port', {
|
||||||
|
describe: 'Override port the control server listens on',
|
||||||
|
number: true,
|
||||||
|
})
|
||||||
.option('cert-dir', {
|
.option('cert-dir', {
|
||||||
describe: 'Private directory to store SSL certificate in',
|
describe: 'Private directory to store SSL certificate in',
|
||||||
})
|
})
|
||||||
@@ -100,6 +107,8 @@ async function main() {
|
|||||||
certDir: argv.certDir,
|
certDir: argv.certDir,
|
||||||
email: argv.email,
|
email: argv.email,
|
||||||
url: argv.webserver,
|
url: argv.webserver,
|
||||||
|
hostname: argv.hostname,
|
||||||
|
port: argv.port,
|
||||||
username: argv.username,
|
username: argv.username,
|
||||||
password: argv.password,
|
password: argv.password,
|
||||||
getInitialState,
|
getInitialState,
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ export default async function initWebServer({
|
|||||||
certDir,
|
certDir,
|
||||||
email,
|
email,
|
||||||
url: baseURL,
|
url: baseURL,
|
||||||
|
hostname: overrideHostname,
|
||||||
|
port: overridePort,
|
||||||
username,
|
username,
|
||||||
password,
|
password,
|
||||||
getInitialState,
|
getInitialState,
|
||||||
@@ -90,6 +92,12 @@ export default async function initWebServer({
|
|||||||
if (!port) {
|
if (!port) {
|
||||||
port = protocol === 'https' ? 443 : 80
|
port = protocol === 'https' ? 443 : 80
|
||||||
}
|
}
|
||||||
|
if (overrideHostname) {
|
||||||
|
hostname = overrideHostname
|
||||||
|
}
|
||||||
|
if (overridePort) {
|
||||||
|
port = overridePort
|
||||||
|
}
|
||||||
|
|
||||||
const { app, broadcastState } = initApp({
|
const { app, broadcastState } = initApp({
|
||||||
username,
|
username,
|
||||||
|
|||||||
Reference in New Issue
Block a user