@@ -272,20 +272,20 @@ public static void main(String args[]) {
272272 if (!reconfigure && !installConsole ) {
273273 deleteCwsUiWebApp ();
274274 }
275- setupDatabase ();
276- setIdentityPluginType ();
277- setupAdminUser ();
278- setupNotificationEmails ();
279- setupTokenExpirationHours ();
275+ setupDatabase ();
276+ setIdentityPluginType ();
277+ setupAdminUser ();
278+ setupNotificationEmails ();
279+ setupTokenExpirationHours ();
280280 setupPorts ();
281281 getKeystorePassword ();
282282 setupTaskAssigmentEmails ();
283283 setupSMTP ();
284284 // Elasticsearch is now optional - only setup if configured
285285 setupElasticsearch ();
286286 setupLogstash ();
287- setupHistoryLevel ();
288- setupAws ();
287+ setupHistoryLevel ();
288+ setupAws ();
289289 if (installConsole ) {
290290 setupHistoryDaysToLive ();
291291 setBrandHeader ();
@@ -3030,17 +3030,17 @@ private static void updateCwsUiProperties() throws IOException {
30303030 content = content .replace ("__CWS_DB_TYPE__" , cws_db_type );
30313031 content = content .replace ("__CWS_DB_HOST__" , cws_db_host );
30323032 content = content .replace ("__CWS_DB_NAME__" , cws_db_name );
3033- content = content .replace ("__CWS_DB_PORT__" , cws_db_port );
3034- content = content .replace ("__CWS_DB_USERNAME__" , cws_db_username );
3035- content = content .replace ("__CWS_DB_PASSWORD__" , cws_db_password );
3033+ content = content .replace ("__CWS_DB_PORT__" , cws_db_port );
3034+ content = content .replace ("__CWS_DB_USERNAME__" , cws_db_username );
3035+ content = content .replace ("__CWS_DB_PASSWORD__" , cws_db_password );
30363036 content = content .replace ("__CWS_CONSOLE_SSL_PORT__" , cws_console_ssl_port );
30373037 // Use default values if Elasticsearch was not configured
30383038 content = content .replace ("__CWS_ES_PROTOCOL__" , elasticsearch_protocol != null ? elasticsearch_protocol : "http" );
30393039 content = content .replace ("__CWS_ES_HOST__" , elasticsearch_host != null ? elasticsearch_host : "localhost" );
30403040 content = content .replace ("__CWS_ES_INDEX_PREFIX__" , elasticsearch_index_prefix != null ? elasticsearch_index_prefix : "cws" );
30413041 content = content .replace ("__CWS_ES_PORT__" , elasticsearch_port != null ? elasticsearch_port : "9200" );
30423042 content = content .replace ("__CWS_ES_USE_AUTH__" , elasticsearch_use_auth != null ? elasticsearch_use_auth : "N" );
3043- content = content .replace ("__CWS_ENABLE_CLOUD_AUTOSCALING__" , cws_enable_cloud_autoscaling );
3043+ content = content .replace ("__CWS_ENABLE_CLOUD_AUTOSCALING__" , cws_enable_cloud_autoscaling );
30443044 content = content .replace ("__CWS_CLOUDWATCH_ENDPOINT__" , aws_cloudwatch_endpoint );
30453045 content = content .replace ("__CWS_METRICS_PUBLISHING_INTERVAL__" , metrics_publishing_interval );
30463046 content = content .replace ("__CWS_WORKER_ID__" , cws_worker_id );
@@ -3075,9 +3075,9 @@ private static void updateCwsUiProperties() throws IOException {
30753075 content = content .replace ("__CWS_SMTP_PORT__" , cws_smtp_port );
30763076 content = content .replace ("__CWS_AUTH_SCHEME__" , cws_auth_scheme );
30773077 content = content .replace ("__CWS_HISTORY_DAYS_TO_LIVE__" , history_days_to_live );
3078- content = content .replace ("__CWS_HISTORY_LEVEL__" , history_level );
3079- content = content .replace ("__CWS_WORKER_MAX_NUM_RUNNING_PROCS__" , worker_max_num_running_procs );
3080- content = content .replace ("__CWS_WORKER_ABANDONED_DAYS__" , worker_abandoned_days );
3078+ content = content .replace ("__CWS_HISTORY_LEVEL__" , history_level );
3079+ content = content .replace ("__CWS_WORKER_MAX_NUM_RUNNING_PROCS__" , worker_max_num_running_procs );
3080+ content = content .replace ("__CWS_WORKER_ABANDONED_DAYS__" , worker_abandoned_days );
30813081 content = content .replace ("__AWS_DEFAULT_REGION__" , aws_default_region );
30823082
30833083 // ES auth might not be in use - use defaults if not configured
@@ -3090,7 +3090,7 @@ private static void updateCwsUiProperties() throws IOException {
30903090 content = content .replace ("__CWS_ES_PASSWORD__" , "" );
30913091 }
30923092
3093- // S3 Initiator might not be in use
3093+ // S3 Initiator might not be in use
30943094 if (aws_sqs_dispatcher_sqsUrl != null ) {
30953095 content = content .replace ("__AWS_SQS_DISPATCHER_SQS_URL__" , aws_sqs_dispatcher_sqsUrl );
30963096 content = content .replace ("__AWS_SQS_DISPATCHER_MSG_FETCH_LIMIT__" , aws_sqs_dispatcher_msgFetchLimit );
@@ -3155,8 +3155,8 @@ private static void updateCwsUiConfig() throws IOException {
31553155
31563156 writeToFile (path , content );
31573157
3158- copy (path ,
3159- Paths .get (cws_tomcat_webapps + SEP + "cws-ui" + SEP + "WEB-INF" + SEP + "applicationContext.xml" ));
3158+ copy (path ,
3159+ Paths .get (cws_tomcat_webapps + SEP + "cws-ui" + SEP + "WEB-INF" + SEP + "applicationContext.xml" ));
31603160
31613161
31623162 // Update clean_es_history.sh file
@@ -3409,44 +3409,44 @@ private static void installLogstash() throws IOException {
34093409 // CONFIGURE LOGSTASH CONF TO READ FROM CATALINA.OUT AND CWS.LOG
34103410 // UPDATE cws-logstash.conf
34113411 print (" Updating cws-logstash.conf..." );
3412- Path logstashFilePath = Paths .get (config_work_dir + SEP + "logging" + SEP + "cws-logstash.conf" );
3413- String logstashContent = getFileContents (logstashFilePath );
3414-
3415- // LogStash doesn't like backslashes (i.e. if this is Windows) in the input file path,
3416- // so replace any backslashes with forward slashes.
3417- // See: https://logstash.jira.com/browse/LOGSTASH-1126
3418- String catalinaLogPath = cws_tomcat_root + SEP + "logs" ;
3419- catalinaLogPath = catalinaLogPath .replace ("\\ " , "/" );
3420- logstashContent = logstashContent .replace ("__CWS_CATALINA_OUT_PATH__" , catalinaLogPath );
3421-
3422- logstashContent = logstashContent .replace ("__CWS_ES_PROTOCOL__" , elasticsearch_protocol );
3423- logstashContent = logstashContent .replace ("__CWS_ES_HOST__" , elasticsearch_host );
3424- logstashContent = logstashContent .replace ("__CWS_ES_INDEX_PREFIX__" , elasticsearch_index_prefix );
3425- logstashContent = logstashContent .replace ("__CWS_ES_PORT__" , elasticsearch_port );
3426- if (elasticsearch_use_auth .equalsIgnoreCase (("Y" ))) {
3427- // Construct the auth config for logstash
3428- String user = "user => \" " + elasticsearch_username + "\" " ;
3429- String pw = "password => \" " + elasticsearch_password + "\" " ;
3430- logstashContent = logstashContent .replace ("__LOGSTASH_ES_USERNAME__" , user );
3431- logstashContent = logstashContent .replace ("__LOGSTASH_ES_PASSWORD__" , pw );
3432-
3433- // Tell logstash to use https
3434- logstashContent = logstashContent .replace ("__LOGSTASH_ES_USE_SSL__" , "true" );
3435- } else {
3436- // Remove these blocks if not using auth
3437- logstashContent = logstashContent .replace ("__LOGSTASH_ES_USERNAME__" , "" );
3438- logstashContent = logstashContent .replace ("__LOGSTASH_ES_PASSWORD__" , "" );
3439-
3440- // Tell logstash to use http
3441- logstashContent = logstashContent .replace ("__LOGSTASH_ES_USE_SSL__" , "false" );
3442- }
3443- writeToFile (logstashFilePath , logstashContent );
3412+ Path logstashFilePath = Paths .get (config_work_dir + SEP + "logging" + SEP + "cws-logstash.conf" );
3413+ String logstashContent = getFileContents (logstashFilePath );
3414+
3415+ // LogStash doesn't like backslashes (i.e. if this is Windows) in the input file path,
3416+ // so replace any backslashes with forward slashes.
3417+ // See: https://logstash.jira.com/browse/LOGSTASH-1126
3418+ String catalinaLogPath = cws_tomcat_root + SEP + "logs" ;
3419+ catalinaLogPath = catalinaLogPath .replace ("\\ " , "/" );
3420+ logstashContent = logstashContent .replace ("__CWS_CATALINA_OUT_PATH__" , catalinaLogPath );
3421+
3422+ logstashContent = logstashContent .replace ("__CWS_ES_PROTOCOL__" , elasticsearch_protocol );
3423+ logstashContent = logstashContent .replace ("__CWS_ES_HOST__" , elasticsearch_host );
3424+ logstashContent = logstashContent .replace ("__CWS_ES_INDEX_PREFIX__" , elasticsearch_index_prefix );
3425+ logstashContent = logstashContent .replace ("__CWS_ES_PORT__" , elasticsearch_port );
3426+ if (elasticsearch_use_auth .equalsIgnoreCase (("Y" ))) {
3427+ // Construct the auth config for logstash
3428+ String user = "user => \" " + elasticsearch_username + "\" " ;
3429+ String pw = "password => \" " + elasticsearch_password + "\" " ;
3430+ logstashContent = logstashContent .replace ("__LOGSTASH_ES_USERNAME__" , user );
3431+ logstashContent = logstashContent .replace ("__LOGSTASH_ES_PASSWORD__" , pw );
3432+
3433+ // Tell logstash to use https
3434+ logstashContent = logstashContent .replace ("__LOGSTASH_ES_USE_SSL__" , "true" );
3435+ } else {
3436+ // Remove these blocks if not using auth
3437+ logstashContent = logstashContent .replace ("__LOGSTASH_ES_USERNAME__" , "" );
3438+ logstashContent = logstashContent .replace ("__LOGSTASH_ES_PASSWORD__" , "" );
34443439
3445- print (" Put logstash conf file into place." );
3446- copy (
3447- Paths .get (config_work_dir + SEP + "logging" + SEP + "cws-logstash.conf" ),
3448- Paths .get (logstash_root + SEP + "cws-logstash.conf" ));
3440+ // Tell logstash to use http
3441+ logstashContent = logstashContent .replace ("__LOGSTASH_ES_USE_SSL__" , "false" );
34493442 }
3443+ writeToFile (logstashFilePath , logstashContent );
3444+
3445+ print (" Put logstash conf file into place." );
3446+ copy (
3447+ Paths .get (config_work_dir + SEP + "logging" + SEP + "cws-logstash.conf" ),
3448+ Paths .get (logstash_root + SEP + "cws-logstash.conf" ));
3449+ }
34503450
34513451 private static void writeOutConfigurationFile () throws IOException {
34523452 InstallerPresets presets = CwsInstallerUtils .getInstallerPresets ();
0 commit comments