lib: get_host_port is $IP:3000 or read from app.ini

This commit is contained in:
Earl Warren 2024-06-04 14:57:36 +02:00
parent b62866f3ae
commit 078107026b
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -29,7 +29,6 @@ IP=$(hostname -I | cut -f1 -d' ')
RELEASE_NUMBERS="7.0 8.0" RELEASE_NUMBERS="7.0 8.0"
PREFIX=============== PREFIX===============
HOST_PORT=$IP:3000
export DIR=/tmp/forgejo-end-to-end export DIR=/tmp/forgejo-end-to-end
DIR_BINARIES=/srv/forgejo-binaries DIR_BINARIES=/srv/forgejo-binaries
export DOT_FORGEJO_CURL=$DIR/forgejo-curl export DOT_FORGEJO_CURL=$DIR/forgejo-curl
@ -258,6 +257,17 @@ function start() {
start_forgejo $version 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() { function work_path_base() {
local config="$1" local config="$1"
if test -z "$config" ; then if test -z "$config" ; then