diff --git a/conf/gunicorn.py b/conf/gunicorn.py index 4c88dda..8af01f8 100644 --- a/conf/gunicorn.py +++ b/conf/gunicorn.py @@ -1,4 +1,4 @@ -command = '__FINALPATH__/venv/bin/gunicorn' +command = '__PYTHON_PATH__/gunicorn' pythonpath = '__FINALPATH__' workers = 4 user = '__NAME__' diff --git a/conf/systemd.service b/conf/systemd.service index 746d3db..29f9e3b 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=Small description of the service +Description=__APP__ Daemon After=network.target [Service] @@ -7,7 +7,7 @@ PIDFile=/run/gunicorn/__APP__-pid User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__ -ExecStart=__FINALPATH__/venv/bin/gunicorn -c __FINALPATH__/gunicorn.py wsgi:app +ExecStart=__PYTHON_PATH__/gunicorn -c __FINALPATH__/gunicorn.py wsgi:app ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s TERM $MAINPID PrivateTmp=true diff --git a/manifest.json b/manifest.json index 3077a93..6d5d8ac 100644 --- a/manifest.json +++ b/manifest.json @@ -32,16 +32,6 @@ }, "example": "example.com" }, - { - "name": "path", - "type": "path", - "ask": { - "en": "Choose a path for pepettes", - "fr": "Choisissez un chemin pour pepettes" - }, - "example": "/donation", - "default": "/donation" - }, { "name": "is_public", "type": "boolean", diff --git a/scripts/install b/scripts/install index facc68b..75c0d19 100755 --- a/scripts/install +++ b/scripts/install @@ -25,7 +25,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH +path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC project_name=$YNH_APP_ARG_PROJECT_NAME contact_url=$YNH_APP_ARG_CONTACT_URL @@ -120,6 +120,7 @@ ynh_script_progression --message="Installing Python dependencies..." pushd $final_path ynh_use_python + $ynh_pip install --upgrade pip $ynh_pip install -r requirements.txt $ynh_pip install gunicorn mkdir -p /var/log/$app @@ -138,7 +139,7 @@ popd ynh_script_progression --message="Configuring a systemd service..." --weight=1 # Create a dedicated systemd config -ynh_add_systemd_config +ynh_add_systemd_config --others_var="python_path" #================================================= # MODIFY A CONFIG FILE @@ -181,7 +182,7 @@ yunohost service add $app --description="A simple donation form" --log="/var/log ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index 2fe5759..4d0c4c5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -92,6 +92,7 @@ ynh_script_progression --message="Installing Python dependencies..." pushd $final_path ynh_use_python + $ynh_pip install --upgrade pip $ynh_pip install -r requirements.txt $ynh_pip install gunicorn mkdir -p /var/log/$app diff --git a/scripts/upgrade b/scripts/upgrade index 9025f28..a122c90 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -111,6 +111,7 @@ ynh_script_progression --message="Installing Python dependencies..." pushd $final_path ynh_use_python + $ynh_pip install --upgrade pip $ynh_pip install -r requirements.txt $ynh_pip install gunicorn mkdir -p /var/log/$app @@ -129,7 +130,7 @@ popd ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config -ynh_add_systemd_config +ynh_add_systemd_config --others_var="python_path" #================================================= # MODIFY A CONFIG FILE diff --git a/scripts/ynh_install_python b/scripts/ynh_install_python index 910aaa2..aa5d286 100644 --- a/scripts/ynh_install_python +++ b/scripts/ynh_install_python @@ -99,9 +99,8 @@ ynh_use_python () { if [[ :$PATH: != *":$python_path"* ]]; then PATH="$python_path:$PATH" fi - python_path="$PATH" # Create an alias to easily load the PATH - ynh_python_load_path="PATH=$python_path" + ynh_python_load_path="PATH=$PATH" # Sets the local application-specific Python version (cd $final_path