From 8ad1e11f3851ed3529ca1eadfaa79d1465460955 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sat, 31 Aug 2024 03:08:38 +0200 Subject: [PATCH 1/2] [autopatch] Automatic patch attempt for helpers 2.1 --- manifest.toml | 3 +- scripts/_common.sh | 10 +--- scripts/backup | 23 +++------ scripts/change_url | 25 +++------- scripts/install | 48 ++++++++---------- scripts/remove | 26 ++++------ scripts/restore | 37 ++++++-------- scripts/upgrade | 78 ++++++++++++++---------------- sources/extra_files/app/.gitignore | 2 - sources/patches/.gitignore | 2 - 10 files changed, 96 insertions(+), 158 deletions(-) delete mode 100644 sources/extra_files/app/.gitignore delete mode 100644 sources/patches/.gitignore diff --git a/manifest.toml b/manifest.toml index ced1b1d..bca7a66 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,8 @@ admindoc = "https://github.com/UniversalMediaServer/UniversalMediaServer/wiki" code = "https://github.com/UniversalMediaServer/UniversalMediaServer" [integration] -yunohost = ">= 11.1.18" +yunohost = ">= 11.2.18" +helpers_version = "2.1" architectures = "all" multi_instance = false ldap = false diff --git a/scripts/_common.sh b/scripts/_common.sh index 69c72c9..b51b687 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,15 +1,7 @@ #!/bin/bash #================================================= -# COMMON VARIABLES -#================================================= - -#================================================= -# PERSONAL HELPERS -#================================================= - -#================================================= -# EXPERIMENTAL HELPERS +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= #================================================= diff --git a/scripts/backup b/scripts/backup index d4006e2..8ff9300 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,37 +1,28 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# 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 -#================================================= -# DECLARE DATA AND CONF FILES TO BACKUP -#================================================= -ynh_print_info --message="Declaring files to be backed up..." +ynh_print_info "Declaring files to be backed up..." #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$install_dir" +ynh_backup "$install_dir" #================================================= # BACKUP THE DATA DIR #================================================= -ynh_backup --src_path="$data_dir" --is_big +ynh_backup "$data_dir" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # SPECIFIC BACKUP @@ -39,16 +30,16 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # BACKUP LOGROTATE #================================================= -ynh_backup --src_path="/etc/logrotate.d/$app" +ynh_backup "/etc/logrotate.d/$app" #================================================= # BACKUP SYSTEMD #================================================= -ynh_backup --src_path="/etc/systemd/system/$app.service" +ynh_backup "/etc/systemd/system/$app.service" #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 55d1a1a..3f28214 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,42 +1,31 @@ #!/bin/bash - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD MODIFICATIONS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=2 +ynh_script_progression "Stopping $app's systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemctl --service=$app --action="stop" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 +ynh_script_progression "Updating NGINX web server configuration..." -ynh_change_url_nginx_config +ynh_config_change_url_nginx -#================================================= -# GENERIC FINALISATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=2 +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemctl --service=$app --action="start" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression "Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index d44bb6b..200ea0e 100755 --- a/scripts/install +++ b/scripts/install @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -18,7 +12,7 @@ upstream_version=$(ynh_app_upstream_version) #================================================= #SETTING MULTIMEDIA DIRECTORY #================================================= -ynh_script_progression --message="Setting up Multimedia directory..." --weight=9 +ynh_script_progression "Setting up Multimedia directory..." ynh_multimedia_build_main_dir ynh_multimedia_addaccess $app @@ -26,75 +20,73 @@ ynh_multimedia_addaccess $app #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=12 +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" +ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:$app "$install_dir" +#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 | chmod 750 "$install_dir" +#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 | chmod -R o-rwx "$install_dir" +#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:$app "$install_dir" chown $app:$app "$install_dir/UMS.sh" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=4 +ynh_script_progression "Configuring NGINX web server..." # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 +ynh_script_progression "Configuring $app's systemd service..." # Create a dedicated systemd config -ynh_add_systemd_config +ynh_config_add_systemd #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Setting up configuration file.." --weight=5 +ynh_script_progression "Setting up configuration file.." #UMS read config file from .config/UMS folder mkdir -p "/home/yunohost.app/$app/.config/UMS" -ynh_add_config --template="UMS.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/UMS.conf" -ynh_add_config --template="WEB.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/WEB.conf" -ynh_add_config --template="VirtualFolders.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/VirtualFolders.conf" +ynh_config_add --template="UMS.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/UMS.conf" +ynh_config_add --template="WEB.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/WEB.conf" +ynh_config_add --template="VirtualFolders.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/VirtualFolders.conf" chown -R $app:$app "/home/yunohost.app/$app/.config" chmod -R 700 "/home/yunohost.app/$app/.config" -#================================================= -# GENERIC FINALIZATION #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 +ynh_script_progression "Configuring log rotation..." #TO BE CHECKED : debug.log file in ~/.config/UMS/ # Use logrotate to manage application logfile(s) -ynh_use_logrotate +ynh_config_add_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 +ynh_script_progression "Integrating service in YunoHost..." yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log="/var/log/$app/$app.log" --needs_exposed_ports "$port_rend" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression "Starting $app's systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemctl --service=$app --action="start" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index d554d33..2d0c0c3 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -16,35 +10,35 @@ source /usr/share/yunohost/helpers #================================================= # 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 +if ynh_hide_warnings yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing $app service integration..." --weight=2 + ynh_script_progression "Removing $app service integration..." yunohost service remove $app fi #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=3 +ynh_script_progression "Stopping and removing the systemd service..." # Remove the dedicated systemd config -ynh_remove_systemd_config +ynh_config_remove_systemd #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +ynh_script_progression "Removing NGINX web server configuration..." # Remove the dedicated NGINX config -ynh_remove_nginx_config +ynh_config_remove_nginx #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 +ynh_script_progression "Removing logrotate configuration..." # Remove the app-specific logrotate config -ynh_remove_logrotate +ynh_config_remove_logrotate #================================================= # SPECIFIC REMOVE @@ -55,10 +49,10 @@ ynh_remove_logrotate # Remove the log files # remove the home folder -ynh_secure_remove --file="$data_dir" +ynh_safe_rm "$data_dir" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 7198e5a..92fa503 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# 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 @@ -13,16 +7,15 @@ source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=5 +ynh_script_progression "Restoring the app main directory..." -ynh_restore_file --origin_path="$install_dir" +ynh_restore "$install_dir" -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:$app "$install_dir" +#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 | chmod 750 "$install_dir" +#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 | chmod -R o-rwx "$install_dir" +#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:$app "$install_dir" chown $app:$app "$install_dir/UMS.sh" - #================================================= #SETTING MULTIMEDIA DIRECTORY #================================================= @@ -33,40 +26,38 @@ ynh_multimedia_addaccess $app #================================================= # RESTORE SYSTEMD #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +ynh_script_progression "Restoring $app's systemd service..." -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_restore_file --origin_path="/etc/systemd/system/$app.service" +ynh_restore "/etc/systemd/system/$app.service" systemctl enable $app.service --quiet yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_rend - mkdir -p /var/log/$app -ynh_restore_file --origin_path="/etc/logrotate.d/$app" +ynh_restore "/etc/logrotate.d/$app" #================================================= # RESTORE VARIOUS FILES #================================================= mkdir -p /var/log/$app -ynh_restore_file --origin_path="/home/yunohost.app/$app/" +ynh_restore "/home/yunohost.app/$app/" chown -R $app:$app "/home/yunohost.app/$app/.config" chmod -R 700 "/home/yunohost.app/$app/.config" - #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemctl --service=$app --action="start" -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemctl --service=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index 457e983..b77ba08 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -15,97 +9,95 @@ source /usr/share/yunohost/helpers upstream_version=$(ynh_app_upstream_version) -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +ynh_script_progression "Ensuring downward compatibility..." #move home folder from previous /home/app to /home/yunohost.app/$app #has to be after backup, otherwise backup will not find home folder and will fail if [ ! $(getent passwd $app | cut -d: -f6 | grep yunohost.app) ] then - ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" + ynh_systemctl --service=$app --action="stop" + usermod -m -d $install_dir $app fi -#10.17.0, 10.17.1 & 10.16.0 had a bug that overwrite the media path at startup of the service. +#10.17.0, 10.17.1 & 10.16.0 had a bug that overwrite the media path at startup of the service. + #https://github.com/UniversalMediaServer/UniversalMediaServer/issues/2864 #This will reinitialize it to /home/yunohost.multimedia/share current_version=$(ynh_app_upstream_version --manifest="/etc/yunohost/apps/$app/manifest.json") if [ $current_version == "10.17.0" ] || [ $current_version == "10.16.0" ] then - ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" - ynh_replace_string --match_string="folders =/opt/yunohost/$app,$install_dir" \ - --replace_string="folders=/home/yunohost.multimedia/share" \ - --target_file="/home/yunohost.app/$app/.config/UMS/UMS.conf" - ynh_replace_string --match_string="folders_monitored =/opt/yunohost/$app,$install_dir" \ - --replace_string="folders_monitored=/home/yunohost.multimedia/share" \ - --target_file="/home/yunohost.app/$app/.config/UMS/UMS.conf" + ynh_systemctl --service=$app --action="stop" + + ynh_replace --match="folders =/opt/yunohost/$app,$install_dir" \ + --replace="folders=/home/yunohost.multimedia/share" \ + --file="/home/yunohost.app/$app/.config/UMS/UMS.conf" + ynh_replace --match="folders_monitored =/opt/yunohost/$app,$install_dir" \ + --replace="folders_monitored=/home/yunohost.multimedia/share" \ + --file="/home/yunohost.app/$app/.config/UMS/UMS.conf" fi -#From packaging v1 to packaging v2 : "port_web" become "port". We need to handle this manually or +#From packaging v1 to packaging v2 : "port_web" become "port". We need to handle this manually or + #the core go for a new port. -if [ ! -z $(ynh_app_setting_get --app=$app --key=port_web) ]; then +if [ ! -z $(ynh_app_setting_get --key=port_web) ]; then port=$port_web - ynh_app_setting_delete --app=$app --key=port_web - ynh_app_setting_set --app=$app --key=port --value=$port + ynh_app_setting_delete --key=port_web + ynh_app_setting_set --key=port --value=$port fi -#================================================= -# STANDARD UPGRADE STEPS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=2 +ynh_script_progression "Stopping $app's systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemctl --service=$app --action="stop" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ] +# 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 --message="Upgrading source files..." --weight=5 - ynh_setup_source --dest_dir="$install_dir" + ynh_script_progression "Upgrading source files..." + ynh_setup_source --dest_dir="$install_dir" + fi -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:$app "$install_dir" +#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 | chmod 750 "$install_dir" +#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 | chmod -R o-rwx "$install_dir" +#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:$app "$install_dir" chown $app:$app "$install_dir/UMS.sh" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 +ynh_script_progression "Upgrading NGINX web server configuration..." # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx # Create a dedicated systemd config -ynh_add_systemd_config +ynh_config_add_systemd # Use logrotate to manage app-specific logfile(s) -ynh_use_logrotate --non-append +ynh_config_add_logrotate yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_rend #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=2 +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemctl --service=$app --action="start" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression "Upgrade of $app completed" diff --git a/sources/extra_files/app/.gitignore b/sources/extra_files/app/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/extra_files/app/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op] diff --git a/sources/patches/.gitignore b/sources/patches/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/patches/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op] From 20d91fde77af5a9f3f349bdbf602f659f464f8c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:00:43 +0200 Subject: [PATCH 2/2] cleaning --- manifest.toml | 2 +- scripts/backup | 11 ----------- scripts/install | 6 ------ scripts/remove | 26 -------------------------- scripts/restore | 4 +--- scripts/upgrade | 3 --- 6 files changed, 2 insertions(+), 50 deletions(-) diff --git a/manifest.toml b/manifest.toml index bca7a66..4ac1087 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,7 @@ admindoc = "https://github.com/UniversalMediaServer/UniversalMediaServer/wiki" code = "https://github.com/UniversalMediaServer/UniversalMediaServer" [integration] -yunohost = ">= 11.2.18" +yunohost = ">= 11.2.29" helpers_version = "2.1" architectures = "all" multi_instance = false diff --git a/scripts/backup b/scripts/backup index 8ff9300..96f73ba 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 @@ -24,18 +23,8 @@ ynh_backup "$data_dir" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= - ynh_backup "/etc/logrotate.d/$app" -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup "/etc/systemd/system/$app.service" #================================================= diff --git a/scripts/install b/scripts/install index 200ea0e..35e1c0b 100755 --- a/scripts/install +++ b/scripts/install @@ -22,12 +22,8 @@ ynh_multimedia_addaccess $app #================================================= 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" -#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 | chmod 750 "$install_dir" -#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 | chmod -R o-rwx "$install_dir" -#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:$app "$install_dir" chown $app:$app "$install_dir/UMS.sh" #================================================= @@ -35,7 +31,6 @@ chown $app:$app "$install_dir/UMS.sh" #================================================= ynh_script_progression "Configuring NGINX web server..." -# Create a dedicated NGINX config ynh_config_add_nginx #================================================= @@ -43,7 +38,6 @@ ynh_config_add_nginx #================================================= ynh_script_progression "Configuring $app's systemd service..." -# Create a dedicated systemd config ynh_config_add_systemd #================================================= diff --git a/scripts/remove b/scripts/remove index 2d0c0c3..376e9d8 100755 --- a/scripts/remove +++ b/scripts/remove @@ -16,41 +16,15 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression "Stopping and removing the systemd service..." - # Remove the dedicated systemd config ynh_config_remove_systemd -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression "Removing NGINX web server configuration..." - # Remove the dedicated NGINX config ynh_config_remove_nginx -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression "Removing logrotate configuration..." - # Remove the app-specific logrotate config ynh_config_remove_logrotate -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= - -# Remove the log files - -# remove the home folder -ynh_safe_rm "$data_dir" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 92fa503..fa178e0 100755 --- a/scripts/restore +++ b/scripts/restore @@ -11,9 +11,6 @@ ynh_script_progression "Restoring the app main directory..." ynh_restore "$install_dir" -#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 | chmod 750 "$install_dir" -#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 | chmod -R o-rwx "$install_dir" -#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:$app "$install_dir" chown $app:$app "$install_dir/UMS.sh" #================================================= @@ -42,6 +39,7 @@ ynh_restore "/etc/logrotate.d/$app" #================================================= # RESTORE VARIOUS FILES #================================================= + mkdir -p /var/log/$app ynh_restore "/home/yunohost.app/$app/" chown -R $app:$app "/home/yunohost.app/$app/.config" diff --git a/scripts/upgrade b/scripts/upgrade index b77ba08..3c73855 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -68,9 +68,6 @@ then 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 | chmod 750 "$install_dir" -#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 | chmod -R o-rwx "$install_dir" -#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:$app "$install_dir" chown $app:$app "$install_dir/UMS.sh" #=================================================