From b9e599763e44719a9b2d5f4818a05ac256a7229b Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Thu, 12 Dec 2024 18:53:02 +0300 Subject: [PATCH 1/3] Fix minor bugs in OCI docker --- install/OneClickInstall/install-Docker.sh | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/install/OneClickInstall/install-Docker.sh b/install/OneClickInstall/install-Docker.sh index 02db4d5c8b..c3ddb0b986 100644 --- a/install/OneClickInstall/install-Docker.sh +++ b/install/OneClickInstall/install-Docker.sh @@ -985,7 +985,7 @@ domain_check () { fi fi - [[ -n "${APP_DOMAIN_PORTAL}" ]] && APP_URL_PORTAL="http://${APP_DOMAIN_PORTAL}:${EXTERNAL_PORT}" + APP_URL_PORTAL=${APP_DOMAIN_PORTAL:+http://${APP_DOMAIN_PORTAL}:${EXTERNAL_PORT}} } establish_conn() { @@ -1026,7 +1026,7 @@ get_tag_from_hub () { CREDENTIALS=$(jq -r --arg hub "${HUB}" '.auths | to_entries[] | select(.key | contains($hub)).value.auth // empty' "$HOME/.docker/config.json") fi - [[ -n ${CREDENTIALS} ]] && AUTH_HEADER="Authorization: Basic $CREDENTIALS" + AUTH_HEADER=${CREDENTIALS:+Authorization: Basic $CREDENTIALS} HUB_URL="https://${HUB}/v2/${1/#$HUB\//}/tags/list" JQ_FILTER='.tags | join("\n")' @@ -1088,7 +1088,7 @@ set_jwt_header () { set_core_machinekey () { APP_CORE_MACHINEKEY="${APP_CORE_MACHINEKEY:-$(get_env_parameter "APP_CORE_MACHINEKEY" "${CONTAINER_NAME}")}" - [[ "$UPDATE" != "true" ]] && APP_CORE_MACHINEKEY="${APP_CORE_MACHINEKEY:-$(get_random_str 12))}" + [ "$UPDATE" != "true" ] && APP_CORE_MACHINEKEY="${APP_CORE_MACHINEKEY:-$(get_random_str 12)}" } set_mysql_params () { @@ -1148,7 +1148,7 @@ set_installation_type_data () { download_files () { [ "${OFFLINE_INSTALLATION}" = "false" ] && echo -n "Downloading configuration files to ${BASE_DIR}..." || echo "Unzip docker.tar.gz to ${BASE_DIR}..." - [ -d "${BASE_DIR}" ] && rm -rf "${BASE_DIR}" + rm -rf "${BASE_DIR:?}" mkdir -p ${BASE_DIR} @@ -1422,18 +1422,18 @@ services_check_connection () { for HOST in "${HOSTS[@]}"; do [[ "${!HOST}" == *CONTAINER_PREFIX* || "${!HOST}" == *$PACKAGE_SYSNAME* ]] && export "$HOST="; done [[ "${APP_URL_PORTAL}" == *${PACKAGE_SYSNAME}-proxy* ]] && APP_URL_PORTAL="" - [[ ! -z "$MYSQL_HOST" ]] && { + if [[ ! -z "$MYSQL_HOST" ]]; then establish_conn ${MYSQL_HOST} "${MYSQL_PORT:-3306}" "MySQL" reconfigure MYSQL_HOST ${MYSQL_HOST} reconfigure MYSQL_PORT "${MYSQL_PORT:-3306}" - } - [[ ! -z "$DOCUMENT_SERVER_HOST" ]] && { + fi + if [[ ! -z "$DOCUMENT_SERVER_HOST" ]]; then APP_URL_PORTAL=${APP_URL_PORTAL:-"http://$(curl -s ifconfig.me):${EXTERNAL_PORT}"} establish_conn ${DOCUMENT_SERVER_HOST} ${DOCUMENT_SERVER_PORT} "${PACKAGE_SYSNAME^^} Docs" reconfigure DOCUMENT_SERVER_URL_EXTERNAL ${DOCUMENT_SERVER_URL_EXTERNAL} reconfigure DOCUMENT_SERVER_URL_PUBLIC ${DOCUMENT_SERVER_URL_EXTERNAL} - } - [[ ! -z "$RABBIT_HOST" ]] && { + fi + if [[ ! -z "$RABBIT_HOST" ]]; then establish_conn ${RABBIT_HOST} "${RABBIT_PORT:-5672}" "RabbitMQ" reconfigure RABBIT_PROTOCOL ${RABBIT_PROTOCOL:-amqp} reconfigure RABBIT_HOST ${RABBIT_HOST} @@ -1441,20 +1441,20 @@ services_check_connection () { reconfigure RABBIT_USER_NAME ${RABBIT_USER_NAME} reconfigure RABBIT_PASSWORD ${RABBIT_PASSWORD} reconfigure RABBIT_VIRTUAL_HOST "${RABBIT_VIRTUAL_HOST:-/}" - } - [[ ! -z "$REDIS_HOST" ]] && { + fi + if [[ ! -z "$REDIS_HOST" ]]; then establish_conn ${REDIS_HOST} "${REDIS_PORT:-6379}" "Redis" reconfigure REDIS_HOST ${REDIS_HOST} reconfigure REDIS_PORT "${REDIS_PORT:-6379}" reconfigure REDIS_USER_NAME ${REDIS_USER_NAME} reconfigure REDIS_PASSWORD ${REDIS_PASSWORD} - } - [[ ! -z "$ELK_HOST" ]] && { + fi + if [[ ! -z "$ELK_HOST" ]]; then establish_conn ${ELK_HOST} "${ELK_PORT:-9200}" "search engine" reconfigure ELK_SHEME "${ELK_SHEME:-http}" reconfigure ELK_HOST ${ELK_HOST} reconfigure ELK_PORT "${ELK_PORT:-9200}" - } + fi } start_installation () { From 8ddcb712438fdbc5177c6252430b432b18cc7d6c Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Thu, 12 Dec 2024 21:41:42 +0300 Subject: [PATCH 2/3] Implement swap file creation before installing the product --- install/OneClickInstall/install-Debian/install-app.sh | 8 ++++---- install/OneClickInstall/install-RedHat/install-app.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/install/OneClickInstall/install-Debian/install-app.sh b/install/OneClickInstall/install-Debian/install-app.sh index 8ccd310e0e..65436071fb 100644 --- a/install/OneClickInstall/install-Debian/install-app.sh +++ b/install/OneClickInstall/install-Debian/install-app.sh @@ -57,6 +57,10 @@ if [ "$DOCUMENT_SERVER_INSTALLED" = "false" ]; then apt-get install -yq ${ds_pkg_name} fi +if [ "$MAKESWAP" == "true" ]; then + make_swap +fi + if [ "$PRODUCT_INSTALLED" = "false" ]; then echo ${product} ${product}/db-pwd select $MYSQL_SERVER_PASS | sudo debconf-set-selections echo ${product} ${product}/db-user select $MYSQL_SERVER_USER | sudo debconf-set-selections @@ -74,10 +78,6 @@ elif [ "$UPDATE" = "true" ] && [ "$PRODUCT_INSTALLED" = "true" ]; then fi fi -if [ "$MAKESWAP" == "true" ]; then - make_swap -fi - echo "" echo "$RES_INSTALL_SUCCESS" echo "$RES_QUESTIONS" diff --git a/install/OneClickInstall/install-RedHat/install-app.sh b/install/OneClickInstall/install-RedHat/install-app.sh index fab9dd263f..bda0c9ee83 100644 --- a/install/OneClickInstall/install-RedHat/install-app.sh +++ b/install/OneClickInstall/install-RedHat/install-app.sh @@ -136,6 +136,10 @@ expect << EOF EOF fi +if [ "$MAKESWAP" == "true" ]; then + make_swap +fi + { ${package_manager} check-update ${product}; PRODUCT_CHECK_UPDATE=$?; } || true if [ "$PRODUCT_INSTALLED" = "false" ]; then ${package_manager} install -y ${product} --best --allowerasing $TESTING_REPO @@ -155,10 +159,6 @@ elif [[ "${PRODUCT_CHECK_UPDATE}" -eq "${UPDATE_AVAILABLE_CODE}" || "${RECONFIGU -mysqlp $(grep -oP 'Password=\K[^;]*' <<< "$CONNECTION_STRING") fi -if [ "$MAKESWAP" == "true" ]; then - make_swap -fi - echo "" echo "$RES_INSTALL_SUCCESS" echo "$RES_QUESTIONS" From 8b66b94cf1ea54ea87ef5e2681c18679b9e4408d Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Sat, 14 Dec 2024 15:49:13 +0300 Subject: [PATCH 3/3] Temporarily lock the rabbitmq version due to issues with dockerhub https://github.com/docker-library/rabbitmq/issues/747 --- install/docker/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/docker/.env b/install/docker/.env index 5f094fba57..0569b71062 100644 --- a/install/docker/.env +++ b/install/docker/.env @@ -19,7 +19,7 @@ MYSQL_VERSION=8.3.0 PROXY_VERSION=latest REDIS_VERSION=7 - RABBITMQ_VERSION=3 + RABBITMQ_VERSION=3.13.6 ELK_VERSION=2.11.1 FLUENT_BIT_VERSION=3.0.2 DASHBOARDS_VERSION=2.11.1