diff --git a/config_panel.toml b/config_panel.toml index 630fb2a..ab07d29 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -4,15 +4,15 @@ version = "1.0" name.en = "Information about your app's code" name.fr = "Information à propos de votre propre code" - [main.custom_main_folder] - ask = "Name of your app's main folder" - type = "string" - default = "FastAPIAppFolder" - help = "It's the folder containing the object 'app' in __init__.py" + [main.custom_code] + [main.custom_code.main_folder] + ask = "Name of your app's main folder" + type = "string" + default = "FastAPIAppFolder" + help = "It's the folder containing the object 'app' in __init__.py" - [main.custom_requirements] - ask = "Do you have a custom requirement.txt" - type = "boolean" - optional = true - help = "Check it if you want my_FastAPI_app to install your custom python dependencies." - bind = "install_custom_requirements()" + [main.custom_code.requirements] + ask = "Do you have a custom requirement.txt" + type = "boolean" + optional = true + help = "Check it if you want my_FastAPI_app to install your custom python dependencies." \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index bb9f3ce..d5f0660 100644 --- a/manifest.toml +++ b/manifest.toml @@ -38,8 +38,8 @@ ram.runtime = "50M" 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" + help.en = "Password that you will need to upload your code on YunoHost" + help.fr = "Le mot de passe que vous utiliserez pour téléverser votre code sur Yunohost" type = "password" [resources] diff --git a/scripts/config b/scripts/config index 9972955..4a53e15 100644 --- a/scripts/config +++ b/scripts/config @@ -28,7 +28,7 @@ data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # SPECIFIC ACTION FOR TOML SHORT KEY #================================================= -install_custom_requirements() { +setter__requirements() { #Enable python virtual environnement source $install_dir/bin/activate diff --git a/scripts/install b/scripts/install index 87cd107..ea4d260 100755 --- a/scripts/install +++ b/scripts/install @@ -46,6 +46,8 @@ 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" +ynh_app_setting_set --app=$app --key=main_folder --value="FastAPIAppFolder" +ynh_app_setting_set --app=$app --key=requirements --value=0 # Add the password to this user chpasswd <<< "${app}:${password}" @@ -68,7 +70,7 @@ ynh_add_nginx_config ynh_add_systemd_config -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Gunicorn running a FastAPI app" --log="/var/log/$app/$app.log" #================================================= # Start the app server via systemd diff --git a/scripts/restore b/scripts/restore index 6b9f503..b9cb9f5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -58,7 +58,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="$log_file" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app +yunohost service add $app --description="Gunicorn running a FastAPI app" --log="/var/log/$app/$app.log" #================================================= # RESTORE THE LOGROTATE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 1a7be5e..1892674 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -65,7 +65,7 @@ ynh_add_nginx_config ynh_add_systemd_config -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Gunicorn running a FastAPI app" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE