From 42b59e10bf83f329a362a5359e67ecf316925e7e Mon Sep 17 00:00:00 2001 From: fabritsky Date: Thu, 28 May 2026 08:47:56 +0700 Subject: [PATCH] refactor: make update.sh user-agnostic by pulling via HTTPS --- update.sh | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/update.sh b/update.sh index 7a4c1e7..6bf8f5c 100755 --- a/update.sh +++ b/update.sh @@ -37,19 +37,12 @@ fi log "Configuring git safe directory" git config --global --add safe.directory "$INSTALL_DIR" || true -# 4. Pull changes using the deploy key -log "Pulling latest changes from Gitea" -SSH_KEY="/home/fabritsky/.ssh/gitea_corp_address_book_ed25519" -if [ ! -f "$SSH_KEY" ]; then - # Fallback: search for any deploy/private key in fabritsky's .ssh directory - SSH_KEY_FOUND=$(find /home/fabritsky/.ssh/ -type f \( -name "*gitea*" -o -name "*ed25519*" -o -name "*rsa*" \) ! -name "*.pub" | head -n 1) - if [ -n "$SSH_KEY_FOUND" ]; then - SSH_KEY="$SSH_KEY_FOUND" - fi -fi +# 4. Configure git remote and pull latest changes +log "Configuring git remote to HTTPS" +git remote set-url origin https://git.h0melab.ru/fabritsky/corp-address-book.git -log "Using SSH key: ${SSH_KEY}" -GIT_SSH_COMMAND="ssh -i ${SSH_KEY} -o StrictHostKeyChecking=no -o BatchMode=yes" git pull +log "Pulling latest changes from Gitea via HTTPS" +git pull --ff-only origin main # 5. Build Docker Image (Re-compile frontend and backend inside container) log "Building updated Docker image ${IMAGE_NAME}"