From 24f357a385ed8da5ff69ead5d15b16eff6de1b7d Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Wed, 13 Nov 2024 19:16:25 +0100 Subject: [PATCH 1/2] Update install.sh --- scripts/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 6712e2de2..5d86b9041 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -491,6 +491,8 @@ echo -e "\033[0;35m |___/ \033[0m" echo -e "\nYour instance is ready to use." -echo -e "Please visit http://$(curl -4s https://ifconfig.io):8000 to get started.\n" -echo -e "WARNING: We recommend you to backup your /data/coolify/source/.env file to a safe location, outside of this server." +echo -e "You can access Coolify through:" +echo -e "- Public IP: http://$(curl -4s https://ifconfig.io):8000" +echo -e "- Private IP: http://$(hostname -I | awk '{print $1}'):8000\n" +echo -e "WARNING: It is highly recommended to backup your Environment variables file (/data/coolify/source/.env) to a safe location, outside of this server (e.g. into a Password Manager).\n" cp /data/coolify/source/.env /data/coolify/source/.env.backup From 2c91c46faf18cee1902cbdd4fb9ed2c0af4730f0 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 14 Nov 2024 14:12:50 +0100 Subject: [PATCH 2/2] fix: gather private ips --- scripts/install.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index e575a27b7..bbdf280bc 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -519,6 +519,22 @@ echo -e "\033[0;35m echo -e "\nYour instance is ready to use." echo -e "You can access Coolify through:" echo -e "- Public IP: http://$(curl -4s https://ifconfig.io):8000" -echo -e "- Private IP: http://$(hostname -I | awk '{print $1}'):8000\n" + +set +e +DEFAULT_PRIVATE_IP=$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p') +PRIVATE_IPS=$(hostname -I) +set -e + +if [ -n "$PRIVATE_IPS" ]; then + echo -e "If your Public IP is not accessible, you can use the following Private IPs:\n" + for IP in $PRIVATE_IPS; do + if [ "$IP" == "$DEFAULT_PRIVATE_IP" ]; then + echo -e "http://$DEFAULT_PRIVATE_IP:8000 (default)" + else + echo -e "http://$IP:8000" + fi + done +fi +echo -e "\n" echo -e "WARNING: It is highly recommended to backup your Environment variables file (/data/coolify/source/.env) to a safe location, outside of this server (e.g. into a Password Manager).\n" cp /data/coolify/source/.env /data/coolify/source/.env.backup