From 9b3c3872c128ebdc3ac89f298e358965d1ae3eb3 Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Sun, 30 Jul 2023 13:54:40 -0400 Subject: [PATCH 1/2] Fix stripping of '-' character from project names/urls --- commands/status.cmd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/commands/status.cmd b/commands/status.cmd index 1d273bb5..46b03edb 100644 --- a/commands/status.cmd +++ b/commands/status.cmd @@ -17,7 +17,8 @@ IFS="$OLDIFS" messageList=() for projectNetwork in "${projectNetworkList[@]}"; do - [[ -z "${projectNetwork}" || "${projectNetwork}" == "${wardenNetworkName}" ]] && continue # Skip empty project network names (if any) + # Skip empty names and the Warden core services network + test -z "${projectNetwork}" -o "${projectNetwork}" = "${wardenNetworkName}" && continue prefix="${projectNetwork%_default}" prefixLen="${#prefix}" @@ -28,9 +29,9 @@ for projectNetwork in "${projectNetworkList[@]}"; do [[ -z "${container}" ]] && continue # Project is not running, skip it projectDir=$(docker container inspect --format '{{ index .Config.Labels "com.docker.compose.project.working_dir"}}' "$container") - projectName=$(cat "${projectDir}/.env" | grep '^WARDEN_ENV_NAME=' | sed -e 's/WARDEN_ENV_NAME=[[:space:]]*//g' | tr -d -) - projectType=$(cat "${projectDir}/.env" | grep '^WARDEN_ENV_TYPE=' | sed -e 's/WARDEN_ENV_TYPE=[[:space:]]*//g' | tr -d -) - traefikDomain=$(cat "${projectDir}/.env" | grep '^TRAEFIK_DOMAIN=' | sed -e 's/TRAEFIK_DOMAIN=[[:space:]]*//g' | tr -d -) + projectName=$(cat "${projectDir}/.env" | grep '^WARDEN_ENV_NAME=' | sed -e 's/WARDEN_ENV_NAME=[[:space:]]*//g') + projectType=$(cat "${projectDir}/.env" | grep '^WARDEN_ENV_TYPE=' | sed -e 's/WARDEN_ENV_TYPE=[[:space:]]*//g') + traefikDomain=$(cat "${projectDir}/.env" | grep '^TRAEFIK_DOMAIN=' | sed -e 's/TRAEFIK_DOMAIN=[[:space:]]*//g') messageList+=(" \033[1;35m${projectName}\033[0m a \033[36m${projectType}\033[0m project") messageList+=(" Project Directory: \033[33m${projectDir}\033[0m") From e942e662758760e21c1164fc9d18e11fb428033f Mon Sep 17 00:00:00 2001 From: Brett Patterson Date: Sun, 30 Jul 2023 14:00:47 -0400 Subject: [PATCH 2/2] Add subdomain to url if specified --- commands/status.cmd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/commands/status.cmd b/commands/status.cmd index 46b03edb..49d0bc0d 100644 --- a/commands/status.cmd +++ b/commands/status.cmd @@ -32,10 +32,16 @@ for projectNetwork in "${projectNetworkList[@]}"; do projectName=$(cat "${projectDir}/.env" | grep '^WARDEN_ENV_NAME=' | sed -e 's/WARDEN_ENV_NAME=[[:space:]]*//g') projectType=$(cat "${projectDir}/.env" | grep '^WARDEN_ENV_TYPE=' | sed -e 's/WARDEN_ENV_TYPE=[[:space:]]*//g') traefikDomain=$(cat "${projectDir}/.env" | grep '^TRAEFIK_DOMAIN=' | sed -e 's/TRAEFIK_DOMAIN=[[:space:]]*//g') + traefikSubdomain=$(cat "${projectDir}/.env" | grep '^TRAEFIK_SUBDOMAIN=' | sed -e 's/TRAEFIK_SUBDOMAIN=[[:space:]]*//g') + + fullDomain="${traefikDomain}" + if test -n "${traefikSubdomain}"; then + fullDomain="${traefikSubdomain}.${traefikDomain}" + fi messageList+=(" \033[1;35m${projectName}\033[0m a \033[36m${projectType}\033[0m project") messageList+=(" Project Directory: \033[33m${projectDir}\033[0m") - messageList+=(" Project URL: \033[94mhttps://${traefikDomain}\033[0m") + messageList+=(" Project URL: \033[94mhttps://${fullDomain}\033[0m") [[ "$projectNetwork" != "${projectNetworkList[@]: -1:1}" ]] && messageList+=() done