From 5f47981d618312e61239622206ddfde15a2cac57 Mon Sep 17 00:00:00 2001 From: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:05:28 -0500 Subject: [PATCH] Updates Docker and windows distribution build files to reflect to changes in admin user setup (#4274) Signed-off-by: Darshit Chanpura --- .../config/opensearch/opensearch-docker-entrypoint.sh | 4 ++-- docker/release/dockercomposefiles/docker-compose-2.x.yml | 2 ++ scripts/opensearch-onetime-setup.sh | 4 ++-- scripts/startup/zip/windows/opensearch-windows-install.bat | 5 ++++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docker/release/config/opensearch/opensearch-docker-entrypoint.sh b/docker/release/config/opensearch/opensearch-docker-entrypoint.sh index 4ed61fabfd..730520818a 100755 --- a/docker/release/config/opensearch/opensearch-docker-entrypoint.sh +++ b/docker/release/config/opensearch/opensearch-docker-entrypoint.sh @@ -34,8 +34,8 @@ function setupSecurityPlugin { if [ "$DISABLE_INSTALL_DEMO_CONFIG" = "true" ]; then echo "Disabling execution of install_demo_configuration.sh for OpenSearch Security Plugin" else - echo "Enabling execution of install_demo_configuration.sh for OpenSearch Security Plugin" - bash $OPENSEARCH_HOME/plugins/$SECURITY_PLUGIN/tools/install_demo_configuration.sh -y -i -s + echo -e "Enabling execution of install_demo_configuration.sh for OpenSearch Security Plugin \nOpenSearch 2.12.0 onwards, the OpenSearch Security Plugin a change that requires an initial password for 'admin' user. \nPlease define an environment variable 'OPENSEARCH_INITIAL_ADMIN_PASSWORD' with a strong password string. \nIf a password is not provided, the setup will quit." + bash $OPENSEARCH_HOME/plugins/$SECURITY_PLUGIN/tools/install_demo_configuration.sh -y -i -s || exit 1 fi if [ "$DISABLE_SECURITY_PLUGIN" = "true" ]; then diff --git a/docker/release/dockercomposefiles/docker-compose-2.x.yml b/docker/release/dockercomposefiles/docker-compose-2.x.yml index b5cf87a460..da8b7e9575 100644 --- a/docker/release/dockercomposefiles/docker-compose-2.x.yml +++ b/docker/release/dockercomposefiles/docker-compose-2.x.yml @@ -11,6 +11,7 @@ services: - cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2 - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping - OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m # minimum and maximum Java heap size, recommend setting both to 50% of system RAM + - OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD} # Sets the demo admin user password when using demo configuration, required for OpenSearch 2.12 and higher ulimits: memlock: soft: -1 @@ -35,6 +36,7 @@ services: - cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2 - bootstrap.memory_lock=true - OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m + - OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD} ulimits: memlock: soft: -1 diff --git a/scripts/opensearch-onetime-setup.sh b/scripts/opensearch-onetime-setup.sh index 3935846905..1e10c4c27d 100755 --- a/scripts/opensearch-onetime-setup.sh +++ b/scripts/opensearch-onetime-setup.sh @@ -20,8 +20,8 @@ if [ -d "$OPENSEARCH_HOME/plugins/$SECURITY_PLUGIN" ]; then if [ "$DISABLE_INSTALL_DEMO_CONFIG" = "true" ]; then echo "Disabling execution of install_demo_configuration.sh for OpenSearch Security Plugin" else - echo "Enabling execution of install_demo_configuration.sh for OpenSearch Security Plugin" - bash $OPENSEARCH_HOME/plugins/$SECURITY_PLUGIN/tools/install_demo_configuration.sh -y -i -s + echo -e "Enabling execution of install_demo_configuration.sh for OpenSearch Security Plugin \nOpenSearch 2.12.0 onwards, the OpenSearch Security Plugin a change that requires an initial password for 'admin' user. \nPlease define an environment variable 'OPENSEARCH_INITIAL_ADMIN_PASSWORD' with a strong password string. \nIf a password is not provided, the setup will quit." + bash $OPENSEARCH_HOME/plugins/$SECURITY_PLUGIN/tools/install_demo_configuration.sh -y -i -s || exit 1 fi if [ "$DISABLE_SECURITY_PLUGIN" = "true" ]; then diff --git a/scripts/startup/zip/windows/opensearch-windows-install.bat b/scripts/startup/zip/windows/opensearch-windows-install.bat index 7fb61a6e91..b606b14f4b 100644 --- a/scripts/startup/zip/windows/opensearch-windows-install.bat +++ b/scripts/startup/zip/windows/opensearch-windows-install.bat @@ -15,7 +15,10 @@ ECHO "OPENSEARCH_PATH_CONF: %OPENSEARCH_PATH_CONF%" :: Security Plugin Setups IF EXIST "%OPENSEARCH_HOME%\plugins\opensearch-security" ( ECHO "Running Security Plugin Install Demo Configuration" - CALL "%OPENSEARCH_HOME%/plugins/opensearch-security/tools/install_demo_configuration.bat" -y -i -s + ECHO "OpenSearch 2.12.0 onwards, the OpenSearch Security Plugin a change that requires an initial password for 'admin' user." + ECHO "Please define an environment variable 'OPENSEARCH_INITIAL_ADMIN_PASSWORD' with a strong password string." + ECHO "If a password is not provided, the setup will quit." + CALL "%OPENSEARCH_HOME%\plugins\opensearch-security\tools\install_demo_configuration.bat" -y -i -s || exit /b 1 ) :: k-NN Plugin Setups