1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/moodle_ynh.git synced 2024-09-03 19:46:23 +02:00

fix nginx and weight

This commit is contained in:
Kay0u 2020-03-24 15:11:10 +01:00
parent 4c401fae03
commit fe3080eeae
No known key found for this signature in database
GPG key ID: 7FF262C033518333
3 changed files with 21 additions and 25 deletions

View file

@ -17,7 +17,7 @@ location __PATH__/ {
try_files $uri $uri/ index.php;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm-__NAME__.sock;
fastcgi_pass unix:/var/run/php/php__YNH_PHP_VERSION__-fpm-__NAME__.sock;
fastcgi_index index.php;
include fastcgi_params;

View file

@ -15,10 +15,6 @@ source ynh_install_php
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
### Remove this function if there's nothing to clean before calling the remove script.
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
@ -37,7 +33,7 @@ app=$YNH_APP_INSTANCE_NAME
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
ynh_script_progression --message="Validating installation parameters..." --time --weight=1
ynh_script_progression --message="Validating installation parameters..."
final_path=/var/www/$app
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
@ -50,7 +46,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_script_progression --message="Storing installation settings..." --time --weight=1
ynh_script_progression --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
@ -63,7 +59,7 @@ ynh_app_setting_set --app=$app --key=is_public --value=$is_public
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..." --time --weight=1
ynh_script_progression --message="Installing dependencies..." --weight=60
ynh_install_app_dependencies $pkg_dependencies
ynh_install_php --phpversion="$YNH_PHP_VERSION" --package="$extra_pkg_dependencies"
@ -71,7 +67,7 @@ ynh_install_php --phpversion="$YNH_PHP_VERSION" --package="$extra_pkg_dependenci
#=================================================
# CREATE POSTGRESQL DATABASE
#=================================================
ynh_script_progression --message="Creating a PostgreSQL database..." --time --weight=1
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=4
ynh_psql_test_if_first_run
@ -84,7 +80,7 @@ db_pwd=$(ynh_app_setting_get $app psqlpwd)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --time --weight=1
ynh_script_progression --message="Setting up source files..." --weight=6
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
@ -93,15 +89,15 @@ ynh_setup_source --dest_dir="$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring nginx web server..." --time --weight=1
ynh_script_progression --message="Configuring nginx web server..." --weight=2
# Create a dedicated nginx config
ynh_add_nginx_config
ynh_add_nginx_config YNH_PHP_VERSION
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..." --time --weight=1
ynh_script_progression --message="Configuring system user..." --weight=2
# Create a system user
ynh_system_user_create --username=$app
@ -110,7 +106,7 @@ ynh_system_user_create --username=$app
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring php-fpm..." --time --weight=1
ynh_script_progression --message="Configuring php-fpm..." --weight=1
# Create a dedicated php-fpm config
ynh_add_fpm_config --phpversion="7.3"
@ -129,7 +125,7 @@ chown -R "$app": "$final_path"
#=================================================
# SETUP APPLICATION
#=================================================
ynh_script_progression --message="Configuring the application..." --time --weight=1
ynh_script_progression --message="Configuring the application..." --weight=190
email=$(ynh_user_get_info $admin mail)
@ -163,7 +159,7 @@ fi
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading nginx web server..." --time --weight=1
ynh_script_progression --message="Reloading nginx web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
@ -171,4 +167,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --time --last
ynh_script_progression --message="Installation of $app completed" --last

View file

@ -14,7 +14,7 @@ source ynh_install_php
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1
ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
@ -28,7 +28,7 @@ data_root=$(ynh_app_setting_get --app=$app --key=data_root)
#=================================================
# REMOVE THE POSTGRESQL DATABASE
#=================================================
ynh_script_progression --message="Removing the PostgresSQL database..." --time --weight=1
ynh_script_progression --message="Removing the PostgresSQL database..."
# Remove a database if it exists, along with the associated user
ynh_psql_remove_db --db_user=$db_name --db_name=$db_name
@ -36,7 +36,7 @@ ynh_psql_remove_db --db_user=$db_name --db_name=$db_name
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --time --weight=1
ynh_script_progression --message="Removing dependencies..."
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
@ -44,7 +44,7 @@ ynh_remove_app_dependencies
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_script_progression --message="Removing app main directory..." --time --weight=1
ynh_script_progression --message="Removing app main directory..."
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
@ -52,7 +52,7 @@ ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing nginx web server configuration..." --time --weight=1
ynh_script_progression --message="Removing nginx web server configuration..."
# Remove the dedicated nginx config
ynh_remove_nginx_config
@ -60,7 +60,7 @@ ynh_remove_nginx_config
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Removing php-fpm configuration..." --time --weight=1
ynh_script_progression --message="Removing php-fpm configuration..." --weight=20
# Remove the dedicated php-fpm config
ynh_remove_fpm_config
@ -83,7 +83,7 @@ ynh_secure_remove --file="$data_root"
#=================================================
# REMOVE DEDICATED USER
#=================================================
ynh_script_progression --message="Removing the dedicated system user..." --time --weight=1
ynh_script_progression --message="Removing the dedicated system user..."
# Delete a system user
ynh_system_user_delete --username=$app
@ -92,4 +92,4 @@ ynh_system_user_delete --username=$app
# END OF SCRIPT
#=================================================
ynh_print_info "Removal of $app completed"
ynh_script_progression --message="Removal of $app completed" --last