From a748f8552d148e11f5a7291e7a7fe2a99be07f14 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 5 Mar 2021 14:44:04 +0100 Subject: [PATCH] Fix multi --- scripts/install | 7 ++----- scripts/restore | 10 ++-------- scripts/upgrade | 7 ++----- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/scripts/install b/scripts/install index a806f28..1414e0b 100755 --- a/scripts/install +++ b/scripts/install @@ -109,7 +109,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # SPECIFIC SETUP @@ -164,10 +164,7 @@ done ynh_script_progression --message="Securing files and directories..." # Set permissions to app files -chown -R root: $final_path -chown $app:root $final_path -chown $app:root $final_path/settings.py -chmod o=--- $final_path/settings.py +chown -R $app:root $final_path #================================================= # INTEGRATE SERVICE IN YUNOHOST diff --git a/scripts/restore b/scripts/restore index dfc084c..bce539d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -64,7 +64,7 @@ ynh_restore_file --origin_path="$final_path" ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE USER RIGHTS @@ -72,7 +72,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Restoring user rights..." # Restore permissions on app files -chown -R root: $final_path +chown -R $app:root $final_path #================================================= # SPECIFIC RESTORATION @@ -97,12 +97,6 @@ pushd $final_path $ynh_pip install gunicorn mkdir -p /var/log/$app chown -R $app:www-data /var/log/$app - cat <> wsgi.py -from server import app - -if __name__ == "__main__": - app.run() -EOF popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 3e02584..044a15c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -101,7 +101,7 @@ ynh_install_python --python_version=$python_version ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # SPECIFIC UPGRADE @@ -156,10 +156,7 @@ done ynh_script_progression --message="Securing files and directories..." # Set permissions on app files -chown -R root: $final_path -chown $app:root $final_path -chown $app:root $final_path/settings.py -chmod o=--- $final_path/settings.py +chown -R $app:root $final_path #================================================= # INTEGRATE SERVICE IN YUNOHOST