From 3dce3a69a943d5a78bae7d7855223ba14b446cb6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 27 Mar 2021 18:03:40 +0100 Subject: [PATCH] Fix --- conf/systemd.service | 2 +- manifest.json | 14 ++++++++++++++ scripts/install | 7 ++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index edea969..8a14a27 100755 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -9,7 +9,7 @@ Group=__APP__ WorkingDirectory=__FINALPATH__ Environment=PATH=__ENV_PATH__ Environment=NODE_ENV=production -ExecStart=__YNH_NPM__ mynewwiki --listen port=__PORT__ +ExecStart=__YNH_NPM__ mynewwiki --listen port=__PORT__ username=__ADMIN__ password=__PASSWORD__ Restart=always [Install] diff --git a/manifest.json b/manifest.json index b08d0ea..131537b 100644 --- a/manifest.json +++ b/manifest.json @@ -27,6 +27,20 @@ "type": "domain", "example": "domain.org" }, + { + "name": "admin", + "type": "user", + "example": "johndoe" + }, + { + "name": "password", + "type": "password", + "help": { + "en": "Use the help field to add an information for the admin about this question.", + "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." + }, + "example": "Choose a password" + } { "name": "is_public", "type": "boolean", diff --git a/scripts/install b/scripts/install index 5ee3979..891e7f2 100755 --- a/scripts/install +++ b/scripts/install @@ -26,6 +26,8 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC +password=$YNH_APP_ARG_PASSWORD +admin=$YNH_APP_ARG_ADMIN app=$YNH_APP_INSTANCE_NAME @@ -47,6 +49,8 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url +ynh_app_setting_set --app=$app --key=admin --value=$admin +ynh_app_setting_set --app=$app --key=password --value=$password #================================================= # STANDARD MODIFICATIONS @@ -110,7 +114,8 @@ ynh_script_progression --message="Configuring a systemd service..." --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="__PASSWORD__" --replace_string="$password" --target_file="../conf/systemd.service" +ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="../conf/systemd.service" ynh_add_systemd_config #=================================================