Nan Zhou | 307386e | 2022-10-12 20:29:34 +0000 | [diff] [blame] | 1 | # Gather the Configuration data |
| 2 | |
| 3 | conf_data = configuration_data() |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame^] | 4 | |
| 5 | feature_options = [ |
| 6 | 'basic-auth', |
| 7 | 'cookie-auth', |
| 8 | 'dns-resolver', |
| 9 | 'experimental-http2', |
| 10 | 'experimental-redfish-multi-computer-system', |
| 11 | 'google-api', |
| 12 | 'host-serial-socket', |
| 13 | 'http-body-limit', |
| 14 | 'https_port', |
| 15 | 'ibm-management-console', |
| 16 | 'insecure-disable-auth', |
| 17 | 'insecure-disable-csrf', |
| 18 | 'insecure-disable-ssl', |
| 19 | 'insecure-enable-redfish-query', |
| 20 | 'insecure-ignore-content-type', |
| 21 | 'insecure-push-style-notification', |
| 22 | 'insecure-tftp-update', |
| 23 | 'kvm', |
| 24 | 'mutual-tls-auth', |
| 25 | 'mutual-tls-common-name-parsing', |
| 26 | 'redfish-aggregation', |
| 27 | 'redfish-allow-deprecated-power-thermal', |
| 28 | 'redfish-bmc-journal', |
| 29 | 'redfish-cpu-log', |
| 30 | 'redfish-dbus-log', |
| 31 | 'redfish-dump-log', |
| 32 | 'redfish-host-logger', |
| 33 | 'redfish-new-powersubsystem-thermalsubsystem', |
| 34 | 'redfish-oem-manager-fan-data', |
| 35 | 'redfish-provisioning-feature', |
| 36 | 'redfish', |
| 37 | 'rest', |
| 38 | 'session-auth', |
| 39 | 'static-hosting', |
| 40 | 'tests', |
| 41 | 'vm-websocket', |
| 42 | 'xtoken-auth', |
| 43 | ] |
| 44 | |
| 45 | string_options = [ |
| 46 | 'dns-resolver', |
| 47 | 'mutual-tls-common-name-parsing', |
| 48 | ] |
| 49 | |
| 50 | int_options = [ |
| 51 | 'http-body-limit', |
| 52 | 'https_port', |
| 53 | ] |
| 54 | |
| 55 | foreach option_key : feature_options |
| 56 | |
| 57 | option_key_config = option_key.to_upper() |
| 58 | option_key_config = option_key_config.replace('-', '_') |
| 59 | |
| 60 | message(option_key_config) |
| 61 | opt = get_option(option_key) |
| 62 | if string_options.contains(option_key) |
| 63 | elif int_options.contains(option_key) |
| 64 | else |
| 65 | opt = opt.allowed().to_string() |
| 66 | endif |
| 67 | conf_data.set(option_key_config, opt) |
| 68 | summary(option_key, opt, section: 'Features') |
| 69 | endforeach |
| 70 | |
Nan Zhou | 307386e | 2022-10-12 20:29:34 +0000 | [diff] [blame] | 71 | conf_data.set('MESON_INSTALL_PREFIX', get_option('prefix')) |
Nan Zhou | 307386e | 2022-10-12 20:29:34 +0000 | [diff] [blame] | 72 | |
Ed Tanous | 36c0f2a | 2024-02-09 13:50:26 -0800 | [diff] [blame] | 73 | conf_data.set10('BMCWEB_VIRTUAL_MEDIA_VM', get_option('vm-websocket').allowed()) |
| 74 | conf_data.set10('BMCWEB_VIRTUAL_MEDIA_NBD', false) |
| 75 | |
Myung Bae | 662aa6e | 2023-01-10 14:20:28 -0600 | [diff] [blame] | 76 | # Logging level |
| 77 | loglvlopt = get_option('bmcweb-logging') |
| 78 | if get_option('buildtype').startswith('debug') and loglvlopt == 'disabled' |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame^] | 79 | # Override logging level as 'debug' if 'bmcweb-logging' is set as 'disabled' |
Ed Tanous | f2caadc | 2024-01-02 18:34:36 -0800 | [diff] [blame] | 80 | loglvlopt = 'debug' |
Myung Bae | 662aa6e | 2023-01-10 14:20:28 -0600 | [diff] [blame] | 81 | endif |
Ed Tanous | e7245fe | 2023-07-24 17:01:38 -0700 | [diff] [blame] | 82 | loglvlopt = loglvlopt.to_upper() |
Ed Tanous | 25b54db | 2024-04-17 15:40:31 -0700 | [diff] [blame^] | 83 | conf_data.set('LOGGING_LEVEL', loglvlopt) |
Myung Bae | 662aa6e | 2023-01-10 14:20:28 -0600 | [diff] [blame] | 84 | |
Nan Zhou | 307386e | 2022-10-12 20:29:34 +0000 | [diff] [blame] | 85 | conf_h_dep = declare_dependency( |
| 86 | include_directories: include_directories('.'), |
| 87 | sources: configure_file( |
| 88 | input: 'bmcweb_config.h.in', |
| 89 | output: 'bmcweb_config.h', |
Ed Tanous | f2caadc | 2024-01-02 18:34:36 -0800 | [diff] [blame] | 90 | configuration: conf_data, |
| 91 | ), |
Nan Zhou | 307386e | 2022-10-12 20:29:34 +0000 | [diff] [blame] | 92 | ) |
| 93 | |
| 94 | # Configure and install systemd unit files |
| 95 | |
Ed Tanous | f2caadc | 2024-01-02 18:34:36 -0800 | [diff] [blame] | 96 | configure_file( |
| 97 | input: 'bmcweb.socket.in', |
| 98 | output: 'bmcweb.socket', |
| 99 | install_dir: systemd_system_unit_dir, |
| 100 | configuration: conf_data, |
| 101 | install: true, |
| 102 | ) |
Nan Zhou | 307386e | 2022-10-12 20:29:34 +0000 | [diff] [blame] | 103 | |
Ed Tanous | f2caadc | 2024-01-02 18:34:36 -0800 | [diff] [blame] | 104 | configure_file( |
| 105 | input: 'bmcweb.service.in', |
| 106 | output: 'bmcweb.service', |
| 107 | install_dir: systemd_system_unit_dir, |
| 108 | configuration: conf_data, |
| 109 | install: true, |
| 110 | ) |
Nan Zhou | 307386e | 2022-10-12 20:29:34 +0000 | [diff] [blame] | 111 | |
| 112 | # Copy pam-webserver to etc/pam.d |
Ed Tanous | 0a9c11e | 2023-05-25 14:32:49 -0700 | [diff] [blame] | 113 | install_data( |
Ed Tanous | f2caadc | 2024-01-02 18:34:36 -0800 | [diff] [blame] | 114 | 'pam-webserver', |
| 115 | install_dir: '/etc/pam.d/', |
| 116 | rename: 'webserver', |
Ed Tanous | 0a9c11e | 2023-05-25 14:32:49 -0700 | [diff] [blame] | 117 | ) |