diff --git a/conf/message b/conf/message new file mode 100644 index 0000000..56104fb --- /dev/null +++ b/conf/message @@ -0,0 +1,8 @@ +__APP__ was successfully installed :) + +Please open your $app domain: https://__DOMAIN____PATH_URL__ + +The admin username is: root +The admin password is: __ADMIN_PASS__ + +If you are facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/peertube_ynh \ No newline at end of file diff --git a/conf/message_remove b/conf/message_remove new file mode 100644 index 0000000..d0cdb68 --- /dev/null +++ b/conf/message_remove @@ -0,0 +1,14 @@ +__APP__ was successfully removed :) + +__APP__ was successfully removed. The domain https://__DOMAIN____PATH_URL__ is free for other apps to be installed on it. + +But a futher action is required from your side to completely remove the __APP__ data folder. If you have backup and plan to restore this app in the future DON'T RUN THIS COMMAND. +And if you are going to migrate to othe server you will have to move /home/yunohost.app/__APP__ to your new server. + + +You need to run this command to remove the data (warning all your videos will be removed) : + +rm -R /home/yunohost.app/__APP__ -f + + +If you facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/peertube_ynh \ No newline at end of file diff --git a/scripts/install b/scripts/install index 0d3e44e..78bb486 100644 --- a/scripts/install +++ b/scripts/install @@ -176,8 +176,11 @@ ynh_store_file_checksum --file="$final_path/config/local-production.json" # BUILD YARN DEPENDENCIES #================================================= +chown -R "$app":"$app" $final_path + pushd "$final_path" - yarn install --production --pure-lockfile + ynh_use_nodejs + sudo -u $app env PATH=$PATH yarn install --production --pure-lockfile popd #================================================= @@ -250,17 +253,14 @@ popd #================================================= # SEND A README FOR THE ADMIN #================================================= +ynh_print_info --message="Sending a readme for the admin..." -message=" $app was successfully installed :) +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/message" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message" +ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message" +ynh_replace_string --match_string="__ADMIN_PASS__" --replace_string="$admin_pass" --target_file="../conf/message" -Please open your $app domain: https://$domain$path_url - -The admin username is: root -The admin password is: $admin_pass - -If you are facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/peertube_ynh" - -ynh_send_readme_to_admin --app_message="$message" +ynh_send_readme_to_admin --app_message="../conf/message" --recipients=$admin_email --type='install' #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index ffdd851..5b44809 100644 --- a/scripts/remove +++ b/scripts/remove @@ -22,6 +22,7 @@ port=$(ynh_app_setting_get --app=$app --key=port) db_name=$(ynh_app_setting_get --app=$app --key=psql_db) db_user=$app final_path=$(ynh_app_setting_get --app=$app --key=final_path) +admin_email=$(ynh_app_setting_get --app=$app --key=admin_email) #================================================= # STANDARD REMOVE @@ -116,23 +117,13 @@ ynh_system_user_delete --username=$app #================================================= # SEND A README FOR THE ADMIN #================================================= +ynh_print_info --message="Sending a readme for the admin..." -message="$app was successfully removed :) +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/message_remove" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message_remove" +ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message_remove" -$app was successfully removed. The domain https://$domain$path_url is free for other apps to be installed on it. - -But a futher action is required from your side to completely remove the $app data folder. If you have backup and plan to restore this app in the future DON'T RUN THIS COMMAND. -And if you are going to migrate to othe server you will have to move /home/yunohost.app/$app to your new server. - - -You need to run this command to remove the data (warning all your videos will be removed) : - -rm -R /home/yunohost.app/$app -f - - -If you facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/peertube_ynh" - -ynh_send_readme_to_admin --app_message="$message" +ynh_send_readme_to_admin --app_message="../conf/message_remove" --recipients=$admin_email --type='remove' #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index 7d58b70..a2d4d91 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -187,8 +187,11 @@ ynh_replace_string --match_string="X-Frame-Options : SAMEORIGIN" --replace_strin # BUILD YARN DEPENDENCIES #================================================= +chown -R "$app":"$app" $final_path + pushd "$final_path" - yarn install --production --pure-lockfile + ynh_use_nodejs + sudo -u $app env PATH=$PATH yarn install --production --pure-lockfile popd #=================================================