@@ -115,34 +115,50 @@ bundle agent update_cli_rest_server_url_config
115115 # Both share and live versions must be changed at once since httpd will be restarted later in the same agent run.
116116 "mp_config_file" string => "$(cfe_internal_hub_vars.docroot)/application/config/config.php";
117117 "mp_share_config_file" string => "$(sys.workdir)/share/GUI/application/config/config.php";
118- "regex_test_pattern" string => ".*localhost:$(cfe_internal_hub_vars.https_port).*";
118+ "api_config_file" string => "$(cfe_internal_hub_vars.docroot)/api/modules/inventory/config/config.php";
119+ "mp_test_pattern" string => ".*localhost:$(cfe_internal_hub_vars.https_port).*";
120+ "api_test_pattern" string => ".*127.0.0.1:$(cfe_internal_hub_vars.https_port).*";
119121
120122 files:
121123 mpf_enable_mission_portal_docroot_sync_from_share_gui::
122124 "$(mp_share_config_file)"
123125 handle => "cfe_internal_edit_share_gui_mp_config",
124- edit_line => change_cli_rest_server_url_port ,
126+ edit_line => change_mp_server_url_port ,
125127 if => and(
126128 fileexists("$(mp_share_config_file)"),
127- islessthan(countlinesmatching("$(regex_test_pattern )", "$(mp_share_config_file)"), 1)
129+ islessthan(countlinesmatching("$(mp_test_pattern )", "$(mp_share_config_file)"), 1)
128130 );
129131
130132 any::
131133 "$(mp_config_file)"
132134 handle => "cfe_internal_edit_mp_config",
133- edit_line => change_cli_rest_server_url_port ,
135+ edit_line => change_mp_server_url_port ,
134136 if => and(
135137 fileexists("$(mp_config_file)"),
136- islessthan(countlinesmatching("$(regex_test_pattern )", "$(mp_config_file)"), 1)
138+ islessthan(countlinesmatching("$(mp_test_pattern )", "$(mp_config_file)"), 1)
137139 );
140+
141+ "$(api_config_file)"
142+ edit_line => change_api_server_url_port,
143+ if => and(
144+ fileexists("$(api_config_file)"),
145+ islessthan(countlinesmatching("$(api_test_pattern)", "$(api_config_file)"), 1)
146+ );
138147}
139148
140- bundle edit_line change_cli_rest_server_url_port
149+ bundle edit_line change_mp_server_url_port
141150{
142151 replace_patterns:
143152 "^\s*\$config\['cli_rest_server_url'\]\s*=\s*\"https://localhost(?::(?!$(cfe_internal_hub_vars.https_port))\d{1,5})?/api/\";\s*$"
144153 replace_with => value(" $config['cli_rest_server_url'] = \"https://localhost:$(cfe_internal_hub_vars.https_port)/api/\";"),
145- comment => "Change port CLI REST server URL port";
154+ comment => "Change port MP REST server URL port";
155+ }
156+ bundle edit_line change_api_server_url_port
157+ {
158+ replace_patterns:
159+ "^\s*define\(\"API_URL\",\s*\"https://127.0.0.1(?::(?!$(cfe_internal_hub_vars.https_port))\d{1,5})?/api\"\);\s*$"
160+ replace_with => value("define(\"API_URL\", \"https://127.0.0.1:$(cfe_internal_hub_vars.https_port)/api/\");"),
161+ comment => "Change port API REST server URL port";
146162}
147163
148164##################################################################
0 commit comments