diff --git a/cfe_internal/enterprise/CFE_hub_specific.cf b/cfe_internal/enterprise/CFE_hub_specific.cf index 7817b76a6f..b47a88cf8e 100644 --- a/cfe_internal/enterprise/CFE_hub_specific.cf +++ b/cfe_internal/enterprise/CFE_hub_specific.cf @@ -112,32 +112,48 @@ bundle agent update_cli_rest_server_url_config # Both share and live versions must be changed at once since httpd will be restarted later in the same agent run. "mp_config_file" string => "$(cfe_internal_hub_vars.docroot)/application/config/config.php"; "mp_share_config_file" string => "$(sys.workdir)/share/GUI/application/config/config.php"; - "regex_test_pattern" string => ".*localhost:$(cfe_internal_hub_vars.https_port).*"; + "api_config_file" string => "$(cfe_internal_hub_vars.docroot)/api/modules/inventory/config/config.php"; + "mp_test_pattern" string => ".*localhost:$(cfe_internal_hub_vars.https_port).*"; + "api_test_pattern" string => ".*127.0.0.1:$(cfe_internal_hub_vars.https_port).*"; files: !mpf_disable_mission_portal_docroot_sync_from_share_gui:: "$(mp_share_config_file)" - edit_line => change_cli_rest_server_url_port, + edit_line => change_mp_server_url_port, if => and( fileexists("$(mp_share_config_file)"), - islessthan(countlinesmatching("$(regex_test_pattern)", "$(mp_share_config_file)"), 1) + islessthan(countlinesmatching("$(mp_test_pattern)", "$(mp_share_config_file)"), 1) ); any:: "$(mp_config_file)" - edit_line => change_cli_rest_server_url_port, + edit_line => change_mp_server_url_port, if => and( fileexists("$(mp_config_file)"), - islessthan(countlinesmatching("$(regex_test_pattern)", "$(mp_config_file)"), 1) + islessthan(countlinesmatching("$(mp_test_pattern)", "$(mp_config_file)"), 1) ); + + "$(api_config_file)" + edit_line => change_api_server_url_port, + if => and( + fileexists("$(api_config_file)"), + islessthan(countlinesmatching("$(api_test_pattern)", "$(api_config_file)"), 1) + ); } -bundle edit_line change_cli_rest_server_url_port +bundle edit_line change_mp_server_url_port { replace_patterns: "^\s*\$config\['cli_rest_server_url'\]\s*=\s*\"https://localhost(?::(?!$(cfe_internal_hub_vars.https_port))\d{1,5})?/api/\";\s*$" replace_with => value(" $config['cli_rest_server_url'] = \"https://localhost:$(cfe_internal_hub_vars.https_port)/api/\";"), - comment => "Change port CLI REST server URL port"; + comment => "Change port MP REST server URL port"; +} +bundle edit_line change_api_server_url_port +{ + replace_patterns: + "^\s*define\(\"API_URL\",\s*\"https://127.0.0.1(?::(?!$(cfe_internal_hub_vars.https_port))\d{1,5})?/api\"\);\s*$" + replace_with => value("define(\"API_URL\", \"https://127.0.0.1:$(cfe_internal_hub_vars.https_port)/api/\");"), + comment => "Change port API REST server URL port"; } ################################################################## diff --git a/cfe_internal/enterprise/CFE_knowledge.cf b/cfe_internal/enterprise/CFE_knowledge.cf index d6b4a9fd8c..c35a09340b 100644 --- a/cfe_internal/enterprise/CFE_knowledge.cf +++ b/cfe_internal/enterprise/CFE_knowledge.cf @@ -46,6 +46,11 @@ bundle agent cfe_internal_setup_knowledge copy_from => no_backup_cp_compare("$(sys.workdir)/share/GUI", "binary"), depth_search => recurse("inf"); + "$(cfe_internal_hub_vars.docroot)/.htaccess" + comment => "Correct up htaccess file in doc root", + handle => "cfe_internal_setup_knowledge_files_doc_root_htaccess", + copy_from => no_backup_cp("$(sys.workdir)/share/GUI/Apache-htaccess"); + any:: "$(install_logs)" -> { "ENT-4506" } @@ -126,11 +131,6 @@ bundle agent cfe_internal_setup_knowledge handle => "cfe_internal_setup_knowledge_dir_httpd", perms => mog("755", "root", "root"); - "$(cfe_internal_hub_vars.docroot)/.htaccess" - comment => "Correct up htaccess file in doc root", - handle => "cfe_internal_setup_knowledge_files_doc_root_htaccess", - copy_from => no_backup_cp("$(sys.workdir)/share/GUI/Apache-htaccess"); - "$(cfe_internal_hub_vars.public_docroot)/scripts/." -> { "CFE-951" } comment => "Ensure permissions for $(cfe_internal_hub_vars.public_docroot)/scripts", handle => "cfe_internal_setup_knowledge_files_doc_root_scripts_dir",