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 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-01-24 11:18:49 +01:00
parent 7386c1a691
commit 9a8395d79c
2 changed files with 10 additions and 8 deletions

View File

@ -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 <contact@cybermind.fr>

View File

@ -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