1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/peertube_ynh.git synced 2024-09-03 19:56:29 +02:00

fixing message issue and adding node PATH

This commit is contained in:
yalh76 2019-06-19 00:43:32 +02:00
parent d387dedd89
commit 2f99326ebe
5 changed files with 42 additions and 26 deletions

8
conf/message Normal file
View file

@ -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

14
conf/message_remove Normal file
View file

@ -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

View file

@ -176,8 +176,11 @@ ynh_store_file_checksum --file="$final_path/config/local-production.json"
# BUILD YARN DEPENDENCIES # BUILD YARN DEPENDENCIES
#================================================= #=================================================
chown -R "$app":"$app" $final_path
pushd "$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 popd
#================================================= #=================================================
@ -250,17 +253,14 @@ popd
#================================================= #=================================================
# SEND A README FOR THE ADMIN # 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 ynh_send_readme_to_admin --app_message="../conf/message" --recipients=$admin_email --type='install'
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"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -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_name=$(ynh_app_setting_get --app=$app --key=psql_db)
db_user=$app db_user=$app
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
admin_email=$(ynh_app_setting_get --app=$app --key=admin_email)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
@ -116,23 +117,13 @@ ynh_system_user_delete --username=$app
#================================================= #=================================================
# SEND A README FOR THE ADMIN # 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. ynh_send_readme_to_admin --app_message="../conf/message_remove" --recipients=$admin_email --type='remove'
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"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -187,8 +187,11 @@ ynh_replace_string --match_string="X-Frame-Options : SAMEORIGIN" --replace_strin
# BUILD YARN DEPENDENCIES # BUILD YARN DEPENDENCIES
#================================================= #=================================================
chown -R "$app":"$app" $final_path
pushd "$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 popd
#================================================= #=================================================