diff --git a/scripts/backup b/scripts/backup index 9ba4b32..d8e379f 100755 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers diff --git a/scripts/install b/scripts/install index 79c7626..e670dfd 100755 --- a/scripts/install +++ b/scripts/install @@ -30,7 +30,6 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -# Download, check integrity, uncompress and patch the source from manifest.toml ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" @@ -41,18 +40,14 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 -# Create a dedicated NGINX config using the conf/nginx.conf template ynh_add_nginx_config -# Create a dedicated systemd config ynh_add_systemd_config yunohost service add $app --description="Realtime kanban board for workgroups" --log="/var/log/$app/$app.log" -# Use logrotate to manage application logfile(s) ynh_use_logrotate -# Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^(.*) Invalid (email or username:|password!) (\"(.*)\"!)? ?\(IP: \)$" #================================================= diff --git a/scripts/remove b/scripts/remove index fb0a78d..d51ce1c 100755 --- a/scripts/remove +++ b/scripts/remove @@ -16,9 +16,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 -# This should be a symetric version of what happens in the install script - -# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then ynh_script_progression --message="Removing $app service integration..." --weight=1 diff --git a/scripts/restore b/scripts/restore index f159c04..a031d7a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -25,7 +25,6 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Reinstalling dependencies..." --weight=6 -# Install Nodejs ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= @@ -62,7 +61,6 @@ ynh_systemd_action --action=restart --service_name=fail2ban #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -# Typically you only have either $app or php-fpm but not both at the same time... ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 1b1d924..28df495 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,6 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers +secret=$(ynh_string_random --length=50) +email=$(ynh_user_get_info --username=$admin --key=mail) +timezone="$(cat /etc/timezone)" +firstname=$(yunohost user list --fields firstname --output-as json | jq -r .users.$admin.firstname) +lastname=$(yunohost user list --fields lastname --output-as json | jq -r .users.$admin.lastname) + upgrade_type=$(ynh_check_app_version_changed) #================================================= @@ -28,7 +34,6 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 - # Download, check integrity, uncompress and patch the source from manifest.toml ynh_setup_source --dest_dir="$install_dir" --keep=".env" fi @@ -48,10 +53,8 @@ ynh_add_systemd_config yunohost service add $app --description="Realtime kanban board for workgroups" --log="/var/log/$app/$app.log" -# Use logrotate to manage application logfile(s) ynh_use_logrotate --non-append -# Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^(.*) Invalid (email or username:|password!) (\"(.*)\"!)? ?\(IP: \)$" #=================================================