🗃️ Committing everything that changed 🗃️

rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
This commit is contained in:
casjay 2024-09-01 13:40:33 -04:00
parent bc0aaaeb60
commit 8beefcdb11
Signed by untrusted user who does not match committer: jason
GPG Key ID: 1AB309F42A764145

View File

@ -59,10 +59,15 @@ printf '%s\n' "# - - - Initializing $SERVICE_NAME - - - #"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Custom functions # Custom functions
__gen_auth_token() { __gen_auth_token() {
[ -n "$SYS_AUTH_TOKEN" ] && echo "$SYS_AUTH_TOKEN" && return if [ -n "$SYS_AUTH_TOKEN" ]; then
local user="${GITEA_USER:-$SERVICE_USER}" echo "$SYS_AUTH_TOKEN"
local conf_file="$(find "/config" "/etc" -type f -name '*.ini' | grep -E 'gitea/app.ini|gitea.ini' | head -n1 | grep '^')" return
[ -f "$conf_file" ] && sudo -u $user gitea --config "$conf_file" actions generate-runner-token 2>/dev/null | grep -v '\.\.\.' || return else
local user conf_file
user="${GITEA_USER:-git}"
conf_file="$(find "/config" "/etc" -type f -name '*.ini' | grep -E 'gitea/app.ini|gitea.ini' | head -n1 | grep '^')"
[ -f "$conf_file" ] && sudo -u $user gitea --config "$conf_file" actions generate-runner-token 2>/dev/null | grep -v '\.\.\.' || return 1
fi
} }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Script to execute # Script to execute
@ -104,8 +109,8 @@ SERVICE_PORT="44015"
RUNAS_USER="root" # normally root RUNAS_USER="root" # normally root
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# User and group in which the service switches to - IE: nginx,apache,mysql,postgres # User and group in which the service switches to - IE: nginx,apache,mysql,postgres
#SERVICE_USER="git" # execute command as another user SERVICE_USER="git" # execute command as another user
#SERVICE_GROUP="git" # Set the service group SERVICE_GROUP="git" # Set the service group
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set user and group ID # Set user and group ID
#SERVICE_UID="0" # set the user id #SERVICE_UID="0" # set the user id