diff --git a/scripts/install b/scripts/install index 63e8727..ca95e18 100755 --- a/scripts/install +++ b/scripts/install @@ -24,10 +24,6 @@ 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" -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - #================================================= # NGINX CONFIGURATION #================================================= @@ -55,6 +51,14 @@ pushd $install_dir ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm run build popd +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" +chown $app:www-data -R "$install_dir/frontend/build" +chown $app:www-data "$install_dir/frontend/build" +chown $app:www-data "$install_dir/frontend" +chown $app:www-data "$install_dir" + #================================================= # ADD A CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index e06d7da..e70e686 100755 --- a/scripts/restore +++ b/scripts/restore @@ -28,7 +28,11 @@ ynh_restore_file --origin_path="$install_dir" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R $app:$app "$install_dir" +chown $app:www-data -R "$install_dir/frontend/build" +chown $app:www-data "$install_dir/frontend/build" +chown $app:www-data "$install_dir/frontend" +chown $app:www-data "$install_dir" #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index 3d555e2..662e779 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -88,10 +88,6 @@ then ynh_setup_source --dest_dir="$install_dir" fi -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - #================================================= # NGINX CONFIGURATION #================================================= @@ -126,6 +122,14 @@ pushd $install_dir ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm run build popd +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" +chown $app:www-data -R "$install_dir/frontend/build" +chown $app:www-data "$install_dir/frontend/build" +chown $app:www-data "$install_dir/frontend" +chown $app:www-data "$install_dir" + #================================================= # UPDATE A CONFIG FILE #=================================================