Nan Zhou | 307386e | 2022-10-12 20:29:34 +0000 | [diff] [blame] | 1 | # Gather the Configuration data |
| 2 | |
| 3 | conf_data = configuration_data() |
| 4 | conf_data.set('BMCWEB_HTTP_REQ_BODY_LIMIT_MB', get_option('http-body-limit')) |
| 5 | xss_enabled = get_option('insecure-disable-xss') |
Patrick Williams | 549bed2 | 2023-11-29 06:45:06 -0600 | [diff] [blame] | 6 | conf_data.set10('BMCWEB_INSECURE_DISABLE_XSS_PREVENTION', xss_enabled.allowed()) |
Nan Zhou | 307386e | 2022-10-12 20:29:34 +0000 | [diff] [blame] | 7 | enable_redfish_query = get_option('insecure-enable-redfish-query') |
Patrick Williams | 549bed2 | 2023-11-29 06:45:06 -0600 | [diff] [blame] | 8 | conf_data.set10('BMCWEB_INSECURE_ENABLE_QUERY_PARAMS', enable_redfish_query.allowed()) |
Nan Zhou | 307386e | 2022-10-12 20:29:34 +0000 | [diff] [blame] | 9 | # enable_redfish_aggregation = get_option('redfish-aggregation') |
Patrick Williams | 549bed2 | 2023-11-29 06:45:06 -0600 | [diff] [blame] | 10 | # conf_data.set10('BMCWEB_ENABLE_REDFISH_AGGREGATION', enable_redfish_aggregation.allowed()) |
Nan Zhou | 307386e | 2022-10-12 20:29:34 +0000 | [diff] [blame] | 11 | insecure_push_style_notification = get_option('insecure-push-style-notification') |
Patrick Williams | 549bed2 | 2023-11-29 06:45:06 -0600 | [diff] [blame] | 12 | conf_data.set10('BMCWEB_INSECURE_ENABLE_HTTP_PUSH_STYLE_EVENTING', insecure_push_style_notification.allowed()) |
Nan Zhou | 307386e | 2022-10-12 20:29:34 +0000 | [diff] [blame] | 13 | conf_data.set('MESON_INSTALL_PREFIX', get_option('prefix')) |
| 14 | conf_data.set('HTTPS_PORT', get_option('https_port')) |
Ed Tanous | 6f8273e | 2023-05-31 12:44:26 -0700 | [diff] [blame] | 15 | enable_health_populate = get_option('redfish-health-populate') |
Patrick Williams | 549bed2 | 2023-11-29 06:45:06 -0600 | [diff] [blame] | 16 | conf_data.set10('BMCWEB_ENABLE_HEALTH_POPULATE', enable_health_populate.allowed()) |
Ninad Palsule | 5fd0aaf | 2023-04-20 15:11:21 -0500 | [diff] [blame] | 17 | enable_proc_mem_status = get_option('redfish-enable-proccessor-memory-status') |
Patrick Williams | 549bed2 | 2023-11-29 06:45:06 -0600 | [diff] [blame] | 18 | conf_data.set10('BMCWEB_ENABLE_PROC_MEM_STATUS', enable_proc_mem_status.allowed()) |
Ed Tanous | 7f3e84a | 2022-12-28 16:22:54 -0800 | [diff] [blame] | 19 | enable_multi_host = get_option('experimental-redfish-multi-computer-system') |
Patrick Williams | 549bed2 | 2023-11-29 06:45:06 -0600 | [diff] [blame] | 20 | conf_data.set10('BMCWEB_ENABLE_MULTI_HOST', enable_multi_host.allowed()) |
Ed Tanous | fca2cbe | 2021-01-28 14:49:59 -0800 | [diff] [blame] | 21 | enable_http2 = get_option('experimental-http2') |
Patrick Williams | 549bed2 | 2023-11-29 06:45:06 -0600 | [diff] [blame] | 22 | conf_data.set10('BMCWEB_ENABLE_HTTP2', enable_http2.allowed()) |
Marco Kawajiri | 0e373b5 | 2023-10-31 13:36:58 -0700 | [diff] [blame] | 23 | conf_data.set10('BMCWEB_ENABLE_MTLS_COMMON_NAME_PARSING_META', get_option('mutual-tls-common-name-parsing') == 'meta') |
| 24 | |
Nan Zhou | 307386e | 2022-10-12 20:29:34 +0000 | [diff] [blame] | 25 | |
Myung Bae | 662aa6e | 2023-01-10 14:20:28 -0600 | [diff] [blame] | 26 | # Logging level |
| 27 | loglvlopt = get_option('bmcweb-logging') |
| 28 | if get_option('buildtype').startswith('debug') and loglvlopt == 'disabled' |
| 29 | # Override logging level as 'debug' if 'bmcweb-logging' is set as 'dsiabled' |
| 30 | loglvlopt = 'debug' |
| 31 | endif |
Ed Tanous | e7245fe | 2023-07-24 17:01:38 -0700 | [diff] [blame] | 32 | loglvlopt = loglvlopt.to_upper() |
Myung Bae | 662aa6e | 2023-01-10 14:20:28 -0600 | [diff] [blame] | 33 | conf_data.set('BMCWEB_LOGGING_LEVEL', loglvlopt) |
| 34 | |
Nan Zhou | 307386e | 2022-10-12 20:29:34 +0000 | [diff] [blame] | 35 | conf_h_dep = declare_dependency( |
| 36 | include_directories: include_directories('.'), |
| 37 | sources: configure_file( |
| 38 | input: 'bmcweb_config.h.in', |
| 39 | output: 'bmcweb_config.h', |
| 40 | configuration: conf_data |
| 41 | ) |
| 42 | ) |
| 43 | |
| 44 | # Configure and install systemd unit files |
| 45 | |
| 46 | configure_file(input : 'bmcweb.socket.in', |
| 47 | output : 'bmcweb.socket', |
| 48 | install_dir: systemd_system_unit_dir, |
| 49 | configuration: conf_data, |
| 50 | install : true) |
| 51 | |
| 52 | configure_file(input : 'bmcweb.service.in', |
| 53 | output : 'bmcweb.service', |
| 54 | install_dir: systemd_system_unit_dir, |
| 55 | configuration: conf_data, |
| 56 | install : true) |
| 57 | |
| 58 | # Copy pam-webserver to etc/pam.d |
Ed Tanous | 0a9c11e | 2023-05-25 14:32:49 -0700 | [diff] [blame] | 59 | install_data( |
| 60 | 'pam-webserver', |
| 61 | install_dir: '/etc/pam.d/', |
| 62 | rename: 'webserver', |
| 63 | ) |