From 6ad1ea004f44ca3189c9b8feaa19b0c7b4649210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Sun, 9 Mar 2025 15:20:16 +0100 Subject: [PATCH] Open WebUI: reset code base before pulling update (#2948) * fix: hard reset codebase before pulling * backup data folder just in case * bad path fix * another safety layer * final touches * i'm dumb --- ct/openwebui.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ct/openwebui.sh b/ct/openwebui.sh index 17fff9d8b..7c6100a37 100644 --- a/ct/openwebui.sh +++ b/ct/openwebui.sh @@ -29,6 +29,11 @@ function update_script() { fi msg_info "Updating ${APP} (Patience)" cd /opt/open-webui + mkdir /opt/open-webui-backup + cp -rf /opt/open-webui/backend/data /opt/open-webui-backup + git add -A + $STD git stash + $STD git reset --hard output=$(git pull --no-rebase) if echo "$output" | grep -q "Already up to date."; then msg_ok "$APP is already up to date." @@ -40,6 +45,8 @@ function update_script() { $STD npm run build cd ./backend $STD pip install -r requirements.txt -U + cp -rf /opt/open-webui-backup/* /opt/open-webui/backend + $STD git stash pop systemctl start open-webui.service msg_ok "Updated Successfully" exit