🐛 Fix silent download failure and cosmetic naming bugs 🐛

Fixes three bugs discovered during live container testing.
The critical bug was a bash post-increment no-op: `exitCode=$((exitCode++))`
assigns the *old* value back to the variable, so exitCode stays 0 even
when a download fails. This caused the Docker build to succeed silently
when the gitea binary download failed, publishing a broken image to Docker Hub.
- rootfs/root/docker/setup/05-custom.sh: change exitCode=$((exitCode++)) to
exitCode=$((exitCode + 1)) in both the gitea and act_runner failure handlers
- rootfs/usr/local/bin/entrypoint.sh: change CONTAINER_NAME and description
from "archlinux" (copied template default) to "gitea"
- rootfs/usr/local/etc/docker/init.d/08-gitea.sh: remove leading space from
[ -d " /config/ssh" ] path test so the directory existence check is correct

.claude/
rootfs/root/docker/setup/05-custom.sh
rootfs/usr/local/bin/entrypoint.sh
rootfs/usr/local/etc/docker/init.d/08-gitea.sh
This commit is contained in:
2026-05-24 19:58:15 -04:00
parent 04b36738f6
commit 7668154e67
4 changed files with 13 additions and 6 deletions
+7
View File
@@ -0,0 +1,7 @@
{
"permissions": {
"allow": [
"Bash(script-lint *)"
]
}
}
+2 -2
View File
@@ -51,7 +51,7 @@ if curl -q -LSsf "$GITEA_URL" -o "/tmp/gitea.$$"; then
fi fi
else else
echo "Failed to download gitea" >&2 echo "Failed to download gitea" >&2
exitCode=$((exitCode++)) exitCode=$((exitCode + 1))
fi fi
echo "Downloading act_runner from $ACT_URL" echo "Downloading act_runner from $ACT_URL"
if curl -q -LSsf "$ACT_URL" -o "/tmp/act_runner.$$"; then if curl -q -LSsf "$ACT_URL" -o "/tmp/act_runner.$$"; then
@@ -60,7 +60,7 @@ if curl -q -LSsf "$ACT_URL" -o "/tmp/act_runner.$$"; then
chmod +x "$ACT_BIN_FILE" chmod +x "$ACT_BIN_FILE"
else else
echo "Failed to download act_runner" >&2 echo "Failed to download act_runner" >&2
exitCode=$((exitCode++)) exitCode=$((exitCode + 1))
fi fi
[ -x "$ACT_BIN_FILE" ] && [ -x "$GITEA_BIN_FILE" ] && exitCode=0 [ -x "$ACT_BIN_FILE" ] && [ -x "$GITEA_BIN_FILE" ] && exitCode=0
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
+3 -3
View File
@@ -9,7 +9,7 @@
# @@Copyright : Copyright: (c) 2026 Jason Hempstead, Casjays Developments # @@Copyright : Copyright: (c) 2026 Jason Hempstead, Casjays Developments
# @@Created : Sunday, May 24, 2026 11:58 EDT # @@Created : Sunday, May 24, 2026 11:58 EDT
# @@File : entrypoint.sh # @@File : entrypoint.sh
# @@Description : Entrypoint file for archlinux # @@Description : Entrypoint file for gitea
# @@Changelog : New script # @@Changelog : New script
# @@TODO : Better documentation # @@TODO : Better documentation
# @@Other : # @@Other :
@@ -39,7 +39,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="archlinux" CONTAINER_NAME="gitea"
SCRIPT_NAME="${SCRIPT_FILE##*/}" SCRIPT_NAME="${SCRIPT_FILE##*/}"
CONTAINER_NAME="${ENV_CONTAINER_NAME:-$CONTAINER_NAME}" CONTAINER_NAME="${ENV_CONTAINER_NAME:-$CONTAINER_NAME}"
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -294,7 +294,7 @@ fi
if [ "$ENTRYPOINT_FIRST_RUN" != "no" ]; then if [ "$ENTRYPOINT_FIRST_RUN" != "no" ]; then
if [ "$CONFIG_DIR_INITIALIZED" = "no" ] || [ "$DATA_DIR_INITIALIZED" = "no" ]; then if [ "$CONFIG_DIR_INITIALIZED" = "no" ] || [ "$DATA_DIR_INITIALIZED" = "no" ]; then
if [ "$ENTRYPOINT_MESSAGE" = "yes" ]; then if [ "$ENTRYPOINT_MESSAGE" = "yes" ]; then
echo "Executing entrypoint script for archlinux" echo "Executing entrypoint script for gitea"
fi fi
fi fi
# - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - -