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

Update install

This commit is contained in:
frju365 2018-01-28 15:58:21 +01:00 committed by GitHub
parent 99074c5e2c
commit c4da2bc0b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,9 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
#================================================= #=================================================
# GENERIC STARTING # GENERIC START
#================================================= #=================================================
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
@ -12,19 +10,11 @@ source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# MANAGE FAILURE OF THE SCRIPT # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_clean_setup () { # Exit if an error occurs during the execution of the script
# Nettoyage des résidus d'installation non pris en charge par le script remove. ynh_abort_if_errors
if test -n "$PID_TAIL"
then
SUPPRESS_WARNING kill -s 15 $PID_TAIL # Arrête l'exécution de tail.
sudo rm -f "$tempfile"
fi
echo ""
}
ynh_abort_if_errors # Active trap pour arrêter le script si une erreur est détectée.
#================================================= #=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST # RETRIEVE ARGUMENTS FROM THE MANIFEST
@ -40,16 +30,14 @@ app=$YNH_APP_INSTANCE_NAME
secret=$(ynh_string_random) secret=$(ynh_string_random)
#================================================= #=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THIS ARGS # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#================================================= #=================================================
final_path=/var/www/$app final_path=/var/www/$app
test ! -e "$final_path" || ynh_die "This path already contains a folder" test ! -e "$final_path" || ynh_die "This path already contains a folder"
# Check web path availability ynh_webpath_available $domain $path_url
#ynh_webpath_available $domain $path_url ynh_webpath_register $app $domain $path_url
# Register (book) web path
#ynh_webpath_register $app $domain $path_url
#================================================= #=================================================
# STORE SETTINGS FROM MANIFEST # STORE SETTINGS FROM MANIFEST
@ -81,8 +69,10 @@ sudo apt-get install -yy -qq mongodb-org
#================================================= #=================================================
# INSTALL NODEJS # INSTALL NODEJS
#================================================= #=================================================
version=9.3.0 version=9.3.0
ynh_install_nodejs $version ynh_install_nodejs $version
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
@ -133,8 +123,6 @@ npm install --production >> $install_log 2>&1
npm install mongo npm install mongo
popd popd
yunohost firewall allow Both $port
#================================================= #=================================================
# CREATE A SQL BDD # CREATE A SQL BDD
#================================================= #=================================================
@ -199,6 +187,7 @@ sudo systemctl enable "$app".service
#================================================= #=================================================
systemctl start $app # Démarre Nodebb. Le démarrage est fait le plus tôt possible, car il est très long... systemctl start $app # Démarre Nodebb. Le démarrage est fait le plus tôt possible, car il est très long...
ynh_check_starting "NodeBB is now listening on: 0.0.0.0:4567" "/var/log/syslog" "60"
#================================================= #=================================================
# ENABLE SERVICE IN ADMIN PANEL # ENABLE SERVICE IN ADMIN PANEL
@ -220,5 +209,3 @@ fi
#================================================= #=================================================
systemctl reload nginx systemctl reload nginx
ynh_check_starting "NodeBB is now listening on: 0.0.0.0:4567" "/var/log/syslog" "30"