From c6905da9b99a05fa4ac0cb3a88030052239e187a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 17 Apr 2021 18:12:04 +0200 Subject: [PATCH] Change path for media --- README.md | 4 ++-- scripts/backup | 3 +-- scripts/change_url | 9 --------- scripts/install | 22 +++++----------------- scripts/remove | 1 - scripts/restore | 13 ++++++------- scripts/upgrade | 24 ++++-------------------- 7 files changed, 18 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 4321a4e..b23e7ee 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,8 @@ How to configure this app: by an admin panel. ## Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/airsonic%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/airsonic/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/airsonic%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/airsonic/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/airsonic.svg)](https://ci-apps.yunohost.org/ci/apps/airsonic/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/airsonic.svg)](https://ci-apps-arm.yunohost.org/ci/apps/airsonic/) ## Links diff --git a/scripts/backup b/scripts/backup index b985e2c..a27e558 100644 --- a/scripts/backup +++ b/scripts/backup @@ -28,7 +28,6 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) -#service_config=$(ynh_app_setting_get --app=$app --key=service_config) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -66,7 +65,7 @@ ynh_backup --src_path="/etc/default/$app" # BACKUP DATA #================================================= -ynh_backup --src_path="/home/yunohost.$app" --is_big +ynh_backup --src_path="/home/yunohost.app/$app" --is_big #================================================= # END OF SCRIPT diff --git a/scripts/change_url b/scripts/change_url index 087e3d4..7dae22d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -112,15 +112,6 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=3 # Create a dedicated systemd config ynh_add_systemd_config -# ynh_backup_if_checksum_is_different --file="$service_config" - -# Copy config. template to right location -# cp ../conf/systemd-sysconfig $service_config - -# ynh_replace_string --match_string="__FINALPATH__" --replace_string=$final_path --target_file="$service_config" -# ynh_replace_string --match_string="__PORT__" --replace_string=$port --target_file="$service_config" -# ynh_replace_string --match_string="__PATH__" --replace_string=$path_url --target_file="$service_config" - ynh_add_config --template="../conf/systemd-sysconfig" --destination="/etc/default/$app" #================================================= diff --git a/scripts/install b/scripts/install index b2ce83b..89ba931 100644 --- a/scripts/install +++ b/scripts/install @@ -99,14 +99,14 @@ ynh_system_user_create --username=$app # CREATE DIRECTORIES #================================================= -mkdir -p /home/yunohost.$app/{Podcasts,Playlists} +mkdir -p /home/yunohost.app/$app/{Podcasts,Playlists} #================================================= # SECURING FILES AND DIRECTORIES #================================================= -chown -R $app:www-data /home/yunohost.$app/ -chmod -R 764 /home/yunohost.$app +chown -R $app:www-data /home/yunohost.app/$app +chmod -R 764 /home/yunohost.app #================================================= # YUNOHOST MULTIMEDIA INTEGRATION @@ -114,8 +114,8 @@ chmod -R 764 /home/yunohost.$app ynh_script_progression --message="Adding multimedia directories..." --weight=3 ynh_multimedia_build_main_dir -ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Podcasts" --dest_dir="share/Podcasts" -ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Playlists" --dest_dir="share/Playlists" +ynh_multimedia_addfolder --source_dir="/home/yunohost.app/$app/Podcasts" --dest_dir="share/Podcasts" +ynh_multimedia_addfolder --source_dir="/home/yunohost.app/$app/Playlists" --dest_dir="share/Playlists" # Allow airsonic to write into these directories ynh_multimedia_addaccess $app @@ -154,18 +154,6 @@ ynh_add_systemd_config # MODIFY CONFIG FILES #================================================= -# Path of the systemd service configuration -# service_config="/etc/default/$app" - -# ynh_app_setting_set --app=$app --key=service_config --value=$service_config - -# Copy config. template to right location -# cp ../conf/systemd-sysconfig $service_config - -# ynh_replace_string --match_string="__FINALPATH__" --replace_string=$final_path --target_file="$service_config" -# ynh_replace_string --match_string="__PORT__" --replace_string=$port --target_file="$service_config" -# ynh_replace_string --match_string="__PATH__" --replace_string=$path_url --target_file="$service_config" - ynh_add_config --template="../conf/systemd-sysconfig" --destination="/etc/default/$app" # Copy configuration file of airsonic diff --git a/scripts/remove b/scripts/remove index e09307a..af2403c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -19,7 +19,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -#service_config=$(ynh_app_setting_get --app=$app --key=service_config) #================================================= # STANDARD REMOVE diff --git a/scripts/restore b/scripts/restore index 87b37ae..46f09eb 100644 --- a/scripts/restore +++ b/scripts/restore @@ -30,7 +30,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -#service_config=$(ynh_app_setting_get --app=$app --key=service_config) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -135,15 +134,15 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup. -ynh_restore_file --origin_path="/home/yunohost.$app" --not_mandatory +ynh_restore_file --origin_path="/home/yunohost.app/$app" --not_mandatory #================================================= # RESTORE USER RIGHTS #================================================= -mkdir -p /home/yunohost.$app/{Podcasts,Playlists} -chown -R $app:www-data /home/yunohost.$app/ -chmod -R 764 /home/yunohost.$app +mkdir -p /home/yunohost.app/$app/{Podcasts,Playlists} +chown -R $app:www-data /home/yunohost.app/$app +chmod -R 764 /home/yunohost.app/$app #================================================= # YUNOHOST MULTIMEDIA INTEGRATION @@ -151,8 +150,8 @@ chmod -R 764 /home/yunohost.$app ynh_script_progression --message="Adding multimedia directories..." --weight=3 ynh_multimedia_build_main_dir -ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Podcasts" --dest_dir="share/Podcasts" -ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Playlists" --dest_dir="share/Playlists" +ynh_multimedia_addfolder --source_dir="/home/yunohost.app/$app/Podcasts" --dest_dir="share/Podcasts" +ynh_multimedia_addfolder --source_dir="/home/yunohost.app/$app/Playlists" --dest_dir="share/Playlists" # Allow airsonic to write into these directories ynh_multimedia_addaccess $app diff --git a/scripts/upgrade b/scripts/upgrade index bd9a225..56794e1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,7 +21,6 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) admin=$(ynh_app_setting_get --app=$app --key=admin) is_public=$(ynh_app_setting_get --app=$app --key=is_public) port=$(ynh_app_setting_get --app=$app --key=port) -#service_config=$(ynh_app_setting_get --app=$app --key=service_config) #================================================= # CHECK VERSION @@ -40,12 +39,6 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi -# # If service_config doesn't exist, create it -# if [ -z "$service_config" ]; then -# service_config="/etc/default/$app" -# ynh_app_setting_set --app=$app --key=service_config --value=$service_config -# fi - # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all @@ -119,13 +112,13 @@ ynh_system_user_create --username=$app # CREATE DIRECTORIES #================================================= -mkdir -p /home/yunohost.$app/{Podcasts,Playlists} +mkdir -p /home/yunohost.app/$app/{Podcasts,Playlists} #================================================= # SECURING FILES AND DIRECTORIES #================================================= -chown -R $app:www-data /home/yunohost.$app/ +chown -R $app:www-data /home/yunohost.app/$app chmod -R 764 /home/yunohost.$app #================================================= @@ -134,8 +127,8 @@ chmod -R 764 /home/yunohost.$app ynh_script_progression --message="Adding multimedia directories..." --weight=3 ynh_multimedia_build_main_dir -ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Podcasts" --dest_dir="share/Podcasts" -ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Playlists" --dest_dir="share/Playlists" +ynh_multimedia_addfolder --source_dir="/home/yunohost.app/$app/Podcasts" --dest_dir="share/Podcasts" +ynh_multimedia_addfolder --source_dir="/home/yunohost.app/$app/Playlists" --dest_dir="share/Playlists" # Allow airsonic to write into these directories ynh_multimedia_addaccess $app @@ -197,15 +190,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config -# ynh_backup_if_checksum_is_different --file="$service_config" - -# # Copy config. template to right location -# cp ../conf/systemd-sysconfig $service_config - -# ynh_replace_string --match_string="__FINALPATH__" --replace_string=$final_path --target_file="$service_config" -# ynh_replace_string --match_string="__PORT__" --replace_string=$port --target_file="$service_config" -# ynh_replace_string --match_string="__PATH__" --replace_string=$path_url --target_file="$service_config" - ynh_add_config --template="../conf/systemd-sysconfig" --destination="/etc/default/$app" #=================================================