diff --git a/install.sh b/install.sh index 63b7b91ec1..dc235d03ff 100644 --- a/install.sh +++ b/install.sh @@ -74,26 +74,46 @@ 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 | grep -q '^docker-compose version 1'; then - printf "\n\033[93mHollaEx CLI requires docker compose v2 to operate. Installing it now...\033[39m\n" + echo -e "\n\033[91mWarning: Detected Docker Compose v1 instead of v2.\033[39m" + echo "HollaEx CLI v3+ requires Docker Compose v2." - if [[ ! $IS_APT_UPDATED ]]; then + if command sudo apt list --installed docker-compose; then - echo "Updating APT list" - sudo apt update + echo "Removing Docker-Compose v1 through the APT..." + + sudo apt remove -y docker-compose + + 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 - if command sudo apt install -y docker-compose-v2; then + 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" + + 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 v2 has been successfully installed!\033[39m\n" + printf "\n\033[92mdocker compose v2has been successfully installed!\033[39m\n" - echo "Info: $(docker compose version)" + 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'." + echo "Please review the logs and try to manually install it. - 'https://github.com/docker/compose/releases'." exit 1; fi @@ -116,6 +136,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" @@ -265,26 +287,34 @@ elif command brew -v > /dev/null 2>&1; then fi - if ! command docker compose version > /dev/null 2>&1; then + if command 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 -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" - if [[ ! $IS_BREW_UPDATED ]]; then + exit 1; - echo "Updating Homebrew list" - brew update - fi + fi - if command brew install docker compose; then + if ! command -v docker-compose > /dev/null 2>&1; then - printf "\n\033[92mdocker compose has been successfully installed!\033[39m\n" + printf "\n\033[93mHollaEx CLI requires docker-compose v2 to operate. Installing it now...\033[39m\n" - echo "Info: $(docker compose version)" + 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 v2has been successfully installed!\033[39m\n" + + echo "Info: $(docker-compose version)" + 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'." + 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; fi @@ -428,21 +458,33 @@ 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 | 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" - printf "\n\033[93mHollaEx CLI requires docker compose to operate. Installing it now...\033[39m\n" + exit 1; + + fi - 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 + if ! command -v docker-compose > /dev/null 2>&1; then - sudo chmod +x /usr/local/bin/docker compose + printf "\n\033[93mHollaEx CLI requires docker-compose v2 to operate. Installing it now...\033[39m\n" - printf "\n\033[92mdocker compose has been successfully installed!\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 - echo "Info: $(docker compose version)" + chmod +x /usr/local/bin/docker-compose + + 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; @@ -532,7 +574,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 @@ -540,7 +582,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 @@ -589,7 +631,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" @@ -731,8 +773,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 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 809fee9e72..e0d47cd531 100644 --- a/server/utils/hollaex-tools-lib/tools/user.js +++ b/server/utils/hollaex-tools-lib/tools/user.js @@ -66,6 +66,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'); @@ -3428,6 +3429,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/.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 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 = ({ >