| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #!/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
- ynh_exec_as_app $install_dir/pip install -U open-webui
- 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"
|