From 80f35a3e3bca31aec3fe6bea0e8558c4b82b130e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 9 Jul 2024 23:14:31 +0200 Subject: [PATCH] Run with node, install config outside sources --- conf/systemd.service | 4 ++-- scripts/install | 6 +++--- scripts/upgrade | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index d90cd4f..8d4ff4f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,10 +6,10 @@ After=network.target Type=simple Environment=NODE_ENV=production Environment="__YNH_NODE_LOAD_PATH__" -Environment=NODE_CONFIG_DIR=__INSTALL_DIR__/sources/config +Environment=NODE_CONFIG_DIR=__INSTALL_DIR__/config User=__APP__ Group=__APP__ -ExecStart=__YNH_NPM__ start +ExecStart=__YNH_NODE__ __INSTALL_DIR__/sources/dist/server.js WorkingDirectory=__INSTALL_DIR__/sources/ StandardOutput=syslog StandardError=syslog diff --git a/scripts/install b/scripts/install index d5ecf0b..b3d0302 100644 --- a/scripts/install +++ b/scripts/install @@ -53,10 +53,10 @@ popd #================================================= ynh_script_progression --message="Adding a config file..." -ynh_add_config --template="default.yaml" --destination="$install_dir/sources/config/production.yaml" +ynh_add_config --template="default.yaml" --destination="$install_dir/config/production.yaml" -chmod 400 "$install_dir/sources/config/production.yaml" -chown "$app:$app" "$install_dir/sources/config/production.yaml" +chmod 400 "$install_dir/config/production.yaml" +chown "$app:$app" "$install_dir/config/production.yaml" #================================================= # SYSTEM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 44cc1aa..0fa8b06 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,10 +74,10 @@ popd #================================================= ynh_script_progression --message="Updating a config file..." -ynh_add_config --template="default.yaml" --destination="$install_dir/sources/config/production.yaml" +ynh_add_config --template="default.yaml" --destination="$install_dir/config/production.yaml" -chmod 400 "$install_dir/sources/config/production.yaml" -chown "$app:$app" "$install_dir/sources/config/production.yaml" +chmod 400 "$install_dir/config/production.yaml" +chown "$app:$app" "$install_dir/config/production.yaml" #================================================= # REAPPLY SYSTEM CONFIGURATIONS