From 18c4f2d254fcf0e9b864f92928feb530ecac7abd Mon Sep 17 00:00:00 2001 From: leonard Date: Fri, 1 Dec 2023 20:35:15 +0100 Subject: [PATCH] =?UTF-8?q?ajout=20d'une=20option=20pour=20pouvoir=20uploa?= =?UTF-8?q?d=C3=A9=20du=20code=20au=20bon=20endroit=20via=20sFTP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/gunicorn.conf.py | 2 +- manifest.toml | 9 +++++++++ scripts/install | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/conf/gunicorn.conf.py b/conf/gunicorn.conf.py index cb40c98..162b84c 100644 --- a/conf/gunicorn.conf.py +++ b/conf/gunicorn.conf.py @@ -17,4 +17,4 @@ accesslog = '__LOG_FILE__' errorlog = '__LOG_FILE__' # https://docs.gunicorn.org/en/latest/settings.html#pidfile -pidfile = '__DATA_DIR__/gunicorn.pid' # /home/yunohost.app/$app/gunicorn.pid +pidfile = '__INSTALL_DIR__/gunicorn.pid' diff --git a/manifest.toml b/manifest.toml index 3ddc348..a175245 100644 --- a/manifest.toml +++ b/manifest.toml @@ -37,8 +37,16 @@ ram.runtime = "50M" type = "group" default = "visitors" + [install.password] + ask.en = "Password that you will need to upload your code on YunoHost" + ask.fr = "Le mot de passe que vous utiliserez pour téléverser votre code sur Yunohost" + type = "password" + [resources] [resources.system_user] + allow_sftp = true + allow_ssh = false + home = "/home/yunohost.app/__APP__" # This will provision/deprovision a unix system user [resources.install_dir] @@ -46,6 +54,7 @@ ram.runtime = "50M" [resources.data_dir] # This will create/remove the data dir as /home/yunohost.app/$app # and store the corresponding setting $data_dir + dir = "/home/yunohost.app/__APP__" [resources.permissions] # This will configure SSOwat permission for $domain/$path/ diff --git a/scripts/install b/scripts/install index d428c24..d9a2a97 100755 --- a/scripts/install +++ b/scripts/install @@ -69,6 +69,9 @@ ynh_add_config --template="gunicorn.conf.py" --destination="$install_dir/gunicor mkdir -p "$data_dir/FastAPIAppFolder" ynh_add_config --template="__init__.py" --destination="$data_dir/FastAPIAppFolder/__init__.py" +# Add the password to this user +chpasswd <<< "${app}:${password}" + #================================================= # GENERIC FINALIZATION #================================================= @@ -100,4 +103,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="$log_file" # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last \ No newline at end of file +ynh_script_progression --message="Installation of $app completed" --last