Add option to configure port number
Make the https port number configurable through meson option
"https_port".
It will have a default value of 443.
Need the port to be configurable because on some setups the allowed
ports for BMC's network are limited. 443 is not one of the open ports.
Tested:
Tested default option and also explicitly setting to a specific
port.
Signed-off-by: Vivekanand Veeracholan <vveerach@google.com>
Change-Id: I8e9675865812da6f6ebcd121e87efab840b9dd33
diff --git a/bmcweb.socket b/bmcweb.socket.in
similarity index 79%
rename from bmcweb.socket
rename to bmcweb.socket.in
index 8782e4d..68123f8 100644
--- a/bmcweb.socket
+++ b/bmcweb.socket.in
@@ -2,7 +2,7 @@
Description=BMC Webserver socket
[Socket]
-ListenStream=443
+ListenStream=@HTTPS_PORT@
ReusePort=true
[Install]
diff --git a/meson.build b/meson.build
index cf1bc3c..bdc514b 100644
--- a/meson.build
+++ b/meson.build
@@ -361,6 +361,7 @@
xss_enabled = get_option('insecure-disable-xss')
conf_data.set10('BMCWEB_INSECURE_DISABLE_XSS_PREVENTION', xss_enabled.enabled())
conf_data.set('MESON_INSTALL_PREFIX', get_option('prefix'))
+conf_data.set('HTTPS_PORT', get_option('https_port'))
configure_file(input: 'bmcweb_config.h.in',
output: 'bmcweb_config.h',
configuration: conf_data)
@@ -377,10 +378,10 @@
'systemd unit directory' : systemd_system_unit_dir
}, section : 'Directories')
-configure_file(input : 'bmcweb.socket',
+configure_file(input : 'bmcweb.socket.in',
output : 'bmcweb.socket',
- copy : true,
install_dir: systemd_system_unit_dir,
+ configuration: conf_data,
install : true)
configure_file(input : 'bmcweb.service.in',
diff --git a/meson_options.txt b/meson_options.txt
index b938e82..0ab31b8 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -30,6 +30,7 @@
option('http-body-limit', type: 'integer', min : 0, max : 512, value : 30, description : 'Specifies the http request body length limit')
option('redfish-allow-deprecated-hostname-patch', type : 'feature', value : 'disabled', description : 'Enable/disable Managers/bmc/NetworkProtocol HostName PATCH commands. The default condition is to prevent HostName changes from this URI, following the Redfish schema. Enabling this switch permits the HostName to be PATCHed at this URI. In Q4 2021 this feature will be removed, and the Redfish schema enforced, making the HostName read-only.')
option('redfish-allow-deprecated-power-thermal', type : 'feature', value : 'enabled', description : 'Enable/disable the old Power / Thermal. The default condition is allowing the old Power / Thermal.')
+option ('https_port', type : 'integer', min : 1, max : 65535, value : 443, description : 'HTTPS Port number.')
# Insecure options. Every option that starts with a `insecure` flag should
# not be enabled by default for any platform, unless the author fully comprehends