mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-11-11 13:52:51 +00:00
Compare commits
2 Commits
main
...
openwebui_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da2df6f17c | ||
|
|
8141779239 |
@@ -23,6 +23,62 @@ function update_script() {
|
|||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
|
if [[ -d /opt/open-webui ]]; then
|
||||||
|
msg_warn "Legacy installation detected — migrating to uv based install..."
|
||||||
|
msg_info "Stopping Service"
|
||||||
|
systemctl stop open-webui
|
||||||
|
msg_ok "Stopped Service"
|
||||||
|
|
||||||
|
msg_info "Creating Backup"
|
||||||
|
mkdir -p /opt/open-webui-backup
|
||||||
|
cp -a /opt/open-webui/backend/data /opt/open-webui-backup/data || true
|
||||||
|
msg_ok "Created Backup"
|
||||||
|
|
||||||
|
msg_info "Removing legacy installation"
|
||||||
|
rm -rf /opt/open-webui
|
||||||
|
rm -rf /root/.open-webui || true
|
||||||
|
msg_ok "Removed legacy installation"
|
||||||
|
|
||||||
|
msg_info "Installing uv-based Open-WebUI"
|
||||||
|
PYTHON_VERSION="3.12" setup_uv
|
||||||
|
$STD uv tool install --python $PYTHON_VERSION open-webui[all]
|
||||||
|
msg_ok "Installed uv-based Open-WebUI"
|
||||||
|
|
||||||
|
msg_info "Restoring data"
|
||||||
|
mkdir -p /root/.open-webui
|
||||||
|
cp -a /opt/open-webui-backup/data/* /root/.open-webui/ || true
|
||||||
|
rm -rf /opt/open-webui-backup || true
|
||||||
|
msg_ok "Restored data"
|
||||||
|
|
||||||
|
msg_info "Recreating Service"
|
||||||
|
cat <<EOF >/etc/systemd/system/open-webui.service
|
||||||
|
[Unit]
|
||||||
|
Description=Open WebUI Service
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Environment=DATA_DIR=/root/.open-webui
|
||||||
|
EnvironmentFile=-/root/.env
|
||||||
|
ExecStart=/root/.local/bin/open-webui serve
|
||||||
|
WorkingDirectory=/root
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5
|
||||||
|
User=root
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
|
||||||
|
$STD systemctl daemon-reload
|
||||||
|
systemctl enable -q --now open-webui
|
||||||
|
msg_ok "Recreated Service"
|
||||||
|
|
||||||
|
msg_ok "Migration completed"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ! -d /root/.open-webui ]]; then
|
if [[ ! -d /root/.open-webui ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
@@ -50,8 +106,11 @@ function update_script() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_info "Restarting Open WebUI to initiate update"
|
msg_info "Updating Open WebUI via uv"
|
||||||
|
PYTHON_VERSION="3.12" setup_uv
|
||||||
|
$STD uv tool install --python 3.12 open-webui[all]
|
||||||
systemctl restart open-webui
|
systemctl restart open-webui
|
||||||
|
msg_ok "Updated Open WebUI"
|
||||||
msg_ok "Updated successfully!"
|
msg_ok "Updated successfully!"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,11 @@ msg_info "Installing Dependencies"
|
|||||||
$STD apt install -y ffmpeg
|
$STD apt install -y ffmpeg
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
USE_UVX="YES" PYTHON_VERSION="3.12" setup_uv
|
PYTHON_VERSION="3.12" setup_uv
|
||||||
|
|
||||||
|
msg_info "Installing Open WebUI"
|
||||||
|
$STD uv tool install --python 3.12 open-webui[all]
|
||||||
|
msg_ok "Installed Open WebUI"
|
||||||
|
|
||||||
read -r -p "${TAB3}Would you like to add Ollama? <y/N> " prompt
|
read -r -p "${TAB3}Would you like to add Ollama? <y/N> " prompt
|
||||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||||
@@ -56,7 +60,7 @@ After=network.target
|
|||||||
Type=simple
|
Type=simple
|
||||||
EnvironmentFile=-/root/.env
|
EnvironmentFile=-/root/.env
|
||||||
Environment=DATA_DIR=/root/.open-webui
|
Environment=DATA_DIR=/root/.open-webui
|
||||||
ExecStart=/usr/local/bin/uvx --python 3.12 open-webui@latest serve
|
ExecStart=/root/.local/bin/open-webui serve
|
||||||
WorkingDirectory=/root
|
WorkingDirectory=/root
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
@@ -70,9 +74,4 @@ msg_ok "Created Service"
|
|||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
cleanup_lxc
|
||||||
msg_info "Cleaning up"
|
|
||||||
$STD apt -y autoremove
|
|
||||||
$STD apt -y autoclean
|
|
||||||
$STD apt -y clean
|
|
||||||
msg_ok "Cleaned"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user