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:
parent
99074c5e2c
commit
c4da2bc0b6
1 changed files with 10 additions and 23 deletions
|
@ -1,9 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
#=================================================
|
||||
# GENERIC STARTING
|
||||
# GENERIC START
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
@ -12,19 +10,11 @@ source _common.sh
|
|||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# MANAGE FAILURE OF THE SCRIPT
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
ynh_clean_setup () {
|
||||
# Nettoyage des résidus d'installation non pris en charge par le script remove.
|
||||
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.
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||
|
@ -40,16 +30,14 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
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
|
||||
test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
||||
|
||||
# Check web path availability
|
||||
#ynh_webpath_available $domain $path_url
|
||||
# Register (book) web path
|
||||
#ynh_webpath_register $app $domain $path_url
|
||||
ynh_webpath_available $domain $path_url
|
||||
ynh_webpath_register $app $domain $path_url
|
||||
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
|
@ -81,8 +69,10 @@ sudo apt-get install -yy -qq mongodb-org
|
|||
#=================================================
|
||||
# INSTALL NODEJS
|
||||
#=================================================
|
||||
|
||||
version=9.3.0
|
||||
ynh_install_nodejs $version
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
|
@ -133,8 +123,6 @@ npm install --production >> $install_log 2>&1
|
|||
npm install mongo
|
||||
popd
|
||||
|
||||
yunohost firewall allow Both $port
|
||||
|
||||
#=================================================
|
||||
# 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...
|
||||
ynh_check_starting "NodeBB is now listening on: 0.0.0.0:4567" "/var/log/syslog" "60"
|
||||
|
||||
#=================================================
|
||||
# ENABLE SERVICE IN ADMIN PANEL
|
||||
|
@ -220,5 +209,3 @@ fi
|
|||
#=================================================
|
||||
|
||||
systemctl reload nginx
|
||||
ynh_check_starting "NodeBB is now listening on: 0.0.0.0:4567" "/var/log/syslog" "30"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue