diff --git a/manifest.toml b/manifest.toml index 4b3763a..0f652cb 100644 --- a/manifest.toml +++ b/manifest.toml @@ -74,7 +74,6 @@ ram.runtime = "50M" [resources.install_dir] [resources.data_dir] - subdirs = ["upload"] owner = "__APP__:rwx" group = "www-data:rwx" diff --git a/scripts/install b/scripts/install index 9432add..1e96e67 100755 --- a/scripts/install +++ b/scripts/install @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers # Database prefix prefix=lime_ -ynh_app_setting_set --app=$app --key=prefix --value=$prefix +ynh_app_setting_set --app="$app" --key=prefix --value="$prefix" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -25,6 +25,8 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" +# Move upload directory to data_dir, with a symlink +mv "$install_dir/upload" "$data_dir" ln -s "$data_dir/upload" "$install_dir/upload" chmod 750 "$install_dir" diff --git a/scripts/restore b/scripts/restore index a6d262e..45343fe 100644 --- a/scripts/restore +++ b/scripts/restore @@ -17,11 +17,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -# Update the symlink just in case -ynh_exec_warn ls -lah "$install_dir" -ynh_exec_warn ls -lah "$install_dir/upload/" - -rm "$install_dir/upload" +ynh_secure_remove "$install_dir/upload" ln -s "$data_dir/upload" "$install_dir/upload" chmod 750 "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index 65b7c7d..b5b5a1a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,16 +39,13 @@ fi ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="plugins/ application/config/config.php" - -ln -s "$data_dir/upload" "$install_dir/upload" +ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="plugins/ application/config/config.php upload" chmod 750 "$install_dir" -chmod 750 "$install_dir/tmp" -chmod 750 "$install_dir/application/config/" chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" +# Set permissions just in case chmod 750 "$data_dir" chown -R "$app:www-data" "$data_dir"