1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/scrumblr_ynh.git synced 2024-09-03 20:16:29 +02:00
This commit is contained in:
ericgaspar 2020-12-27 13:17:13 +01:00
parent e7282193c1
commit d7811bcb50
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 10 additions and 10 deletions

View file

@ -7,9 +7,9 @@ Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
WorkingDirectory=__FINALPATH__ WorkingDirectory=__FINALPATH__
ExecStartPre=__NODEJS__
Environment="PATH=__ENV_PATH__" Environment="PATH=__ENV_PATH__"
ExecStart=__NODE__/node server.js --port __PORT__ Environment="NODE_ENV=production"
ExecStart=__YNH_NPM__ server.js --port __PORT__
Restart=always Restart=always
[Install] [Install]

View file

@ -116,9 +116,8 @@ ynh_add_nginx_config
#================================================= #=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_script_progression --message="Configuring a systemd service..." --weight=1
ynh_replace_string "__NODEJS__" "$nodejs_use_version" "/etc/systemd/system/$app.service" ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
ynh_replace_string "__ENV_PATH__" "$PATH" "/etc/systemd/system/$app.service" ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service"
ynh_replace_string "__NODE__" "$nodejs_path" "/etc/systemd/system/$app.service"
ynh_add_systemd_config ynh_add_systemd_config

View file

@ -47,6 +47,7 @@ fi
#================================================= #=================================================
# INSTALL NODEJS # INSTALL NODEJS
#================================================= #=================================================
ynh_install_nodejs 6.2.0 ynh_install_nodejs 6.2.0
#================================================= #=================================================
@ -98,23 +99,23 @@ ynh_systemd_config
script_dir="$PWD" script_dir="$PWD"
pushd "$final_path" pushd "$final_path"
sudo chown -R $app: $final_path chown -R $app: $final_path
sudo_path npm install --production >> $install_log 2>&1 npm install --production >> $install_log 2>&1
popd popd
sudo service redis-server start service redis-server start
#================================================= #=================================================
# ENABLE SERVICE IN ADMIN PANEL # ENABLE SERVICE IN ADMIN PANEL
#================================================= #=================================================
# Ajoute le service au monitoring de Yunohost. # Ajoute le service au monitoring de Yunohost.
sudo yunohost service add $app --log "/var/log/$app/$app.log" yunohost service add $app --log "/var/log/$app/$app.log"
#================================================= #=================================================
# START OSJS IN BACKGROUND # START OSJS IN BACKGROUND
#================================================= #=================================================
sudo systemctl start $app systemctl start $app
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT