diff --git a/conf/amd64.src b/conf/amd64.src deleted file mode 100644 index 6489df8..0000000 --- a/conf/amd64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/boypt/simple-torrent/releases/download/1.3.9/cloud-torrent_linux_amd64_static.gz -SOURCE_SUM=d2f535e4cd0449b357a563cfce79c1f6afcac9b7b3af94e758defc44faa52ebf -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=gz -SOURCE_IN_SUBDIR=false -SOURCE_EXTRACT=false diff --git a/conf/arm64.src b/conf/arm64.src deleted file mode 100644 index 6c4b48d..0000000 --- a/conf/arm64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/boypt/simple-torrent/releases/download/1.3.9/cloud-torrent_linux_arm64_static.gz -SOURCE_SUM=6f48f8b59bc8d834c6ede1d27ecc1a598b8a0be1dab00622caa6fd047e51eed6 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=gz -SOURCE_IN_SUBDIR=false -SOURCE_EXTRACT=false diff --git a/conf/i386.src b/conf/i386.src deleted file mode 100644 index dd17e3a..0000000 --- a/conf/i386.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/boypt/simple-torrent/releases/download/1.3.9/cloud-torrent_linux_386_static.gz -SOURCE_SUM=583898eb907c21dbbcb6f33934eae3dc1d6ec2620fdc7689c70a3479049af52b -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=gz -SOURCE_IN_SUBDIR=false -SOURCE_EXTRACT=false diff --git a/scripts/change_url b/scripts/change_url index 6477fa0..76d5031 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,49 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH - -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH - -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up $app before changing its URL (may take a while)..." --weight=1 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. - ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - - # restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -change_domain=0 -if [ "$old_domain" != "$new_domain" ] -then - change_domain=1 -fi - -change_path=0 -if [ "$old_path" != "$new_path" ] -then - change_path=1 -fi - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -66,29 +23,7 @@ ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$ #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" - # Create a dedicated NGINX config - ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi +ynh_change_url_nginx_config #================================================= # GENERIC FINALISATION @@ -100,13 +35,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action=start --log_path=systemd -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index 1a1a84f..b83738d 100644 --- a/scripts/install +++ b/scripts/install @@ -15,14 +15,13 @@ source /usr/share/yunohost/helpers ynh_script_progression --message="Setting up source files..." --weight=4 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir=$install_dir --source_id=$YNH_ARCH +ynh_setup_source --dest_dir=$install_dir pushd "$install_dir" gzip --decompress $YNH_ARCH.gz mv $YNH_ARCH $app popd -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x $install_dir/$app diff --git a/scripts/upgrade b/scripts/upgrade index 4625c46..1ae66b0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,7 +33,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir=$install_dir --source_id=$YNH_ARCH --keep="config.yml" + ynh_setup_source --dest_dir=$install_dir --keep="config.yml" pushd "$install_dir" gzip --decompress $YNH_ARCH.gz @@ -41,7 +41,6 @@ then popd fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x $install_dir/$app