Skip to content

Commit fb1a558

Browse files
authored
Refactor (#8874)
1 parent b2ee06d commit fb1a558

File tree

3 files changed

+23
-63
lines changed

3 files changed

+23
-63
lines changed

ct/openwebui.sh

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
33
# Copyright (c) 2021-2025 tteck
4-
# Author: havardthom
4+
# Author: tteck | Co-Author: havardthom | Co-Author: Slaviša Arežina (tremor021)
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66
# Source: https://openwebui.com/
77

@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-4}"
1111
var_ram="${var_ram:-8192}"
1212
var_disk="${var_disk:-25}"
1313
var_os="${var_os:-debian}"
14-
var_version="${var_version:-12}"
14+
var_version="${var_version:-13}"
1515
var_unprivileged="${var_unprivileged:-1}"
1616

1717
header_info "$APP"
@@ -23,7 +23,7 @@ function update_script() {
2323
header_info
2424
check_container_storage
2525
check_container_resources
26-
if [[ ! -d /opt/open-webui ]]; then
26+
if [[ ! -d /root/.open-webui ]]; then
2727
msg_error "No ${APP} Installation Found!"
2828
exit
2929
fi
@@ -50,29 +50,8 @@ function update_script() {
5050
fi
5151
fi
5252

53-
msg_info "Updating ${APP} (Patience)"
54-
cd /opt/open-webui
55-
mkdir -p /opt/open-webui-backup
56-
cp -rf /opt/open-webui/backend/data /opt/open-webui-backup
57-
git add -A
58-
$STD git stash
59-
$STD git reset --hard
60-
output=$(git pull --no-rebase)
61-
if echo "$output" | grep -q "Already up to date."; then
62-
msg_ok "$APP is already up to date."
63-
exit
64-
fi
65-
systemctl stop open-webui.service
66-
$STD npm install --force
67-
export NODE_OPTIONS="--max-old-space-size=6000"
68-
$STD npm run build
69-
cd ./backend
70-
$STD pip install -r requirements.txt -U
71-
cp -rf /opt/open-webui-backup/* /opt/open-webui/backend
72-
if git stash list | grep -q 'stash@{'; then
73-
$STD git stash pop
74-
fi
75-
systemctl start open-webui.service
53+
msg_info "Restarting Open WebUI to initiate update"
54+
systemctl restart open-webui
7655
msg_ok "Updated successfully!"
7756
exit
7857
}

frontend/public/json/openwebui.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"documentation": "https://docs.openwebui.com/",
1313
"website": "https://openwebui.com/",
1414
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/open-webui.webp",
15-
"config_path": "/opt/open-webui/.env",
15+
"config_path": "/root/.env",
1616
"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",
1717
"install_methods": [
1818
{
@@ -23,7 +23,7 @@
2323
"ram": 8192,
2424
"hdd": 25,
2525
"os": "debian",
26-
"version": "12"
26+
"version": "13"
2727
}
2828
}
2929
],
@@ -35,6 +35,10 @@
3535
{
3636
"text": "Script contains optional installation of Ollama.",
3737
"type": "info"
38+
},
39+
{
40+
"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!",
41+
"type": "warning"
3842
}
3943
]
4044
}

install/openwebui-install.sh

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Copyright (c) 2021-2025 tteck
4-
# Author: tteck
5-
# Co-Author: havardthom
4+
# Author: tteck | Co-Author: havardthom | Co-Author: Slaviša Arežina (tremor021)
65
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
76
# Source: https://openwebui.com/
87

@@ -15,36 +14,10 @@ network_check
1514
update_os
1615

1716
msg_info "Installing Dependencies"
18-
$STD apt install -y \
19-
git \
20-
ffmpeg \
21-
libpq-dev
17+
$STD apt install -y ffmpeg
2218
msg_ok "Installed Dependencies"
2319

24-
msg_info "Setup Python3"
25-
$STD apt install -y --no-install-recommends \
26-
python3 \
27-
python3-pip
28-
msg_ok "Setup Python3"
29-
30-
NODE_VERSION="22" setup_nodejs
31-
32-
msg_info "Installing Open WebUI (Patience)"
33-
$STD git clone https://github.com/open-webui/open-webui.git /opt/open-webui
34-
cd /opt/open-webui/backend
35-
$STD pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
36-
$STD pip3 install -r requirements.txt -U
37-
cd /opt/open-webui
38-
cp .env.example .env
39-
cat <<EOF >/opt/open-webui/.env
40-
ENV=prod
41-
ENABLE_OLLAMA_API=false
42-
OLLAMA_BASE_URL=http://0.0.0.0:11434
43-
EOF
44-
$STD npm install --force
45-
export NODE_OPTIONS="--max-old-space-size=6000"
46-
$STD npm run build
47-
msg_ok "Installed Open WebUI"
20+
USE_UVX="YES" PYTHON_VERSION="3.12" setup_uv
4821

4922
read -r -p "${TAB3}Would you like to add Ollama? <y/N> " prompt
5023
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
@@ -69,7 +42,7 @@ RestartSec=3
6942
WantedBy=multi-user.target
7043
EOF
7144
systemctl enable -q --now ollama
72-
sed -i 's/ENABLE_OLLAMA_API=false/ENABLE_OLLAMA_API=true/g' /opt/open-webui/.env
45+
echo "ENABLE_OLLAMA_API=true" >/root/.env
7346
msg_ok "Installed Ollama"
7447
fi
7548

@@ -80,10 +53,14 @@ Description=Open WebUI Service
8053
After=network.target
8154
8255
[Service]
83-
Type=exec
84-
WorkingDirectory=/opt/open-webui
85-
EnvironmentFile=/opt/open-webui/.env
86-
ExecStart=/opt/open-webui/backend/start.sh
56+
Type=simple
57+
EnvironmentFile=-/root/.env
58+
Environment=DATA_DIR=/root/.open-webui
59+
ExecStart=/usr/local/bin/uvx --python 3.12 open-webui@latest serve
60+
WorkingDirectory=/root
61+
Restart=on-failure
62+
RestartSec=5
63+
User=root
8764
8865
[Install]
8966
WantedBy=multi-user.target

0 commit comments

Comments
 (0)