Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions cfe_internal/enterprise/CFE_hub_specific.cf
Original file line number Diff line number Diff line change
Expand Up @@ -115,34 +115,50 @@ 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_enable_mission_portal_docroot_sync_from_share_gui::
"$(mp_share_config_file)"
handle => "cfe_internal_edit_share_gui_mp_config",
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)"
handle => "cfe_internal_edit_mp_config",
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";
}

##################################################################
Expand Down
11 changes: 5 additions & 6 deletions cfe_internal/enterprise/CFE_knowledge.cf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,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" }
Expand Down Expand Up @@ -129,12 +134,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" -> { "ENT-13173" }
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"),
if => "mpf_enable_mission_portal_docroot_sync_from_share_gui";

"$(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",
Expand Down