mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-11-06 11:22:49 +00:00
Refactor (#8874)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2025 tteck
|
||||
# Author: havardthom
|
||||
# Author: tteck | Co-Author: havardthom | Co-Author: Slaviša Arežina (tremor021)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://openwebui.com/
|
||||
|
||||
@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-4}"
|
||||
var_ram="${var_ram:-8192}"
|
||||
var_disk="${var_disk:-25}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-12}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
@@ -23,7 +23,7 @@ function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /opt/open-webui ]]; then
|
||||
if [[ ! -d /root/.open-webui ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
@@ -50,29 +50,8 @@ function update_script() {
|
||||
fi
|
||||
fi
|
||||
|
||||
msg_info "Updating ${APP} (Patience)"
|
||||
cd /opt/open-webui
|
||||
mkdir -p /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."
|
||||
exit
|
||||
fi
|
||||
systemctl stop open-webui.service
|
||||
$STD npm install --force
|
||||
export NODE_OPTIONS="--max-old-space-size=6000"
|
||||
$STD npm run build
|
||||
cd ./backend
|
||||
$STD pip install -r requirements.txt -U
|
||||
cp -rf /opt/open-webui-backup/* /opt/open-webui/backend
|
||||
if git stash list | grep -q 'stash@{'; then
|
||||
$STD git stash pop
|
||||
fi
|
||||
systemctl start open-webui.service
|
||||
msg_info "Restarting Open WebUI to initiate update"
|
||||
systemctl restart open-webui
|
||||
msg_ok "Updated successfully!"
|
||||
exit
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"documentation": "https://docs.openwebui.com/",
|
||||
"website": "https://openwebui.com/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/open-webui.webp",
|
||||
"config_path": "/opt/open-webui/.env",
|
||||
"config_path": "/root/.env",
|
||||
"description": "OpenWebUI is a self-hosted, web-based interface that allows you to run AI models entirely offline. It integrates with various LLM runners, such as OpenAI and Ollama, and supports features like markdown and LaTeX rendering, model management, and voice/video calls. It also offers multilingual support and the ability to generate images using APIs like DALL-E or ComfyUI",
|
||||
"install_methods": [
|
||||
{
|
||||
@@ -23,7 +23,7 @@
|
||||
"ram": 8192,
|
||||
"hdd": 25,
|
||||
"os": "debian",
|
||||
"version": "12"
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -35,6 +35,10 @@
|
||||
{
|
||||
"text": "Script contains optional installation of Ollama.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Initial run of the application/container can take some time, depending on your host speed, as the application is installed/updated at runtime. Please be patient!",
|
||||
"type": "warning"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 tteck
|
||||
# Author: tteck
|
||||
# Co-Author: havardthom
|
||||
# Author: tteck | Co-Author: havardthom | Co-Author: Slaviša Arežina (tremor021)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://openwebui.com/
|
||||
|
||||
@@ -15,36 +14,10 @@ network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
git \
|
||||
ffmpeg \
|
||||
libpq-dev
|
||||
$STD apt install -y ffmpeg
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Setup Python3"
|
||||
$STD apt install -y --no-install-recommends \
|
||||
python3 \
|
||||
python3-pip
|
||||
msg_ok "Setup Python3"
|
||||
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
|
||||
msg_info "Installing Open WebUI (Patience)"
|
||||
$STD git clone https://github.com/open-webui/open-webui.git /opt/open-webui
|
||||
cd /opt/open-webui/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
|
||||
cp .env.example .env
|
||||
cat <<EOF >/opt/open-webui/.env
|
||||
ENV=prod
|
||||
ENABLE_OLLAMA_API=false
|
||||
OLLAMA_BASE_URL=http://0.0.0.0:11434
|
||||
EOF
|
||||
$STD npm install --force
|
||||
export NODE_OPTIONS="--max-old-space-size=6000"
|
||||
$STD npm run build
|
||||
msg_ok "Installed Open WebUI"
|
||||
USE_UVX="YES" PYTHON_VERSION="3.12" setup_uv
|
||||
|
||||
read -r -p "${TAB3}Would you like to add Ollama? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
@@ -69,7 +42,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
|
||||
echo "ENABLE_OLLAMA_API=true" >/root/.env
|
||||
msg_ok "Installed Ollama"
|
||||
fi
|
||||
|
||||
@@ -80,10 +53,14 @@ Description=Open WebUI Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
WorkingDirectory=/opt/open-webui
|
||||
EnvironmentFile=/opt/open-webui/.env
|
||||
ExecStart=/opt/open-webui/backend/start.sh
|
||||
Type=simple
|
||||
EnvironmentFile=-/root/.env
|
||||
Environment=DATA_DIR=/root/.open-webui
|
||||
ExecStart=/usr/local/bin/uvx --python 3.12 open-webui@latest serve
|
||||
WorkingDirectory=/root
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
User=root
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Reference in New Issue
Block a user