mirror of
https://github.com/YunoHost-Apps/pepettes_ynh.git
synced 2024-09-03 19:56:35 +02:00
Fixes
This commit is contained in:
parent
796149b39b
commit
f9084fa91c
7 changed files with 11 additions and 19 deletions
|
@ -1,4 +1,4 @@
|
|||
command = '__FINALPATH__/venv/bin/gunicorn'
|
||||
command = '__PYTHON_PATH__/gunicorn'
|
||||
pythonpath = '__FINALPATH__'
|
||||
workers = 4
|
||||
user = '__NAME__'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue