From b51343081a7e13ac9f1c826f52f8e251891fbeda Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 20 Dec 2023 22:22:58 +0100 Subject: [PATCH] forgejo-runner needs an IP, not localhost for the artifacts server --- forgejo-binary-app.ini | 1 + forgejo-binary.sh | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/forgejo-binary-app.ini b/forgejo-binary-app.ini index b2a6922..4809a61 100644 --- a/forgejo-binary-app.ini +++ b/forgejo-binary-app.ini @@ -3,6 +3,7 @@ WORK_PATH = ${WORK_PATH} [server] APP_DATA_PATH = ${WORK_PATH}/data +DOMAIN = ${IP} HTTP_PORT = 3000 LFS_START_SERVER = true diff --git a/forgejo-binary.sh b/forgejo-binary.sh index 8bb6059..533232e 100755 --- a/forgejo-binary.sh +++ b/forgejo-binary.sh @@ -78,6 +78,10 @@ function create_user() { forgejo-curl.sh api_json $url/api/forgejo/v1/version } +function myip() { + hostname -I | cut -f1 -d' ' +} + function start_forgejo() { local work_path=$DIR/forgejo-work-path daemon --chdir=$DIR --unsafe --env="TERM=$TERM" --env="HOME=$HOME" --env="PATH=$PATH" --pidfile=$DIR/forgejo-pid --errlog=$DIR/forgejo-err.log --output=$DIR/forgejo-out.log -- $DIR/forgejo --config $work_path/app.ini --work-path $work_path @@ -88,7 +92,7 @@ function start_forgejo() { fi echo "$DIR/forgejo --config $work_path/app.ini --work-path $work_path" '"$@"' > $DIR/forgejocli chmod +x $DIR/forgejocli - hostname -I | cut -f1 -d' ' > $DIR/forgejo-ip + myip > $DIR/forgejo-ip } function reset_forgejo() { @@ -96,7 +100,7 @@ function reset_forgejo() { local work_path=$DIR/forgejo-work-path rm -fr $work_path mkdir -p $work_path - WORK_PATH=$work_path envsubst < $SELF_DIR/$config-app.ini > $work_path/app.ini + IP=$(myip) WORK_PATH=$work_path envsubst < $SELF_DIR/$config-app.ini > $work_path/app.ini } function teardown() {