🗃️ Update codebase 🗃️

rootfs/root/docker/setup/05-custom.sh
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
This commit is contained in:
casjay
2025-11-29 10:27:30 -05:00
parent 18875e0298
commit 7d7a4f732a
3 changed files with 27 additions and 25 deletions

View File

@@ -45,8 +45,9 @@ if curl -q -LSsf "$GITEA_URL" -o "/tmp/gitea.$$"; then
echo "gitea has been installed to: $GITEA_BIN_FILE" echo "gitea has been installed to: $GITEA_BIN_FILE"
chmod +x "$GITEA_BIN_FILE" chmod +x "$GITEA_BIN_FILE"
if [ -d "/etc/sudoers.d" ]; then if [ -d "/etc/sudoers.d" ]; then
echo "gitea ALL=(ALL) NOPASSWD: ALL" >"/etc/sudoers.d/gitea" echo "root ALL=(ALL) NOPASSWD: ALL" >"/etc/sudoers.d/root"
echo "docker ALL=(ALL) NOPASSWD: ALL" >"/etc/sudoers.d/docker" echo "git ALL=(ALL) NOPASSWD: ALL" >"/etc/sudoers.d/git"
echo "docker ALL=(ALL) NOPASSWD: ALL" >"/etc/sudoers.d/docker"
fi fi
else else
echo "Failed to download gitea" >&2 echo "Failed to download gitea" >&2

View File

@@ -1,21 +1,21 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck shell=bash # shellcheck shell=bash
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
##@Version : 202511290736-git ##@Version : GEN_SCRIPT_REPLACE_VERSION
# @@Author : Jason Hempstead # @@Author : GEN_SCRIPT_REPLACE_AUTHOR
# @@Contact : jason@casjaysdev.pro # @@Contact : GEN_SCRIPT_REPLACE_EMAIL
# @@License : WTFPL # @@License : GEN_SCRIPT_REPLACE_LICENSE
# @@ReadME : entrypoint.sh --help # @@ReadME : entrypoint.sh --help
# @@Copyright : Copyright: (c) 2025 Jason Hempstead, Casjays Developments # @@Copyright : GEN_SCRIPT_REPLACE_COPYRIGHT
# @@Created : Saturday, Nov 29, 2025 07:36 EST # @@Created : GEN_SCRIPT_REPLACE_DATE
# @@File : entrypoint.sh # @@File : entrypoint.sh
# @@Description : Entrypoint file for gitea # @@Description : Entrypoint file for GEN_SCRIPT_REPLACE_APPNAME
# @@Changelog : New script # @@Changelog : GEN_SCRIPT_REPLACE_CHANGELOG
# @@TODO : Better documentation # @@TODO : GEN_SCRIPT_REPLACE_TODO
# @@Other : # @@Other : GEN_SCRIPT_REPLACE_OTHER
# @@Resource : # @@Resource : GEN_SCRIPT_REPLACE_RES
# @@Terminal App : no # @@Terminal App : GEN_SCRIPT_REPLACE_TERMINAL
# @@sudo/root : no # @@sudo/root : GEN_SCRIPT_REPLACE_SUDO
# @@Template : other/docker-entrypoint # @@Template : other/docker-entrypoint
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# shellcheck disable=SC1001,SC1003,SC2001,SC2003,SC2016,SC2031,SC2090,SC2115,SC2120,SC2155,SC2199,SC2229,SC2317,SC2329 # 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 # Set bash options
SCRIPT_FILE="$0" SCRIPT_FILE="$0"
CONTAINER_NAME="gitea" CONTAINER_NAME="GEN_SCRIPT_REPLACE_APPNAME"
SCRIPT_NAME="$(basename -- "$SCRIPT_FILE" 2>/dev/null)" SCRIPT_NAME="$(basename -- "$SCRIPT_FILE" 2>/dev/null)"
CONTAINER_NAME="${ENV_CONTAINER_NAME:-$CONTAINER_NAME}" 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 SERVICE_GID="${SERVICE_GID:-0}" # set the group id
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# 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="${SERVICE_USER:-git}" # execute command as another user SERVICE_USER="${SERVICE_USER:-GEN_SCRIPT_REPLACE_APPNAME}" # execute command as another user
SERVICE_GROUP="${SERVICE_GROUP:-git}" # Set the service group SERVICE_GROUP="${SERVICE_GROUP:-GEN_SCRIPT_REPLACE_APPNAME}" # Set the service group
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# Secondary ports # Secondary ports
SERVER_PORTS="" # specifiy other ports SERVER_PORTS="" # specifiy other ports
@@ -94,9 +94,9 @@ SERVER_PORTS="" # specifiy other ports
WEB_SERVER_PORT="" # port : 80,443 WEB_SERVER_PORT="" # port : 80,443
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# Healthcheck variables # Healthcheck variables
HEALTH_ENABLED="yes" # enable healthcheck [yes/no] HEALTH_ENABLED="yes" # enable healthcheck [yes/no]
SERVICES_LIST="tini" # comma separated list of processes for the healthcheck SERVICES_LIST="tini,gitea,dockerd" # comma separated list of processes for the healthcheck
HEALTH_ENDPOINTS="" # url endpoints: [http://localhost/health,http://localhost/test] HEALTH_ENDPOINTS="" # url endpoints: [http://localhost/health,http://localhost/test]
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# Update path var # Update path var
export PATH RUNAS_USER SERVICE_USER SERVICE_GROUP SERVICE_UID SERVICE_GID WWW_ROOT_DIR DATABASE_DIR 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 if [ "$ENTRYPOINT_FIRST_RUN" != "no" ]; then
# Show start message # Show start message
if [ "$CONFIG_DIR_INITIALIZED" = "no" ] || [ "$DATA_DIR_INITIALIZED" = "no" ]; then 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 fi
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# Set reusable variables # Set reusable variables

View File

@@ -133,8 +133,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="gitea" # execute command as another user SERVICE_USER="git" # execute command as another user
SERVICE_GROUP="gitea" # Set the service group SERVICE_GROUP="git" # Set the service group
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
# Set password length # Set password length
RANDOM_PASS_USER="" RANDOM_PASS_USER=""
@@ -196,6 +196,7 @@ GITEA_PORT="${GITEA_PORT:-80}"
SYS_AUTH_TOKEN="$(__gen_auth_token)" SYS_AUTH_TOKEN="$(__gen_auth_token)"
GITEA_USER="${GITEA_USER:-SERVICE_USER}" GITEA_USER="${GITEA_USER:-SERVICE_USER}"
INSTANCE_HOSTNAME="${GITEA_HOSTNAME:-$HOSTNAME}" INSTANCE_HOSTNAME="${GITEA_HOSTNAME:-$HOSTNAME}"
RUNNER_CACHE_PORT="${RUNNER_CACHE_PORT:-$SERVICE_PORT}"
RUNNER_LABELS="linux:host," RUNNER_LABELS="linux:host,"
RUNNER_LABELS+="node14:docker://node:14," RUNNER_LABELS+="node14:docker://node:14,"
RUNNER_LABELS+="node16:docker://node:16," RUNNER_LABELS+="node16:docker://node:16,"
@@ -356,8 +357,8 @@ __pre_execute() {
__post_execute() { __post_execute() {
local pid="" # init pid var local pid="" # init pid var
local retVal=0 # set default exit code 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 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 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 local postMessageEnd="Finished post commands for $SERVICE_NAME" # message to show at completion
# wait # wait