1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/airsonic_ynh.git synced 2024-09-03 18:06:14 +02:00

Change path for media

This commit is contained in:
ericgaspar 2021-04-17 18:12:04 +02:00
parent e382076815
commit c6905da9b9
No known key found for this signature in database
GPG key ID: 574F281483054D44
7 changed files with 18 additions and 58 deletions

View file

@ -43,8 +43,8 @@ How to configure this app: by an admin panel.
## Supported architectures ## 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/) * 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%20%28Apps%29.svg)](https://ci-apps-arm.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 ## Links

View file

@ -28,7 +28,6 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain) 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 # DECLARE DATA AND CONF FILES TO BACKUP
@ -66,7 +65,7 @@ ynh_backup --src_path="/etc/default/$app"
# BACKUP DATA # BACKUP DATA
#================================================= #=================================================
ynh_backup --src_path="/home/yunohost.$app" --is_big ynh_backup --src_path="/home/yunohost.app/$app" --is_big
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -112,15 +112,6 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=3
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_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" ynh_add_config --template="../conf/systemd-sysconfig" --destination="/etc/default/$app"
#================================================= #=================================================

View file

@ -99,14 +99,14 @@ ynh_system_user_create --username=$app
# CREATE DIRECTORIES # CREATE DIRECTORIES
#================================================= #=================================================
mkdir -p /home/yunohost.$app/{Podcasts,Playlists} mkdir -p /home/yunohost.app/$app/{Podcasts,Playlists}
#================================================= #=================================================
# SECURING FILES AND DIRECTORIES # 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 chmod -R 764 /home/yunohost.app
#================================================= #=================================================
# YUNOHOST MULTIMEDIA INTEGRATION # YUNOHOST MULTIMEDIA INTEGRATION
@ -114,8 +114,8 @@ chmod -R 764 /home/yunohost.$app
ynh_script_progression --message="Adding multimedia directories..." --weight=3 ynh_script_progression --message="Adding multimedia directories..." --weight=3
ynh_multimedia_build_main_dir 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/$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/Playlists" --dest_dir="share/Playlists"
# Allow airsonic to write into these directories # Allow airsonic to write into these directories
ynh_multimedia_addaccess $app ynh_multimedia_addaccess $app
@ -154,18 +154,6 @@ ynh_add_systemd_config
# MODIFY CONFIG FILES # 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" ynh_add_config --template="../conf/systemd-sysconfig" --destination="/etc/default/$app"
# Copy configuration file of airsonic # Copy configuration file of airsonic

View file

@ -19,7 +19,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#service_config=$(ynh_app_setting_get --app=$app --key=service_config)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE

View file

@ -30,7 +30,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_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 # 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. # 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 # RESTORE USER RIGHTS
#================================================= #=================================================
mkdir -p /home/yunohost.$app/{Podcasts,Playlists} mkdir -p /home/yunohost.app/$app/{Podcasts,Playlists}
chown -R $app:www-data /home/yunohost.$app/ chown -R $app:www-data /home/yunohost.app/$app
chmod -R 764 /home/yunohost.$app chmod -R 764 /home/yunohost.app/$app
#================================================= #=================================================
# YUNOHOST MULTIMEDIA INTEGRATION # YUNOHOST MULTIMEDIA INTEGRATION
@ -151,8 +150,8 @@ chmod -R 764 /home/yunohost.$app
ynh_script_progression --message="Adding multimedia directories..." --weight=3 ynh_script_progression --message="Adding multimedia directories..." --weight=3
ynh_multimedia_build_main_dir 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/$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/Playlists" --dest_dir="share/Playlists"
# Allow airsonic to write into these directories # Allow airsonic to write into these directories
ynh_multimedia_addaccess $app ynh_multimedia_addaccess $app

View file

@ -21,7 +21,6 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get --app=$app --key=admin) admin=$(ynh_app_setting_get --app=$app --key=admin)
is_public=$(ynh_app_setting_get --app=$app --key=is_public) is_public=$(ynh_app_setting_get --app=$app --key=is_public)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
#service_config=$(ynh_app_setting_get --app=$app --key=service_config)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -40,12 +39,6 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi 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 # Cleaning legacy permissions
if ynh_legacy_permissions_exists; then if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all ynh_legacy_permissions_delete_all
@ -119,13 +112,13 @@ ynh_system_user_create --username=$app
# CREATE DIRECTORIES # CREATE DIRECTORIES
#================================================= #=================================================
mkdir -p /home/yunohost.$app/{Podcasts,Playlists} mkdir -p /home/yunohost.app/$app/{Podcasts,Playlists}
#================================================= #=================================================
# SECURING FILES AND DIRECTORIES # 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 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_script_progression --message="Adding multimedia directories..." --weight=3
ynh_multimedia_build_main_dir 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/$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/Playlists" --dest_dir="share/Playlists"
# Allow airsonic to write into these directories # Allow airsonic to write into these directories
ynh_multimedia_addaccess $app ynh_multimedia_addaccess $app
@ -197,15 +190,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_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" ynh_add_config --template="../conf/systemd-sysconfig" --destination="/etc/default/$app"
#================================================= #=================================================