diff --git a/conf/default.json b/conf/default.json index ba022b5..2ad7b03 100644 --- a/conf/default.json +++ b/conf/default.json @@ -1,9 +1,9 @@ { "webhooks": { - "host": "localhost", - "prefix": "__PATH__", + "host": "__DOMAIN__", + "prefix": "__CONF_PATH__", "port": __PORT__, "public_port": 443, "schema": "https" - }, + } } diff --git a/conf/systemd.service b/conf/systemd.service index ed05eac..fad5d1a 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,6 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__ -Environment="NODE_ENV=production" ExecStart=__YNH_NODE__ index.js # Sandboxing options to harden security diff --git a/scripts/install b/scripts/install index 71a6dbb..f26de1f 100755 --- a/scripts/install +++ b/scripts/install @@ -20,6 +20,12 @@ ynh_setup_source -d "$install_dir" chown -R $app:www-data "$install_dir" +if [ "$path" = "/" ]; then + conf_path="" + else + conf_path=$path +fi + ynh_install_nodejs --nodejs_version=$nodejs_version ynh_use_nodejs npm --prefix "$install_dir" install diff --git a/scripts/upgrade b/scripts/upgrade index d257799..610093b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -53,6 +53,12 @@ ynh_add_nginx_config ynh_script_progression -m "Updating the configuration..." -w 1 +if [ "$path" = "/" ]; then + conf_path="" + else + conf_path=$path +fi + ynh_add_config -t default.json -d "$install_dir/config/default.json" yunohost service add $app --description="Web frontend for Urban Dictionary" --log="/var/log/$app/$app.log"