diff --git a/devbox/devbox.local/cli/devbox b/devbox/devbox.local/cli/devbox index 594a9cb..d13f5b1 100644 --- a/devbox/devbox.local/cli/devbox +++ b/devbox/devbox.local/cli/devbox @@ -456,6 +456,12 @@ declare -g local_components_ports_keys=("devsvc" "notification" "content" "centr local_components_ports_values=("8007" "8003" "8013" "8005" "8012" "8004") + +# used for repository username and password encoding +url_encode() { + echo "$1" | sed 's/@/%40/g' +} + # Get the port number for a local component get_port() { local comp="$1" @@ -713,6 +719,11 @@ devbox_init_command() { exit 1 fi + sudo usermod -aG docker $USER + + sudo apt-get update -y + sudo apt-get install docker-compose -y + fi # 3.2 Check disk space @@ -827,9 +838,11 @@ devbox_init_command() { exit 1 fi + ENCODEING_FREELEAPS_USERNAME=$(url_encode "$FREELEAPS_USERNAME") + ENCODEING_FREELEAPS_PASSWORD=$(url_encode "$FREELEAPS_PASSWORD") # Test if the user can access the freeleaps.com repository echo "==> Testing access to freeleaps.com repository..." - if ! git ls-remote "https://$FREELEAPS_USERNAME:$FREELEAPS_PASSWORD@freeleaps.com:3443/products/freeleaps.git" &>/dev/null; then + if ! git ls-remote "https://$ENCODEING_FREELEAPS_USERNAME:$ENCODEING_FREELEAPS_PASSWORD@freeleaps.com:3443/products/freeleaps.git" &>/dev/null; then echo "ERROR: Failed to access freeleaps.com repository. Please check your username and password." echo "==> [INIT] DevBox environment initialization completed successfully, but access to the freeleaps.com repository failed." exit 1 @@ -838,7 +851,7 @@ devbox_init_command() { DOVBOX_CLI_DIR=$(pwd) FREELEAPS_DIR="$WORKING_HOME/freeleaps" - FRONTEND_GIT_URL="https://$FREELEAPS_USERNAME:$FREELEAPS_PASSWORD@freeleaps.com:3443/products/freeleaps.git" + FRONTEND_GIT_URL="https://$ENCODEING_FREELEAPS_USERNAME:$ENCODEING_FREELEAPS_PASSWORD@freeleaps.com:3443/products/freeleaps.git" # Check if freeleaps2-frontend exists, if not git clone it if [ ! -d "$FREELEAPS_DIR" ]; then pushd "$WORKING_HOME" > /dev/null