#!/bin/bash #================================================= # IMPORT GENERIC HELPERS #================================================= source _common.sh source /usr/share/yunohost/helpers #================================================= # STOP SYSTEMD SERVICE #================================================= ynh_script_progression "Stopping $app's systemd service..." ynh_systemctl --service="$app" --action="stop" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= pushd $install_dir source "$install_dir/venv/bin/activate" pip install -U open-webui deactivate popd chown -R "$app:www-data" "$install_dir" #================================================= # REAPPLY SYSTEM CONFIGURATION #================================================= ynh_script_progression "Upgrading system configurations related to $app..." ynh_config_add_nginx ynh_config_add_systemd yunohost service add "$app" --description="User-friendly AI Interface (Supports Ollama, OpenAI API, ...)" --log="/var/log/$app/$app.log" ynh_config_add_logrotate #ynh_config_add_fail2ban --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression "Starting $app's systemd service..." ynh_systemctl --service="$app" --action="start" --wait_until="No requirements found in frontmatter" --timeout=600 #================================================= # END OF SCRIPT #================================================= ynh_script_progression "Upgrade of $app completed"