diff --git a/lib/lib.sh b/lib/lib.sh index 7ed14a1..d900dd9 100644 --- a/lib/lib.sh +++ b/lib/lib.sh @@ -29,7 +29,6 @@ IP=$(hostname -I | cut -f1 -d' ') RELEASE_NUMBERS="7.0 8.0" PREFIX=============== -HOST_PORT=$IP:3000 export DIR=/tmp/forgejo-end-to-end DIR_BINARIES=/srv/forgejo-binaries export DOT_FORGEJO_CURL=$DIR/forgejo-curl @@ -258,6 +257,17 @@ function start() { start_forgejo $version } +function get_host_port() { + local config="$1" + if test -z "$config" ; then + echo "$IP:3000" + else + echo "$IP:$(sed -n -e 's/^HTTP_PORT *= *\(.*\)/\1/p' < $config)" + fi +} + +HOST_PORT=$(get_host_port) + function work_path_base() { local config="$1" if test -z "$config" ; then