@@ -112,30 +112,46 @@ bundle agent update_cli_rest_server_url_config
112
112
# Both share and live versions must be changed at once since httpd will be restarted later in the same agent run.
113
113
"mp_config_file" string => "$(cfe_internal_hub_vars.docroot)/application/config/config.php";
114
114
"mp_share_config_file" string => "$(sys.workdir)/share/GUI/application/config/config.php";
115
- "regex_test_pattern" string => ".*localhost:$(cfe_internal_hub_vars.https_port).*";
115
+ "api_config_file" string => "$(cfe_internal_hub_vars.docroot)/api/modules/inventory/config/config.php";
116
+ "mp_test_pattern" string => ".*localhost:$(cfe_internal_hub_vars.https_port).*";
117
+ "api_test_pattern" string => ".*127.0.0.1:$(cfe_internal_hub_vars.https_port).*";
116
118
117
119
files:
118
120
"$(mp_share_config_file)"
119
121
edit_line => change_cli_rest_server_url_port,
120
122
if => and(
121
123
fileexists("$(mp_share_config_file)"),
122
- islessthan(countlinesmatching("$(regex_test_pattern )", "$(mp_share_config_file)"), 1)
124
+ islessthan(countlinesmatching("$(mp_test_pattern )", "$(mp_share_config_file)"), 1)
123
125
);
124
126
125
127
"$(mp_config_file)"
126
128
edit_line => change_cli_rest_server_url_port,
127
129
if => and(
128
130
fileexists("$(mp_config_file)"),
129
- islessthan(countlinesmatching("$(regex_test_pattern )", "$(mp_config_file)"), 1)
131
+ islessthan(countlinesmatching("$(mp_test_pattern )", "$(mp_config_file)"), 1)
130
132
);
133
+
134
+ "$(api_config_file)"
135
+ edit_line => change_cli_rest_server_url_port,
136
+ if => and(
137
+ fileexists("$(api_config_file)"),
138
+ islessthan(countlinesmatching("$(api_test_pattern)", "$(api_config_file)"), 1)
139
+ );
131
140
}
132
141
133
- bundle edit_line change_cli_rest_server_url_port
142
+ bundle edit_line change_mp_server_url_port
134
143
{
135
144
replace_patterns:
136
145
"^\s*\$config\['cli_rest_server_url'\]\s*=\s*\"https://localhost(?::(?!$(cfe_internal_hub_vars.https_port))\d{1,5})?/api/\";\s*$"
137
146
replace_with => value(" $config['cli_rest_server_url'] = \"https://localhost:$(cfe_internal_hub_vars.https_port)/api/\";"),
138
- comment => "Change port CLI REST server URL port";
147
+ comment => "Change port MP REST server URL port";
148
+ }
149
+ bundle edit_line change_api_server_url_port
150
+ {
151
+ replace_patterns:
152
+ "^\s*\$define\(\"API_URL\",\s*\"https://127.0.0.1(?::(?!$(cfe_internal_hub_vars.https_port))\d{1,5})?/api/\"\);\s*$"
153
+ replace_with => value("define(\"API_URL\", \"https://127.0.0.1:$(cfe_internal_hub_vars.https_port)/api/\");"),
154
+ comment => "Change port API REST server URL port";
139
155
}
140
156
141
157
##################################################################
0 commit comments