Compare commits

...

4 Commits

Author SHA1 Message Date
Håvard Gjøby Thom 28896707bc Add max-old-space-size in openwebui.sh (#3993) 2024-10-27 18:36:01 -04:00
Håvard Gjøby Thom 0340aec142 Adjust max-old-space-size in openwebui-install.sh (#3992) 2024-10-27 18:24:22 -04:00
Håvard Gjøby Thom 8a21f6e7f0 Add option to install Ollama in Open WebUI LXC (#3991) 2024-10-27 18:14:57 -04:00
Håvard Gjøby Thom 77b06ee3f9 Add update path to Gotify LXC (#3989) 2024-10-27 13:29:28 -04:00
4 changed files with 57 additions and 3 deletions
+23 -1
View File
@@ -55,7 +55,29 @@ function default_settings() {
function update_script() { function update_script() {
header_info header_info
if [[ ! -d /opt/gotify ]]; then msg_error "No ${APP} Installation Found!"; exit; fi if [[ ! -d /opt/gotify ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
msg_error "There is currently no update path available."
RELEASE=$(curl -s https://api.github.com/repos/gotify/server/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping ${APP}"
systemctl stop gotify
msg_ok "Stopped ${APP}"
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt/gotify
wget -q https://github.com/gotify/server/releases/download/v${RELEASE}/gotify-linux-amd64.zip
unzip -oq gotify-linux-amd64.zip
rm -rf gotify-linux-amd64.zip
chmod +x gotify-linux-amd64
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to ${RELEASE}"
msg_info "Starting ${APP}"
systemctl start gotify
msg_ok "Started ${APP}"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit exit
} }
+1
View File
@@ -67,6 +67,7 @@ then
fi fi
systemctl stop open-webui.service systemctl stop open-webui.service
npm install &>/dev/null npm install &>/dev/null
export NODE_OPTIONS="--max-old-space-size=3584"
npm run build &>/dev/null npm run build &>/dev/null
cd ./backend cd ./backend
pip install -r requirements.txt -U &>/dev/null pip install -r requirements.txt -U &>/dev/null
+4 -1
View File
@@ -27,7 +27,10 @@ wget -q https://github.com/gotify/server/releases/download/v${RELEASE}/gotify-li
$STD unzip gotify-linux-amd64.zip $STD unzip gotify-linux-amd64.zip
rm -rf gotify-linux-amd64.zip rm -rf gotify-linux-amd64.zip
chmod +x gotify-linux-amd64 chmod +x gotify-linux-amd64
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed Gotify"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/gotify.service cat <<EOF >/etc/systemd/system/gotify.service
[Unit] [Unit]
Description=Gotify Description=Gotify
@@ -46,7 +49,7 @@ RestartSec=3
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
systemctl enable -q --now gotify systemctl enable -q --now gotify
msg_ok "Installed Gotify" msg_ok "Created Service"
motd_ssh motd_ssh
customize customize
+29 -1
View File
@@ -49,12 +49,40 @@ cp .env.example .env
cat <<EOF >/opt/open-webui/.env cat <<EOF >/opt/open-webui/.env
ENV=prod ENV=prod
ENABLE_OLLAMA_API=false ENABLE_OLLAMA_API=false
OLLAMA_BASE_URL=http://0.0.0.0:11434
EOF EOF
$STD npm install $STD npm install
export NODE_OPTIONS="--max-old-space-size=4096" export NODE_OPTIONS="--max-old-space-size=3584"
$STD npm run build $STD npm run build
msg_ok "Installed Open WebUI" msg_ok "Installed Open WebUI"
read -r -p "Would you like to add Ollama? <y/N> " prompt
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
msg_info "Installing Ollama"
curl -fsSLO https://ollama.com/download/ollama-linux-amd64.tgz
tar -C /usr -xzf ollama-linux-amd64.tgz
rm -rf ollama-linux-amd64.tgz
cat <<EOF >/etc/systemd/system/ollama.service
[Unit]
Description=Ollama Service
After=network-online.target
[Service]
Type=exec
ExecStart=/usr/bin/ollama serve
Environment=HOME=$HOME
Environment=OLLAMA_HOST=0.0.0.0
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now ollama.service
sed -i 's/ENABLE_OLLAMA_API=false/ENABLE_OLLAMA_API=true/g' /opt/open-webui/.env
msg_ok "Installed Ollama"
fi
msg_info "Creating Service" msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/open-webui.service cat <<EOF >/etc/systemd/system/open-webui.service
[Unit] [Unit]