1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/z-push_ynh.git synced 2024-09-03 18:05:58 +02:00

Merge pull request #53 from YunoHost-Apps/testing

Testing
This commit is contained in:
yalh76 2020-02-25 21:29:38 +01:00 committed by GitHub
commit 9a5d11b080
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 60 additions and 27 deletions

View file

@ -1,29 +1,35 @@
location /Microsoft-Server-ActiveSync { location /Microsoft-Server-ActiveSync {
alias __FINALPATH__/ ; # Path to source
if ($scheme = http) { alias __FINALPATH__/ ;
rewrite ^ https://$server_name$request_uri? permanent;
}
index index.php;
client_max_body_size 50M;
try_files $uri $uri/ index.php;
rewrite ^(.*)$ /Microsoft-Server-ActiveSync/index.php last;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param HTTPS on;
fastcgi_read_timeout 630;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
# Include SSOWAT user panel. # Force usage of https
include conf.d/yunohost_panel.conf.inc; if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
index index.php;
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
client_max_body_size 50M;
try_files $uri $uri/ index.php;
rewrite ^(.*)$ /Microsoft-Server-ActiveSync/index.php last;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param HTTPS on;
fastcgi_read_timeout 630;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
} }
location /AutoDiscover/AutoDiscover.xml { location /AutoDiscover/AutoDiscover.xml {
alias __FINALPATH__/autodiscover/autodiscover.php; alias __FINALPATH__/autodiscover/autodiscover.php;
fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock;
include fastcgi_params; include fastcgi_params;
fastcgi_param HTTPS on; fastcgi_param HTTPS on;
@ -31,7 +37,7 @@ location /AutoDiscover/AutoDiscover.xml {
} }
location /Autodiscover/Autodiscover.xml { location /Autodiscover/Autodiscover.xml {
alias __FINALPATH__/autodiscover/autodiscover.php; alias __FINALPATH__/autodiscover/autodiscover.php;
fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock;
include fastcgi_params; include fastcgi_params;
fastcgi_param HTTPS on; fastcgi_param HTTPS on;
@ -39,9 +45,9 @@ location /Autodiscover/Autodiscover.xml {
} }
location /autodiscover/autodiscover.xml { location /autodiscover/autodiscover.xml {
alias __FINALPATH__/autodiscover/autodiscover.php; alias __FINALPATH__/autodiscover/autodiscover.php;
fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock;
include fastcgi_params; include fastcgi_params;
fastcgi_param HTTPS on; fastcgi_param HTTPS on;
fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param SCRIPT_FILENAME $request_filename;
} }

View file

@ -13,7 +13,11 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_print_info --message="Managing script failure..."
ynh_clean_setup () {
true
}
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors

View file

@ -12,17 +12,22 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_print_info --message="Managing script failure..."
ynh_clean_setup () {
true
}
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#================================================= #=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST # RETRIEVE ARGUMENTS FROM THE MANIFEST
#================================================= #=================================================
ynh_print_info --message="Retrieving arguments from the manifest..."
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url="/Microsoft-Server-ActiveSync" path_url="/Microsoft-Server-ActiveSync"
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
#================================================= #=================================================
@ -79,8 +84,6 @@ ynh_secure_remove "$final_path/tmp"
#================================================= #=================================================
ynh_print_info --message="Configuring nginx web server..." ynh_print_info --message="Configuring nginx web server..."
### `ynh_add_nginx_config` will use the file conf/nginx.conf
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
@ -116,6 +119,7 @@ chown -R $app: $final_logpath
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
ynh_print_info --message="Modifying a config file..."
# Configuration # Configuration
ynh_replace_string --match_string="__TIMEZONE__" --replace_string=$(cat /etc/timezone) --target_file="../conf/config.php" ynh_replace_string --match_string="__TIMEZONE__" --replace_string=$(cat /etc/timezone) --target_file="../conf/config.php"
@ -209,6 +213,7 @@ ln -s /usr/share/awl/inc/XML* /var/www/$app/include/
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
ynh_print_info --message="Securing files and directories..."
# Set permissions to app files # Set permissions to app files
chown -R $app: $final_path chown -R $app: $final_path

View file

@ -69,6 +69,7 @@ ynh_remove_logrotate
#================================================= #=================================================
# REMOVE STATEDIR AND FINAL_LOGPATH # REMOVE STATEDIR AND FINAL_LOGPATH
#================================================= #=================================================
ynh_print_info --message="Removing statedir and final_logpath..."
ynh_secure_remove --file="$statedir" ynh_secure_remove --file="$statedir"
ynh_secure_remove --file="$final_logpath" ynh_secure_remove --file="$final_logpath"

View file

@ -13,7 +13,11 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_print_info --message="Managing script failure..."
ynh_clean_setup () {
true
}
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
@ -45,6 +49,7 @@ test ! -d $final_path \
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Restoring the nginx configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
@ -72,6 +77,7 @@ ynh_system_user_create --username=$app
#================================================= #=================================================
# RESTORE USER RIGHTS # RESTORE USER RIGHTS
#================================================= #=================================================
ynh_print_info --message="Restoring user rights..."
# Restore permissions on app files # Restore permissions on app files
chown -R $app: $final_path chown -R $app: $final_path
@ -81,6 +87,7 @@ chown -R $app: $final_logpath
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Restoring PHP-FPM configuration..."
ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf"
@ -97,6 +104,7 @@ ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# RESTORE THE LOGROTATE CONFIGURATION # RESTORE THE LOGROTATE CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Restoring the logrotate configuration..."
ynh_restore_file --origin_path="/etc/logrotate.d/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app"

View file

@ -25,6 +25,7 @@ final_logpath=$(ynh_app_setting_get --app=$app --key=final_logpath)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
ynh_print_info --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
@ -80,6 +81,12 @@ ynh_abort_if_errors
# CHECK THE PATH # CHECK THE PATH
#================================================= #=================================================
# Normalize the URL path syntax
# N.B. : this is for app installations before YunoHost 2.7
# where this value might be something like /foo/ or foo/
# instead of /foo ....
# If nobody installed your app before 2.7, then you may
# safely remove this line
path_url=$(ynh_normalize_url_path --path_url=$path_url) path_url=$(ynh_normalize_url_path --path_url=$path_url)
#================================================= #=================================================
@ -135,6 +142,7 @@ ynh_add_fpm_config
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
ynh_print_info --message="Modifying a config file..."
# Configuration # Configuration
ynh_replace_string --match_string="__TIMEZONE__" --replace_string="$(cat /etc/timezone)" --target_file="../conf/config.php" ynh_replace_string --match_string="__TIMEZONE__" --replace_string="$(cat /etc/timezone)" --target_file="../conf/config.php"
@ -236,6 +244,7 @@ ynh_use_logrotate --non-append
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
ynh_print_info --message="Securing files and directories..."
# Set permissions on app files # Set permissions on app files
chown -R $app: $final_path chown -R $app: $final_path