mirror of
https://github.com/YunoHost-Apps/nodebb_ynh.git
synced 2024-09-03 19:46:29 +02:00
Fix
This commit is contained in:
parent
afce2bb03a
commit
9b7f7e1da4
3 changed files with 19 additions and 13 deletions
|
@ -9,9 +9,12 @@ User=__APP__
|
|||
Group=__APP__
|
||||
WorkingDirectory=__FINALPATH__
|
||||
#PIDFile=/path/to/nodebb/pidfile
|
||||
Environment=NODE_ENV=production
|
||||
Environment="NODE_ENV=production"
|
||||
Environment="__YNH_NODE_LOAD_PATH__"
|
||||
|
||||
#ExecStart=__NODE__/node loader.js --no-daemon --no-silent
|
||||
ExecStart=__YNH_NPM__ start
|
||||
ExecStart= start
|
||||
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -22,15 +22,15 @@ nodejs_version=14
|
|||
#=================================================
|
||||
|
||||
# Execute a command as another user
|
||||
# usage: exec_as USER COMMAND [ARG ...]
|
||||
exec_as() {
|
||||
local user=$1
|
||||
# usage: ynh_exec_as USER COMMAND [ARG ...]
|
||||
ynh_exec_as() {
|
||||
local USER=$1
|
||||
shift 1
|
||||
|
||||
if [[ $user = $(whoami) ]]; then
|
||||
if [[ $USER = $(whoami) ]]; then
|
||||
eval "$@"
|
||||
else
|
||||
sudo -u "$user" "$@"
|
||||
sudo -u "$USER" "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -124,10 +124,10 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
ynh_script_progression --message="Configuring a systemd service..." --time --weight=1
|
||||
|
||||
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
||||
ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service"
|
||||
#ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
||||
#ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service"
|
||||
|
||||
ynh_add_systemd_config
|
||||
ynh_add_systemd_config --others_var="ynh_node_load_PATH"
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE SERVER.JS
|
||||
|
@ -142,9 +142,12 @@ ynh_add_config --template="../conf/config.json" --destination="$final_path/confi
|
|||
chown -R $app:$app $final_path
|
||||
|
||||
pushd $final_path
|
||||
exec_as $app ./nodebb setup -l > $install_log
|
||||
exec_as $app npm install nodebb-plugin-dbsearch --save-prod
|
||||
exec_as $app ./nodebb build -l
|
||||
ynh_exec_as $app env $ynh_node_load_PATH ./nodebb setup -l > $install_log
|
||||
ynh_exec_as $app env $ynh_node_load_PATH npm install nodebb-plugin-dbsearch --save-prod
|
||||
ynh_exec_as $app env $ynh_node_load_PATH ./nodebb build -l
|
||||
#exec_as $app ./nodebb setup -l > $install_log
|
||||
#exec_as $app npm install nodebb-plugin-dbsearch --save-prod
|
||||
#exec_as $app ./nodebb build -l
|
||||
popd
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue