diff --git a/scripts/install b/scripts/install index fd7a9de..c5ea928 100644 --- a/scripts/install +++ b/scripts/install @@ -142,12 +142,9 @@ touch "$final_path/config/local-production.json" mkdir -p "/etc/nginx/conf.d/${domain}.d" ynh_add_nginx_config -#================================================= -# SETUP APPLICATION WITH CURL -#================================================= # Set right permissions for curl install -chown -R "$app" "$datadir" +chown -R "$app":"app" "$datadir" # Reload Nginx systemctl reload nginx @@ -179,7 +176,7 @@ ynh_store_file_checksum "$final_path/config/production.yaml" #================================================= # Use logrotate to manage application logfile(s) -ynh_use_logrotate +ynh_use_logrotate "/home/yunohost.app/${app}/storage/logs/peertube.log" #================================================= # SETUP SSOWAT @@ -211,6 +208,9 @@ systemctl start "$app" # we need to wait for the service to init peertube's database (cd "/var/www/$app" && sleep 15 && exec /bin/sh -c "echo $admin_pass | NODE_CONFIG_DIR=/var/www/$app/config NODE_ENV=production PATH=/opt/node_n/bin:$PATH npm run reset-password -- -u root") +# Give permisiion to the final_path +chown -R "$app":"$app" "$final_path" "$datadir" + #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/restore b/scripts/restore index 2d9eb88..738c34a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -79,9 +79,9 @@ ynh_system_user_create "$app" # RESTORE USER RIGHTS #================================================= -# Set right permissions for curl install +# Set right permissions datadir="/home/yunohost.app/${app}/storage" -chown -R "$app" "$datadir" +chown -R "$app":"app" "$datadir" #================================================= # SPECIFIC RESTORATION @@ -132,6 +132,9 @@ ynh_restore_file "/etc/logrotate.d/$app" (cd "$final_path" && yarn install --production --pure-lockfile) +# Set right permissions for curl install +chown -R "$app":"app" "$datadir" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a15153e..96d5149 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -159,8 +159,8 @@ ynh_use_logrotate --non-append ynh_add_systemd_config -# Set right permissions for curl installation -chown -R "$app":$app "$final_path" "$datadir" +# Set right permissions +chown -R "$app":"$app" "$final_path" "$datadir" #=================================================