From 9a8395d79c149392cdee0f30e1995c633c5b81ec Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Sat, 24 Jan 2026 11:18:49 +0100 Subject: [PATCH] fix(gitea): Fix git user creation in container startup - Use /bin/sh instead of /bin/bash for git user shell - Check for su-exec binary instead of marker file for deps - Always recreate git user on startup (doesn't persist in container) - Set explicit UID 1000 for git user - Bump release to r3 Co-Authored-By: Claude Opus 4.5 --- package/secubox/secubox-app-gitea/Makefile | 2 +- .../secubox-app-gitea/files/usr/sbin/giteactl | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/package/secubox/secubox-app-gitea/Makefile b/package/secubox/secubox-app-gitea/Makefile index 29603f5b..1c612565 100644 --- a/package/secubox/secubox-app-gitea/Makefile +++ b/package/secubox/secubox-app-gitea/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=secubox-app-gitea PKG_VERSION:=1.0.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_ARCH:=all PKG_MAINTAINER:=CyberMind Studio diff --git a/package/secubox/secubox-app-gitea/files/usr/sbin/giteactl b/package/secubox/secubox-app-gitea/files/usr/sbin/giteactl index dfa2a084..9a8532ab 100644 --- a/package/secubox/secubox-app-gitea/files/usr/sbin/giteactl +++ b/package/secubox/secubox-app-gitea/files/usr/sbin/giteactl @@ -237,16 +237,18 @@ set -e export GITEA_WORK_DIR=/data export USER=git -# First run: install required packages -if [ ! -f /tmp/.gitea-deps-installed ]; then - echo "Installing dependencies (first run)..." +# Install packages if needed (check if su-exec exists) +if ! command -v su-exec >/dev/null 2>&1; then + echo "Installing dependencies..." apk update - apk add --no-cache git git-lfs openssh bash su-exec sqlite - touch /tmp/.gitea-deps-installed + apk add --no-cache git git-lfs openssh su-exec sqlite fi -# Ensure git user exists -id -u git >/dev/null 2>&1 || adduser -D -s /bin/bash -h /data git +# Always ensure git user exists (doesn't persist between container restarts) +if ! id -u git >/dev/null 2>&1; then + echo "Creating git user..." + adduser -D -s /bin/sh -h /data -u 1000 git +fi # Ensure directories exist with correct ownership mkdir -p /data/git/repositories