From 0f3611e7450b90d981440241750eb6fbcf14e987 Mon Sep 17 00:00:00 2001 From: famfo Date: Fri, 13 Feb 2026 19:29:37 +0100 Subject: [PATCH] feat(lib): extract port from ROOT_URL if set --- lib/lib.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/lib.sh b/lib/lib.sh index efc8b42c..789bec0a 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -323,6 +323,16 @@ function get_host_port() { if test -z "$config"; then echo "$IP:3000" else + # Try to extract custom port from explicitly set ROOT_URL + local root_url="$(sed -ne 's/^ROOT_URL *= *\(.*\)/\1/p' < "$config")" + local port="${root_url##*:}" + + if [[ ! -z "$port" ]]; then + echo "$IP:$port" + exit + fi + + # Fall back to the set port echo "$IP:$(sed -n -e 's/^HTTP_PORT *= *\(.*\)/\1/p' <$config)" fi }