mirror of
https://github.com/YunoHost-Apps/FastAPI_ynh.git
synced 2024-09-03 18:36:00 +02:00
fixing some linter error
This commit is contained in:
parent
5a5d0abfa6
commit
872c997bc8
6 changed files with 19 additions and 17 deletions
|
@ -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."
|
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue