From 2b75b1c8190deeb224b37f4cdf94116d146686fa Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Thu, 22 Aug 2024 20:52:51 +0900 Subject: [PATCH 01/14] docker-compose installation --- install.sh | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/install.sh b/install.sh index 63b7b91ec1..6ec3dc6a98 100644 --- a/install.sh +++ b/install.sh @@ -78,22 +78,21 @@ if command apt -v > /dev/null 2>&1; then printf "\n\033[93mHollaEx CLI requires docker compose v2 to operate. Installing it now...\033[39m\n" - if [[ ! $IS_APT_UPDATED ]]; then + export DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} + mkdir -p $DOCKER_CONFIG/cli-plugins - echo "Updating APT list" - sudo apt update - fi + if command sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o $DOCKER_CONFIG/cli-plugins/docker-compose; then - if command sudo apt install -y docker-compose-v2; then + chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose - printf "\n\033[92mdocker compose v2 has been successfully installed!\033[39m\n" + printf "\n\033[92mdocker compose has been successfully installed!\033[39m\n" echo "Info: $(docker compose version)" else - printf "\n\033[91mFailed to install docker compose v2.\033[39m\n" - echo "Please review the logs and try to manually install it. - 'sudo apt install -y docker compose'." + printf "\n\033[91mFailed to install docker compose.\033[39m\n" + echo "Please review the logs and try to manually install it. - 'https://github.com/docker/compose/releases'." exit 1; fi @@ -116,6 +115,8 @@ if command apt -v > /dev/null 2>&1; then echo "Info: $(jq --version)" + + else printf "\n\033[91mFailed to install jq.\033[39m\n" @@ -269,13 +270,12 @@ elif command brew -v > /dev/null 2>&1; then printf "\n\033[93mHollaEx CLI requires docker compose to operate. Installing it now...\033[39m\n" - if [[ ! $IS_BREW_UPDATED ]]; then + export DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} + mkdir -p $DOCKER_CONFIG/cli-plugins - echo "Updating Homebrew list" - brew update - fi + if command sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o $DOCKER_CONFIG/cli-plugins/docker-compose; then - if command brew install docker compose; then + chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose printf "\n\033[92mdocker compose has been successfully installed!\033[39m\n" @@ -284,7 +284,7 @@ elif command brew -v > /dev/null 2>&1; then else printf "\n\033[91mFailed to install docker compose.\033[39m\n" - echo "Please review the logs and try to manually install it. - 'brew install docker compose'." + echo "Please review the logs and try to manually install it. - 'https://github.com/docker/compose/releases'." exit 1; fi @@ -432,9 +432,12 @@ elif command yum --version > /dev/null 2>&1; then printf "\n\033[93mHollaEx CLI requires docker compose to operate. Installing it now...\033[39m\n" - if command sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker compose; then + export DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} + mkdir -p $DOCKER_CONFIG/cli-plugins + + if command sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o $DOCKER_CONFIG/cli-plugins/docker-compose; then - sudo chmod +x /usr/local/bin/docker compose + chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose printf "\n\033[92mdocker compose has been successfully installed!\033[39m\n" From c5857d93dd1fc0013f29972191e4f3f8994c703e Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Thu, 22 Aug 2024 21:31:27 +0900 Subject: [PATCH 02/14] Update install.sh --- install.sh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/install.sh b/install.sh index 6ec3dc6a98..11c0564a8d 100644 --- a/install.sh +++ b/install.sh @@ -266,30 +266,32 @@ elif command brew -v > /dev/null 2>&1; then fi - if ! command docker compose version > /dev/null 2>&1; then + # No manual install for docker compose for mac since it's included in the docker for mac desktop. - printf "\n\033[93mHollaEx CLI requires docker compose to operate. Installing it now...\033[39m\n" + # if ! command docker compose version > /dev/null 2>&1; then - export DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} - mkdir -p $DOCKER_CONFIG/cli-plugins + # printf "\n\033[93mHollaEx CLI requires docker compose to operate. Installing it now...\033[39m\n" - if command sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o $DOCKER_CONFIG/cli-plugins/docker-compose; then + # export DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} + # mkdir -p $DOCKER_CONFIG/cli-plugins - chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose + # if command sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o $DOCKER_CONFIG/cli-plugins/docker-compose; then - printf "\n\033[92mdocker compose has been successfully installed!\033[39m\n" + # chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose - echo "Info: $(docker compose version)" + # printf "\n\033[92mdocker compose has been successfully installed!\033[39m\n" - else + # echo "Info: $(docker compose version)" - printf "\n\033[91mFailed to install docker compose.\033[39m\n" - echo "Please review the logs and try to manually install it. - 'https://github.com/docker/compose/releases'." - exit 1; + # else - fi + # printf "\n\033[91mFailed to install docker compose.\033[39m\n" + # echo "Please review the logs and try to manually install it. - 'https://github.com/docker/compose/releases'." + # exit 1; - fi + # fi + + # fi if ! command jq --version > /dev/null 2>&1; then From 8f683d0c5960aaeee8881d588e49257db7d5f4c1 Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Thu, 22 Aug 2024 23:37:28 +0900 Subject: [PATCH 03/14] docker-compose standalone installation --- install.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 11c0564a8d..8d8b605df8 100644 --- a/install.sh +++ b/install.sh @@ -74,9 +74,9 @@ if command apt -v > /dev/null 2>&1; then fi - if ! command docker compose version > /dev/null 2>&1; then + if ! command docker-compose version > /dev/null 2>&1; then - printf "\n\033[93mHollaEx CLI requires docker compose v2 to operate. Installing it now...\033[39m\n" + printf "\n\033[93mHollaEx CLI requires docker-compose to operate. Installing it now...\033[39m\n" export DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} mkdir -p $DOCKER_CONFIG/cli-plugins @@ -85,6 +85,10 @@ if command apt -v > /dev/null 2>&1; then chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose + curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose + + chmod +x /usr/local/bin/docker-compose + printf "\n\033[92mdocker compose has been successfully installed!\033[39m\n" echo "Info: $(docker compose version)" From 018f8d4a854b5fa78702082345fdd0e20faa0099 Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Thu, 22 Aug 2024 23:38:15 +0900 Subject: [PATCH 04/14] Update install.sh --- install.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 8d8b605df8..fcbcac7746 100644 --- a/install.sh +++ b/install.sh @@ -81,17 +81,13 @@ if command apt -v > /dev/null 2>&1; then export DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} mkdir -p $DOCKER_CONFIG/cli-plugins - if command sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o $DOCKER_CONFIG/cli-plugins/docker-compose; then - - chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose - - curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose + if command sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose; then chmod +x /usr/local/bin/docker-compose printf "\n\033[92mdocker compose has been successfully installed!\033[39m\n" - echo "Info: $(docker compose version)" + echo "Info: $(docker-compose version)" else From a5b1166b42996b4885264f4ba138301736403d7a Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Thu, 22 Aug 2024 23:41:35 +0900 Subject: [PATCH 05/14] Update install.sh --- install.sh | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/install.sh b/install.sh index fcbcac7746..959f3a9ad9 100644 --- a/install.sh +++ b/install.sh @@ -266,32 +266,30 @@ elif command brew -v > /dev/null 2>&1; then fi - # No manual install for docker compose for mac since it's included in the docker for mac desktop. - - # if ! command docker compose version > /dev/null 2>&1; then + if ! command docker-compose version > /dev/null 2>&1; then - # printf "\n\033[93mHollaEx CLI requires docker compose to operate. Installing it now...\033[39m\n" + printf "\n\033[93mHollaEx CLI requires docker-compose to operate. Installing it now...\033[39m\n" - # export DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} - # mkdir -p $DOCKER_CONFIG/cli-plugins + export DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} + mkdir -p $DOCKER_CONFIG/cli-plugins - # if command sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o $DOCKER_CONFIG/cli-plugins/docker-compose; then + if command sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose; then - # chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose + chmod +x /usr/local/bin/docker-compose - # printf "\n\033[92mdocker compose has been successfully installed!\033[39m\n" + printf "\n\033[92mdocker compose has been successfully installed!\033[39m\n" - # echo "Info: $(docker compose version)" + echo "Info: $(docker-compose version)" - # else + else - # printf "\n\033[91mFailed to install docker compose.\033[39m\n" - # echo "Please review the logs and try to manually install it. - 'https://github.com/docker/compose/releases'." - # exit 1; + printf "\n\033[91mFailed to install docker compose.\033[39m\n" + echo "Please review the logs and try to manually install it. - 'https://github.com/docker/compose/releases'." + exit 1; - # fi + fi - # fi + fi if ! command jq --version > /dev/null 2>&1; then @@ -430,20 +428,20 @@ elif command yum --version > /dev/null 2>&1; then fi - if ! command docker compose version > /dev/null 2>&1; then + if ! command docker-compose version > /dev/null 2>&1; then - printf "\n\033[93mHollaEx CLI requires docker compose to operate. Installing it now...\033[39m\n" + printf "\n\033[93mHollaEx CLI requires docker-compose to operate. Installing it now...\033[39m\n" export DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} mkdir -p $DOCKER_CONFIG/cli-plugins - if command sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o $DOCKER_CONFIG/cli-plugins/docker-compose; then + if command sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose; then - chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose + chmod +x /usr/local/bin/docker-compose printf "\n\033[92mdocker compose has been successfully installed!\033[39m\n" - echo "Info: $(docker compose version)" + echo "Info: $(docker-compose version)" else @@ -537,7 +535,7 @@ elif command yum --version > /dev/null 2>&1; then fi -if ! command docker -v > /dev/null 2>&1 || ! command docker compose version > /dev/null 2>&1 || ! command curl --version > /dev/null 2>&1 || ! command jq --version > /dev/null 2>&1 || ! command nslookup -version > /dev/null 2>&1 || ! command psql --version > /dev/null 2>&1; then +if ! command docker -v > /dev/null 2>&1 || ! command docker-compose version > /dev/null 2>&1 || ! command curl --version > /dev/null 2>&1 || ! command jq --version > /dev/null 2>&1 || ! command nslookup -version > /dev/null 2>&1 || ! command psql --version > /dev/null 2>&1; then if command docker -v > /dev/null 2>&1; then @@ -545,7 +543,7 @@ if ! command docker -v > /dev/null 2>&1 || ! command docker compose version > /d fi - if command docker compose version > /dev/null 2>&1; then + if command docker-compose version > /dev/null 2>&1; then IS_DOCKER_COMPOSE_INSTALLED=true @@ -736,8 +734,8 @@ function kit_cross_compatibility_converter() { if command docker ps | grep local.*-nginx > /dev/null ; then - docker compose -f $(pwd)/nginx/docker-compose.yaml down - docker compose -f $(pwd)/nginx/docker-compose.yaml up -d + docker-compose -f $(pwd)/nginx/docker-compose.yaml down + docker-compose -f $(pwd)/nginx/docker-compose.yaml up -d fi From f14d1ee3d2b728a333c8fdc96250cb61b0286d2f Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Sat, 24 Aug 2024 11:45:29 +0900 Subject: [PATCH 06/14] Update install.sh --- install.sh | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/install.sh b/install.sh index 959f3a9ad9..87ea22e4a3 100644 --- a/install.sh +++ b/install.sh @@ -74,24 +74,27 @@ if command apt -v > /dev/null 2>&1; then fi - if ! command docker-compose version > /dev/null 2>&1; then + + if ! command -v docker-compose > /dev/null 2>&1 || docker-compose --version | grep -q '^docker-compose version 1'; then + + echo "docker compose v2 is not installed or the current version is v1.x." - printf "\n\033[93mHollaEx CLI requires docker-compose to operate. Installing it now...\033[39m\n" + echo "Removing the old docker-compose v2 binary (if it exists)..." + rm -f $(which docker-compose) - export DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} - mkdir -p $DOCKER_CONFIG/cli-plugins + printf "\n\033[93mHollaEx CLI requires docker-compose v2 to operate. Installing it now...\033[39m\n" if command sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose; then chmod +x /usr/local/bin/docker-compose - printf "\n\033[92mdocker compose has been successfully installed!\033[39m\n" + printf "\n\033[92mdocker compose v2has been successfully installed!\033[39m\n" echo "Info: $(docker-compose version)" else - printf "\n\033[91mFailed to install docker compose.\033[39m\n" + printf "\n\033[91mFailed to install docker compose v2.\033[39m\n" echo "Please review the logs and try to manually install it. - 'https://github.com/docker/compose/releases'." exit 1; @@ -266,24 +269,26 @@ elif command brew -v > /dev/null 2>&1; then fi - if ! command docker-compose version > /dev/null 2>&1; then + if ! command -v docker-compose > /dev/null 2>&1 || docker-compose --version | grep -q '^docker-compose version 1'; then - printf "\n\033[93mHollaEx CLI requires docker-compose to operate. Installing it now...\033[39m\n" + echo "docker compose v2 is not installed or the current version is v1.x." - export DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} - mkdir -p $DOCKER_CONFIG/cli-plugins + echo "Removing the old docker-compose v2 binary (if it exists)..." + rm -f $(which docker-compose) + + printf "\n\033[93mHollaEx CLI requires docker-compose v2 to operate. Installing it now...\033[39m\n" if command sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose; then chmod +x /usr/local/bin/docker-compose - printf "\n\033[92mdocker compose has been successfully installed!\033[39m\n" + printf "\n\033[92mdocker compose v2has been successfully installed!\033[39m\n" echo "Info: $(docker-compose version)" else - printf "\n\033[91mFailed to install docker compose.\033[39m\n" + printf "\n\033[91mFailed to install docker compose v2.\033[39m\n" echo "Please review the logs and try to manually install it. - 'https://github.com/docker/compose/releases'." exit 1; @@ -428,24 +433,26 @@ elif command yum --version > /dev/null 2>&1; then fi - if ! command docker-compose version > /dev/null 2>&1; then + if ! command -v docker-compose > /dev/null 2>&1 || docker-compose --version | grep -q '^docker-compose version 1'; then + + echo "docker compose v2 is not installed or the current version is v1.x." - printf "\n\033[93mHollaEx CLI requires docker-compose to operate. Installing it now...\033[39m\n" + echo "Removing the old docker-compose v2 binary (if it exists)..." + rm -f $(which docker-compose) - export DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} - mkdir -p $DOCKER_CONFIG/cli-plugins + printf "\n\033[93mHollaEx CLI requires docker-compose v2 to operate. Installing it now...\033[39m\n" if command sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose; then chmod +x /usr/local/bin/docker-compose - printf "\n\033[92mdocker compose has been successfully installed!\033[39m\n" + printf "\n\033[92mdocker compose v2has been successfully installed!\033[39m\n" echo "Info: $(docker-compose version)" else - printf "\n\033[91mFailed to install docker compose.\033[39m\n" + printf "\n\033[91mFailed to install docker compose v2.\033[39m\n" echo "Please review the logs and try to manually install it. - 'https://github.com/docker/compose/releases'." exit 1; @@ -592,7 +599,7 @@ if ! command docker -v > /dev/null 2>&1 || ! command docker-compose version > /d fi - # docker compose installation status check + # docker compose v2installation status check if [[ "$IS_DOCKER_COMPOSE_INSTALLED" ]]; then printf "\033[92mdocker compose: Installed\033[39m\n" From 519fc9d9b78978339739b47111f155e075eebfd1 Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Sat, 24 Aug 2024 11:58:28 +0900 Subject: [PATCH 07/14] Update install.sh --- install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install.sh b/install.sh index 87ea22e4a3..249d1c1325 100644 --- a/install.sh +++ b/install.sh @@ -91,6 +91,7 @@ if command apt -v > /dev/null 2>&1; then printf "\n\033[92mdocker compose v2has been successfully installed!\033[39m\n" echo "Info: $(docker-compose version)" + hash -r else @@ -285,6 +286,7 @@ elif command brew -v > /dev/null 2>&1; then printf "\n\033[92mdocker compose v2has been successfully installed!\033[39m\n" echo "Info: $(docker-compose version)" + hash -r else @@ -449,6 +451,7 @@ elif command yum --version > /dev/null 2>&1; then printf "\n\033[92mdocker compose v2has been successfully installed!\033[39m\n" echo "Info: $(docker-compose version)" + hash -r else From 0268acf8730d8551a8962681ec69fbc733c81354 Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Sat, 24 Aug 2024 12:04:12 +0900 Subject: [PATCH 08/14] Update install.sh --- install.sh | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/install.sh b/install.sh index 249d1c1325..87fa6afdae 100644 --- a/install.sh +++ b/install.sh @@ -75,12 +75,18 @@ if command apt -v > /dev/null 2>&1; then fi - if ! command -v docker-compose > /dev/null 2>&1 || docker-compose --version | grep -q '^docker-compose version 1'; then + if command docker-compose --version | grep -q '^docker-compose version 1'; then - echo "docker compose v2 is not installed or the current version is v1.x." + echo -e "\n\033[91mError: Detected Docker Compose v1 instead of v2.\033[39m" + echo "HollaEx CLI v3+ requires Docker Compose v2." + echo "To proceed, please uninstall the current Docker Compose v1 and then run the install.sh script." + echo -e "The install.sh script will automatically install Docker Compose v2 for you.\n" - echo "Removing the old docker-compose v2 binary (if it exists)..." - rm -f $(which docker-compose) + exit 1; + + fi + + if ! command -v docker-compose > /dev/null 2>&1; then printf "\n\033[93mHollaEx CLI requires docker-compose v2 to operate. Installing it now...\033[39m\n" @@ -270,12 +276,18 @@ elif command brew -v > /dev/null 2>&1; then fi - if ! command -v docker-compose > /dev/null 2>&1 || docker-compose --version | grep -q '^docker-compose version 1'; then + if command docker-compose --version | grep -q '^docker-compose version 1'; then + + echo -e "\n\033[91mError: Detected Docker Compose v1 instead of v2.\033[39m" + echo "HollaEx CLI v3+ requires Docker Compose v2." + echo "To proceed, please uninstall the current Docker Compose v1 and then run the install.sh script." + echo -e "The install.sh script will automatically install Docker Compose v2 for you.\n" + + exit 1; - echo "docker compose v2 is not installed or the current version is v1.x." + fi - echo "Removing the old docker-compose v2 binary (if it exists)..." - rm -f $(which docker-compose) + if ! command -v docker-compose > /dev/null 2>&1; then printf "\n\033[93mHollaEx CLI requires docker-compose v2 to operate. Installing it now...\033[39m\n" @@ -435,12 +447,18 @@ elif command yum --version > /dev/null 2>&1; then fi - if ! command -v docker-compose > /dev/null 2>&1 || docker-compose --version | grep -q '^docker-compose version 1'; then + if command docker-compose --version | grep -q '^docker-compose version 1'; then + + echo -e "\n\033[91mError: Detected Docker Compose v1 instead of v2.\033[39m" + echo "HollaEx CLI v3+ requires Docker Compose v2." + echo "To proceed, please uninstall the current Docker Compose v1 and then run the install.sh script." + echo -e "The install.sh script will automatically install Docker Compose v2 for you.\n" - echo "docker compose v2 is not installed or the current version is v1.x." + exit 1; + + fi - echo "Removing the old docker-compose v2 binary (if it exists)..." - rm -f $(which docker-compose) + if ! command -v docker-compose > /dev/null 2>&1; then printf "\n\033[93mHollaEx CLI requires docker-compose v2 to operate. Installing it now...\033[39m\n" From 178c63108b81f90966ddb71719e1b399a6484a5e Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Sat, 24 Aug 2024 12:04:31 +0900 Subject: [PATCH 09/14] Update install.sh --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 87fa6afdae..f7446967a8 100644 --- a/install.sh +++ b/install.sh @@ -97,7 +97,7 @@ if command apt -v > /dev/null 2>&1; then printf "\n\033[92mdocker compose v2has been successfully installed!\033[39m\n" echo "Info: $(docker-compose version)" - hash -r + else @@ -298,7 +298,7 @@ elif command brew -v > /dev/null 2>&1; then printf "\n\033[92mdocker compose v2has been successfully installed!\033[39m\n" echo "Info: $(docker-compose version)" - hash -r + else @@ -469,7 +469,7 @@ elif command yum --version > /dev/null 2>&1; then printf "\n\033[92mdocker compose v2has been successfully installed!\033[39m\n" echo "Info: $(docker-compose version)" - hash -r + else From 366874a405836ecb6fb926eff897a317c95d89ad Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Sat, 24 Aug 2024 12:16:37 +0900 Subject: [PATCH 10/14] Update install.sh --- install.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index f7446967a8..8ab4cf105f 100644 --- a/install.sh +++ b/install.sh @@ -77,12 +77,24 @@ if command apt -v > /dev/null 2>&1; then if command docker-compose --version | grep -q '^docker-compose version 1'; then - echo -e "\n\033[91mError: Detected Docker Compose v1 instead of v2.\033[39m" + echo -e "\n\033[91mWarning: Detected Docker Compose v1 instead of v2.\033[39m" echo "HollaEx CLI v3+ requires Docker Compose v2." - echo "To proceed, please uninstall the current Docker Compose v1 and then run the install.sh script." - echo -e "The install.sh script will automatically install Docker Compose v2 for you.\n" - exit 1; + if command sudo apt list --installed docker-compose; then + + echo "Removing Docker-Compose v1 through the APT..." + + sudo apt remove -y docker-compose + hash -r + + else + + echo "To proceed, please uninstall the current Docker Compose v1 and then run the install.sh script." + echo -e "The install.sh script will automatically install Docker Compose v2 for you.\n" + + exit 1; + + fi fi From 64b0860e05c044679131282e73710d40c93b5d1f Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Sat, 24 Aug 2024 12:26:08 +0900 Subject: [PATCH 11/14] Update install.sh --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 8ab4cf105f..2fc8b06863 100644 --- a/install.sh +++ b/install.sh @@ -85,7 +85,6 @@ if command apt -v > /dev/null 2>&1; then echo "Removing Docker-Compose v1 through the APT..." sudo apt remove -y docker-compose - hash -r else @@ -109,6 +108,7 @@ if command apt -v > /dev/null 2>&1; then printf "\n\033[92mdocker compose v2has been successfully installed!\033[39m\n" echo "Info: $(docker-compose version)" + export PATH="/usr/local/bin:$PATH" else From dfaa8b8d480f7cdca3ba1869bfbb35bd54087c5d Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Sat, 24 Aug 2024 12:30:21 +0900 Subject: [PATCH 12/14] Update install.sh --- install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install.sh b/install.sh index 2fc8b06863..dc235d03ff 100644 --- a/install.sh +++ b/install.sh @@ -108,7 +108,6 @@ if command apt -v > /dev/null 2>&1; then printf "\n\033[92mdocker compose v2has been successfully installed!\033[39m\n" echo "Info: $(docker-compose version)" - export PATH="/usr/local/bin:$PATH" else From 5a34bed5f4201f7190ee8721831eb35785b8de16 Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Sat, 24 Aug 2024 19:38:01 +0900 Subject: [PATCH 13/14] App stream endpoint env removal --- web/.env | 1 - 1 file changed, 1 deletion(-) diff --git a/web/.env b/web/.env index 48e7b2bb48..3ac4476533 100644 --- a/web/.env +++ b/web/.env @@ -3,7 +3,6 @@ NODE_ENV=production REACT_APP_PUBLIC_URL=http://yourdomain.com REACT_APP_SERVER_ENDPOINT=http://localhost/api -REACT_APP_STREAM_ENDPOINT=ws://localhost/stream REACT_APP_NETWORK=mainnet From 491a7ef94e282505aef642b32a8ce5f473b8cc18 Mon Sep 17 00:00:00 2001 From: fetok12 Date: Mon, 26 Aug 2024 00:52:00 +0300 Subject: [PATCH 14/14] p2p-fix-ws --- server/messages.js | 1 + server/utils/hollaex-tools-lib/tools/user.js | 5 ++ web/src/containers/P2P/P2POrder.js | 8 ++ web/src/containers/P2P/P2PProfile.js | 89 +++++++++++--------- 4 files changed, 62 insertions(+), 41 deletions(-) diff --git a/server/messages.js b/server/messages.js index 557975aeaf..f304b28e1f 100644 --- a/server/messages.js +++ b/server/messages.js @@ -266,4 +266,5 @@ exports.ADDRESSBOOK_MISSING_FIELDS = 'Each address must contain both address, ne exports.ADDRESSBOOK_ALREADY_EXISTS = 'Address label already exists in the payload'; exports.ADDRESSBOOK_NOT_FOUND = 'User address book not found'; exports.PAYMENT_DETAIL_NOT_FOUND = 'Payment detail not found'; +exports.UNAUTHORIZED_UPDATE_METHOD = 'You cannot update verified payment method'; exports.P2P_DEAL_NOT_FOUND = 'P2P Deal not found!'; \ No newline at end of file diff --git a/server/utils/hollaex-tools-lib/tools/user.js b/server/utils/hollaex-tools-lib/tools/user.js index 62f04fdf56..5b80066084 100644 --- a/server/utils/hollaex-tools-lib/tools/user.js +++ b/server/utils/hollaex-tools-lib/tools/user.js @@ -65,6 +65,7 @@ const { ADDRESSBOOK_MISSING_FIELDS, PAYMENT_DETAIL_NOT_FOUND, ADDRESSBOOK_ALREADY_EXISTS, + UNAUTHORIZED_UPDATE_METHOD, ADDRESSBOOK_NOT_FOUND } = require(`${SERVER_PATH}/messages`); const { publisher, client } = require('./database/redis'); @@ -3421,6 +3422,10 @@ const updatePaymentDetail = async (id, data, isAdmin = false) => { sendEmail(MAILTYPE.BANK_VERIFIED, user.email, { bankAccounts: paymentDetail?.details?.fields }, user.settings); } + if (!isAdmin && paymentDetail.status === 3) { + throw new Error(UNAUTHORIZED_UPDATE_METHOD); + } + await paymentDetail.update(data, { fields: [ 'name', diff --git a/web/src/containers/P2P/P2POrder.js b/web/src/containers/P2P/P2POrder.js index 30b1afff71..b1e47b3904 100644 --- a/web/src/containers/P2P/P2POrder.js +++ b/web/src/containers/P2P/P2POrder.js @@ -152,6 +152,14 @@ const P2POrder = ({ p2pWs.onopen = (evt) => { setWs(p2pWs); setReady(true); + + setInterval(() => { + p2pWs.send( + JSON.stringify({ + op: 'ping', + }) + ); + }, 55000); }; return () => { diff --git a/web/src/containers/P2P/P2PProfile.js b/web/src/containers/P2P/P2PProfile.js index 910064f5d3..9fa1e1fb47 100644 --- a/web/src/containers/P2P/P2PProfile.js +++ b/web/src/containers/P2P/P2PProfile.js @@ -368,24 +368,26 @@ const P2PProfile = ({ >
{method.system_name}
-
{ - setSelectedMethod(method); - setAddMethodDetails(true); - }} - className="whiteTextP2P" - style={{ - cursor: 'pointer', - position: 'relative', - top: 5, - }} - > - - - {STRINGS['P2P.EDIT_UPPERCASE']} - - -
+ {info?.status !== 3 && ( +
{ + setSelectedMethod(method); + setAddMethodDetails(true); + }} + className="whiteTextP2P" + style={{ + cursor: 'pointer', + position: 'relative', + top: 5, + }} + > + + + {STRINGS['P2P.EDIT_UPPERCASE']} + + +
+ )}
{ const found = myMethods.find( @@ -649,36 +651,41 @@ const P2PProfile = ({