From b0fd4ad4b751e70a3210aa0f9cb2d1ff2a023293 Mon Sep 17 00:00:00 2001 From: BeauTroll <-> Date: Wed, 17 Dec 2025 06:00:53 +0100 Subject: [PATCH] Use USER_UID and USER_GID from environment in restore script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated restore script to respect USER_UID and USER_GID environment variables with default values of 1000:1000. This aligns with docker-compose.yml configuration and allows users to customize file ownership if needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- scripts/restore.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/restore.sh b/scripts/restore.sh index 69b0f96..a513b7a 100755 --- a/scripts/restore.sh +++ b/scripts/restore.sh @@ -252,9 +252,11 @@ if ! sudo tar xzf "$BACKUP_DIR/gitea_data.tar.gz" -C "$DATA_DIR" 2>> "$LOG_FILE" exit 1 fi -# Restaurer les bonnes permissions (UID/GID 1000 pour Gitea) -log "Restauration des permissions..." -if ! sudo chown -R 1000:1000 "$DATA_DIR" 2>> "$LOG_FILE"; then +# Restaurer les bonnes permissions (UID/GID pour Gitea) +GITEA_UID=${USER_UID:-1000} +GITEA_GID=${USER_GID:-1000} +log "Restauration des permissions (${GITEA_UID}:${GITEA_GID})..." +if ! sudo chown -R "${GITEA_UID}:${GITEA_GID}" "$DATA_DIR" 2>> "$LOG_FILE"; then log "${YELLOW}Avertissement: Impossible de changer les permissions${NC}" fi