From 7d7a4f732adeae612370776974dc63e50fee67ed Mon Sep 17 00:00:00 2001 From: casjay Date: Sat, 29 Nov 2025 10:27:30 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Update=20codebase=20?= =?UTF-8?q?=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/root/docker/setup/05-custom.sh rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh --- rootfs/root/docker/setup/05-custom.sh | 5 ++- rootfs/usr/local/bin/entrypoint.sh | 40 +++++++++---------- .../local/etc/docker/init.d/zz-act_runner.sh | 7 ++-- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/rootfs/root/docker/setup/05-custom.sh b/rootfs/root/docker/setup/05-custom.sh index 7437c48..48be11e 100755 --- a/rootfs/root/docker/setup/05-custom.sh +++ b/rootfs/root/docker/setup/05-custom.sh @@ -45,8 +45,9 @@ if curl -q -LSsf "$GITEA_URL" -o "/tmp/gitea.$$"; then echo "gitea has been installed to: $GITEA_BIN_FILE" chmod +x "$GITEA_BIN_FILE" if [ -d "/etc/sudoers.d" ]; then - echo "gitea ALL=(ALL) NOPASSWD: ALL" >"/etc/sudoers.d/gitea" - echo "docker ALL=(ALL) NOPASSWD: ALL" >"/etc/sudoers.d/docker" + echo "root ALL=(ALL) NOPASSWD: ALL" >"/etc/sudoers.d/root" + echo "git ALL=(ALL) NOPASSWD: ALL" >"/etc/sudoers.d/git" + echo "docker ALL=(ALL) NOPASSWD: ALL" >"/etc/sudoers.d/docker" fi else echo "Failed to download gitea" >&2 diff --git a/rootfs/usr/local/bin/entrypoint.sh b/rootfs/usr/local/bin/entrypoint.sh index 906e147..38f347e 100755 --- a/rootfs/usr/local/bin/entrypoint.sh +++ b/rootfs/usr/local/bin/entrypoint.sh @@ -1,21 +1,21 @@ #!/usr/bin/env bash # shellcheck shell=bash # - - - - - - - - - - - - - - - - - - - - - - - - - -##@Version : 202511290736-git -# @@Author : Jason Hempstead -# @@Contact : jason@casjaysdev.pro -# @@License : WTFPL +##@Version : GEN_SCRIPT_REPLACE_VERSION +# @@Author : GEN_SCRIPT_REPLACE_AUTHOR +# @@Contact : GEN_SCRIPT_REPLACE_EMAIL +# @@License : GEN_SCRIPT_REPLACE_LICENSE # @@ReadME : entrypoint.sh --help -# @@Copyright : Copyright: (c) 2025 Jason Hempstead, Casjays Developments -# @@Created : Saturday, Nov 29, 2025 07:36 EST +# @@Copyright : GEN_SCRIPT_REPLACE_COPYRIGHT +# @@Created : GEN_SCRIPT_REPLACE_DATE # @@File : entrypoint.sh -# @@Description : Entrypoint file for gitea -# @@Changelog : New script -# @@TODO : Better documentation -# @@Other : -# @@Resource : -# @@Terminal App : no -# @@sudo/root : no +# @@Description : Entrypoint file for GEN_SCRIPT_REPLACE_APPNAME +# @@Changelog : GEN_SCRIPT_REPLACE_CHANGELOG +# @@TODO : GEN_SCRIPT_REPLACE_TODO +# @@Other : GEN_SCRIPT_REPLACE_OTHER +# @@Resource : GEN_SCRIPT_REPLACE_RES +# @@Terminal App : GEN_SCRIPT_REPLACE_TERMINAL +# @@sudo/root : GEN_SCRIPT_REPLACE_SUDO # @@Template : other/docker-entrypoint # - - - - - - - - - - - - - - - - - - - - - - - - - # shellcheck disable=SC1001,SC1003,SC2001,SC2003,SC2016,SC2031,SC2090,SC2115,SC2120,SC2155,SC2199,SC2229,SC2317,SC2329 @@ -31,7 +31,7 @@ PATH="/usr/local/etc/docker/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin" # - - - - - - - - - - - - - - - - - - - - - - - - - # Set bash options SCRIPT_FILE="$0" -CONTAINER_NAME="gitea" +CONTAINER_NAME="GEN_SCRIPT_REPLACE_APPNAME" SCRIPT_NAME="$(basename -- "$SCRIPT_FILE" 2>/dev/null)" CONTAINER_NAME="${ENV_CONTAINER_NAME:-$CONTAINER_NAME}" # - - - - - - - - - - - - - - - - - - - - - - - - - @@ -84,8 +84,8 @@ SERVICE_UID="${SERVICE_UID:-0}" # set the user id SERVICE_GID="${SERVICE_GID:-0}" # set the group id # - - - - - - - - - - - - - - - - - - - - - - - - - # User and group in which the service switches to - IE: nginx,apache,mysql,postgres -SERVICE_USER="${SERVICE_USER:-git}" # execute command as another user -SERVICE_GROUP="${SERVICE_GROUP:-git}" # Set the service group +SERVICE_USER="${SERVICE_USER:-GEN_SCRIPT_REPLACE_APPNAME}" # execute command as another user +SERVICE_GROUP="${SERVICE_GROUP:-GEN_SCRIPT_REPLACE_APPNAME}" # Set the service group # - - - - - - - - - - - - - - - - - - - - - - - - - # Secondary ports SERVER_PORTS="" # specifiy other ports @@ -94,9 +94,9 @@ SERVER_PORTS="" # specifiy other ports WEB_SERVER_PORT="" # port : 80,443 # - - - - - - - - - - - - - - - - - - - - - - - - - # Healthcheck variables -HEALTH_ENABLED="yes" # enable healthcheck [yes/no] -SERVICES_LIST="tini" # comma separated list of processes for the healthcheck -HEALTH_ENDPOINTS="" # url endpoints: [http://localhost/health,http://localhost/test] +HEALTH_ENABLED="yes" # enable healthcheck [yes/no] +SERVICES_LIST="tini,gitea,dockerd" # comma separated list of processes for the healthcheck +HEALTH_ENDPOINTS="" # url endpoints: [http://localhost/health,http://localhost/test] # - - - - - - - - - - - - - - - - - - - - - - - - - # Update path var export PATH RUNAS_USER SERVICE_USER SERVICE_GROUP SERVICE_UID SERVICE_GID WWW_ROOT_DIR DATABASE_DIR @@ -258,7 +258,7 @@ fi if [ "$ENTRYPOINT_FIRST_RUN" != "no" ]; then # Show start message if [ "$CONFIG_DIR_INITIALIZED" = "no" ] || [ "$DATA_DIR_INITIALIZED" = "no" ]; then - [ "$ENTRYPOINT_MESSAGE" = "yes" ] && echo "Executing entrypoint script for gitea" + [ "$ENTRYPOINT_MESSAGE" = "yes" ] && echo "Executing entrypoint script for GEN_SCRIPT_REPLACE_APPNAME" fi # - - - - - - - - - - - - - - - - - - - - - - - - - # Set reusable variables diff --git a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh index 576aedc..634ba72 100755 --- a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh +++ b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh @@ -133,8 +133,8 @@ SERVICE_PORT="44015" RUNAS_USER="root" # normally root # - - - - - - - - - - - - - - - - - - - - - - - - - # User and group in which the service switches to - IE: nginx,apache,mysql,postgres -SERVICE_USER="gitea" # execute command as another user -SERVICE_GROUP="gitea" # Set the service group +SERVICE_USER="git" # execute command as another user +SERVICE_GROUP="git" # Set the service group # - - - - - - - - - - - - - - - - - - - - - - - - - # Set password length RANDOM_PASS_USER="" @@ -196,6 +196,7 @@ GITEA_PORT="${GITEA_PORT:-80}" SYS_AUTH_TOKEN="$(__gen_auth_token)" GITEA_USER="${GITEA_USER:-SERVICE_USER}" INSTANCE_HOSTNAME="${GITEA_HOSTNAME:-$HOSTNAME}" +RUNNER_CACHE_PORT="${RUNNER_CACHE_PORT:-$SERVICE_PORT}" RUNNER_LABELS="linux:host," RUNNER_LABELS+="node14:docker://node:14," RUNNER_LABELS+="node16:docker://node:16," @@ -356,8 +357,8 @@ __pre_execute() { __post_execute() { local pid="" # init pid var local retVal=0 # set default exit code - local ctime=${POST_EXECUTE_WAIT_TIME:-1} # how long to wait before executing local waitTime=$((ctime * 60)) # convert minutes to seconds + local ctime=${POST_EXECUTE_WAIT_TIME:-1} # how long to wait before executing local postMessageST="Running post commands for $SERVICE_NAME" # message to show at start local postMessageEnd="Finished post commands for $SERVICE_NAME" # message to show at completion # wait