diff --git a/conf/systemd.service b/conf/systemd.service index 44a7ba4..9dcb03e 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=autobrr +Description=Autobrr: automation for torrents After=syslog.target network-online.target [Service] diff --git a/manifest.toml b/manifest.toml index e9c4416..6608457 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,7 +15,7 @@ website = "https://autobrr.com/" code = "https://github.com/autobrr/autobrr" [integration] -yunohost = ">= 11.2.18" +yunohost = ">= 11.2.29" helpers_version = "2.1" architectures = "all" multi_instance = true diff --git a/scripts/backup b/scripts/backup index 0e7053b..7492774 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,6 +1,5 @@ #!/bin/bash -# 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 @@ -16,7 +15,6 @@ ynh_backup "$install_dir" # BACKUP THE DATA DIR #================================================= -# Only relevant if there is a "data_dir" resource for this app ynh_backup "$data_dir" #================================================= @@ -25,10 +23,6 @@ ynh_backup "$data_dir" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup "/etc/systemd/system/$app.service" #================================================= diff --git a/scripts/install b/scripts/install index 8cebe02..2a9ac2b 100755 --- a/scripts/install +++ b/scripts/install @@ -3,18 +3,14 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression "Setting up source files..." -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" mkdir -p $data_dir/.config/autobrr -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" chmod +x "$install_dir/autobrr" #================================================= @@ -22,10 +18,8 @@ chmod +x "$install_dir/autobrr" #================================================= ynh_script_progression "Adding system configurations related to $app..." -# Create a dedicated NGINX config using the conf/nginx.conf template ynh_config_add_nginx -# Create a dedicated systemd config ynh_config_add_systemd yunohost service add $app --description="Automation for torrents and usenet" --log="/var/log/$app/$app.log" @@ -40,15 +34,11 @@ ynh_script_progression "Adding $app's configuration..." key=$(ynh_string_random) ynh_config_add --template="config.toml" --destination="$data_dir/.config/autobrr/config.toml" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$data_dir/.config/autobrr/config.toml" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$data_dir/.config/autobrr/config.toml" - #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression "Starting $app's systemd service..." -# Start a systemd service ynh_systemctl --service=$app --action="start" #================================================= diff --git a/scripts/remove b/scripts/remove index 01a20d9..98764ca 100755 --- a/scripts/remove +++ b/scripts/remove @@ -5,13 +5,9 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE SYSTEM CONFIGURATIONS -#================================================= -# REMOVE SYSTEMD SERVICE - #================================================= ynh_script_progression "Removing system configurations related to $app..." -# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_hide_warnings yunohost service status $app >/dev/null then ynh_script_progression "Removing $app service integration..." diff --git a/scripts/restore b/scripts/restore index 6d6fd48..847cdfb 100755 --- a/scripts/restore +++ b/scripts/restore @@ -27,7 +27,7 @@ chown -R $app:www-data "$data_dir" #================================================= ynh_script_progression "Restoring the PostgreSQL database..." -ynh_psql_db_shell < "./db.sql"" +ynh_psql_db_shell < "./db.sql" #================================================= # RESTORE SYSTEM CONFIGURATIONS diff --git a/scripts/upgrade b/scripts/upgrade index 04db47b..fb439cf 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -10,22 +10,13 @@ ynh_script_progression "Stopping $app's systemd service..." ynh_systemctl --service=$app --action="stop" -#================================================= -# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression "Upgrading source files..." -# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed -if ynh_app_upstream_version_changed -then - ynh_script_progression "Upgrading source files..." +ynh_setup_source --dest_dir="$install_dir" --full_replace - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --full_replace -fi - -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" chmod +x "$install_dir/autobrr" #=================================================