Update oweb

This commit is contained in:
tremor021 2025-05-19 22:48:46 +02:00
parent cc51e7d9c9
commit e59cc56253
2 changed files with 14 additions and 13 deletions

View File

@ -44,18 +44,19 @@ function update_script() {
msg_info "Updating ${APP} (Patience)"
systemctl stop open-webui.service
mkdir -p /opt/open-webui-backup
cp -rf /opt/open-webui/backend/data /opt/open-webui-backup
cp /opt/open-webui/.env /opt
rm -rf /opt/open-webui
mkdir -p /opt/openwebui-backup
cp -rf /opt/openwebui/backend/data /opt/openwebui-backup
cp /opt/openwebui/.env /opt
rm -rf /opt/openwebui
fetch_and_deploy_gh_release "open-webui/open-webui"
cd /opt/open-webui
cd /opt/openwebui
$STD npm install
export NODE_OPTIONS="--max-old-space-size=3584"
$STD npm run build
cd ./backend
$STD pip install -r requirements.txt -U
cp -rf /opt/open-webui-backup/* /opt/open-webui/backend
cp -rf /opt/openwebui-backup/* /opt/openwebui/backend
mv /opt/.env /opt/openwebui/
systemctl start open-webui.service
msg_ok "Updated Successfully"
exit

View File

@ -30,12 +30,12 @@ install_node_and_modules
msg_info "Installing Open WebUI (Patience)"
fetch_and_deploy_gh_release "open-webui/open-webui"
cd /opt/open-webui/backend
cd /opt/openwebui/backend
$STD pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
$STD pip3 install -r requirements.txt -U
cd /opt/open-webui
cd /opt/openwebui
cp .env.example .env
cat <<EOF >/opt/open-webui/.env
cat <<EOF >/opt/openwebui/.env
ENV=prod
ENABLE_OLLAMA_API=false
OLLAMA_BASE_URL=http://0.0.0.0:11434
@ -68,7 +68,7 @@ RestartSec=3
WantedBy=multi-user.target
EOF
systemctl enable -q --now ollama
sed -i 's/ENABLE_OLLAMA_API=false/ENABLE_OLLAMA_API=true/g' /opt/open-webui/.env
sed -i 's/ENABLE_OLLAMA_API=false/ENABLE_OLLAMA_API=true/g' /opt/openwebui/.env
msg_ok "Installed Ollama"
fi
@ -80,9 +80,9 @@ After=network.target
[Service]
Type=exec
WorkingDirectory=/opt/open-webui
EnvironmentFile=/opt/open-webui/.env
ExecStart=/opt/open-webui/backend/start.sh
WorkingDirectory=/opt/openwebui
EnvironmentFile=/opt/openwebui/.env
ExecStart=/opt/openwebui/backend/start.sh
[Install]
WantedBy=multi-user.target