diff --git a/.husky/commit-msg b/.husky/commit-msg deleted file mode 100644 index c3c62bf..0000000 --- a/.husky/commit-msg +++ /dev/null @@ -1 +0,0 @@ -npx commitlint --edit "$1" \ No newline at end of file diff --git a/.husky/install.mjs b/.husky/install.mjs deleted file mode 100644 index 9b13ce1..0000000 --- a/.husky/install.mjs +++ /dev/null @@ -1,6 +0,0 @@ -// Skip Husky install in production and CI -if (process.env.NODE_ENV === "production" || process.env.CI === "true") { - process.exit(0); -} -const husky = (await import("husky")).default; -console.log(husky()); diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100644 index fef815e..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,2 +0,0 @@ -pnpm run check -git add . \ No newline at end of file diff --git a/apps/website/public/canary.sh b/apps/website/public/canary.sh index 99216a6..70cfbe2 100644 --- a/apps/website/public/canary.sh +++ b/apps/website/public/canary.sh @@ -11,7 +11,6 @@ install_dokploy() { exit 1 fi - # check if is running inside a container if [ -f /.dockerenv ]; then echo "This script must be run on Linux" >&2 @@ -31,13 +30,13 @@ install_dokploy() { fi command_exists() { - command -v "$@" > /dev/null 2>&1 + command -v "$@" > /dev/null 2>&1 } if command_exists docker; then - echo "Docker already installed" + echo "Docker already installed" else - curl -sSL https://get.docker.com | sh + curl -sSL https://get.docker.com | sh fi docker swarm leave --force 2>/dev/null @@ -85,12 +84,23 @@ install_dokploy() { echo "$ip" } - advertise_addr="${ADVERTISE_ADDR:-$(get_ip)}" + get_private_ip() { + ip addr show | grep -E "inet (192\.168\.|10\.|172\.1[6-9]\.|172\.2[0-9]\.|172\.3[0-1]\.)" | head -n1 | awk '{print $2}' | cut -d/ -f1 + } + + advertise_addr="${ADVERTISE_ADDR:-$(get_private_ip)}" + + if [ -z "$advertise_addr" ]; then + echo "ERROR: We couldn't find a private IP address." + echo "Please set the ADVERTISE_ADDR environment variable manually." + echo "Example: export ADVERTISE_ADDR=192.168.1.100" + exit 1 + fi echo "Using advertise address: $advertise_addr" docker swarm init --advertise-addr $advertise_addr - - if [ $? -ne 0 ]; then + + if [ $? -ne 0 ]; then echo "Error: Failed to initialize Docker Swarm" >&2 exit 1 fi @@ -122,7 +132,6 @@ install_dokploy() { --network dokploy-network \ --mount type=volume,source=redis-data-volume,target=/data \ redis:7 - # Installation docker service create \ @@ -167,7 +176,6 @@ install_dokploy() { # --publish mode=host,published=443,target=443,protocol=udp \ # traefik:v3.1.2 - GREEN="\033[0;32m" YELLOW="\033[1;33m" BLUE="\033[0;34m" @@ -184,12 +192,12 @@ install_dokploy() { fi } - formatted_addr=$(format_ip_for_url "$advertise_addr") + public_ip="${ADVERTISE_ADDR:-$(get_ip)}" + formatted_addr=$(format_ip_for_url "$public_ip") echo "" printf "${GREEN}Congratulations, Dokploy is installed!${NC}\n" printf "${BLUE}Wait 15 seconds for the server to start${NC}\n" printf "${YELLOW}Please go to http://${formatted_addr}:3000${NC}\n\n" - echo "" } update_dokploy() { diff --git a/apps/website/public/feature.sh b/apps/website/public/feature.sh index 98b5d61..c35325f 100644 --- a/apps/website/public/feature.sh +++ b/apps/website/public/feature.sh @@ -11,7 +11,6 @@ install_dokploy() { exit 1 fi - # check if is running inside a container if [ -f /.dockerenv ]; then echo "This script must be run on Linux" >&2 @@ -85,7 +84,18 @@ install_dokploy() { echo "$ip" } - advertise_addr="${ADVERTISE_ADDR:-$(get_ip)}" + get_private_ip() { + ip addr show | grep -E "inet (192\.168\.|10\.|172\.1[6-9]\.|172\.2[0-9]\.|172\.3[0-1]\.)" | head -n1 | awk '{print $2}' | cut -d/ -f1 + } + + advertise_addr="${ADVERTISE_ADDR:-$(get_private_ip)}" + + if [ -z "$advertise_addr" ]; then + echo "ERROR: We couldn't find a private IP address." + echo "Please set the ADVERTISE_ADDR environment variable manually." + echo "Example: export ADVERTISE_ADDR=192.168.1.100" + exit 1 + fi echo "Using advertise address: $advertise_addr" docker swarm init --advertise-addr $advertise_addr @@ -185,12 +195,12 @@ install_dokploy() { fi } - formatted_addr=$(format_ip_for_url "$advertise_addr") + public_ip="${ADVERTISE_ADDR:-$(get_ip)}" + formatted_addr=$(format_ip_for_url "$public_ip") echo "" printf "${GREEN}Congratulations, Dokploy is installed!${NC}\n" printf "${BLUE}Wait 15 seconds for the server to start${NC}\n" printf "${YELLOW}Please go to http://${formatted_addr}:3000${NC}\n\n" - echo "" } update_dokploy() { diff --git a/apps/website/public/install.sh b/apps/website/public/install.sh index 1621a08..9d95c2e 100644 --- a/apps/website/public/install.sh +++ b/apps/website/public/install.sh @@ -84,7 +84,18 @@ install_dokploy() { echo "$ip" } - advertise_addr="${ADVERTISE_ADDR:-$(get_ip)}" + get_private_ip() { + ip addr show | grep -E "inet (192\.168\.|10\.|172\.1[6-9]\.|172\.2[0-9]\.|172\.3[0-1]\.)" | head -n1 | awk '{print $2}' | cut -d/ -f1 + } + + advertise_addr="${ADVERTISE_ADDR:-$(get_private_ip)}" + + if [ -z "$advertise_addr" ]; then + echo "ERROR: We couldn't find a private IP address." + echo "Please set the ADVERTISE_ADDR environment variable manually." + echo "Example: export ADVERTISE_ADDR=192.168.1.100" + exit 1 + fi echo "Using advertise address: $advertise_addr" docker swarm init --advertise-addr $advertise_addr @@ -181,7 +192,8 @@ install_dokploy() { fi } - formatted_addr=$(format_ip_for_url "$advertise_addr") + public_ip="${ADVERTISE_ADDR:-$(get_ip)}" + formatted_addr=$(format_ip_for_url "$public_ip") echo "" printf "${GREEN}Congratulations, Dokploy is installed!${NC}\n" printf "${BLUE}Wait 15 seconds for the server to start${NC}\n"