diff --git a/conf/nginx.conf b/conf/nginx.conf index 60c020e..52ed459 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,19 +1,9 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; - -location @handler { - rewrite ^/(.*)$ __PATH__/index.php?^$1 last; -} - location __PATH__/ { # Path to source alias __FINALPATH__/ ; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - index index.php; # Réécriture vers l'index @@ -33,11 +23,11 @@ location __PATH__/ { } # Redirections - ## Flux RSS + # Flux RSS location ~ ^__PATH__/feed/ { rewrite ^__PATH__/feed\/(.*)$ __PATH__/feed.php?^$1 last; } - ## Sitemap + # Sitemap location = __PATH__/sitemap.xml { rewrite .* __PATH__/sitemap.php; } @@ -48,19 +38,7 @@ location __PATH__/ { } # Cache-control - location ~ ^__PATH__/data/ { - more_set_headers 'Cache-Control: public'; - expires 12h; - } - location ~ ^__PATH__/core/ { - more_set_headers 'Cache-Control: public'; - expires 12h; - } - location ~ ^__PATH__/plugins/ { - more_set_headers 'Cache-Control: public'; - expires 12h; - } - location ~ ^__PATH__/themes/ { + location ~ ^__PATH__/(data|themes|core|plugins|themes) { more_set_headers 'Cache-Control: public'; expires 12h; } @@ -68,3 +46,7 @@ location __PATH__/ { # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } + +location @handler { + rewrite ^/(.*)$ __PATH__/index.php?^$1 last; +} diff --git a/manifest.json b/manifest.json index d94745e..25110ef 100644 --- a/manifest.json +++ b/manifest.json @@ -23,7 +23,7 @@ "url": "https://miaou.org" }, "requirements": { - "yunohost": ">= 4.2.0" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ @@ -34,8 +34,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "path", @@ -45,8 +44,7 @@ }, { "name": "admin", - "type": "user", - "example": "johndoe" + "type": "user" }, { "name": "is_public", @@ -69,8 +67,7 @@ }, { "name": "password", - "type": "password", - "example": "Choose a password" + "type": "password" } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index ef945cd..23ffb79 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,10 +4,10 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION=7.3 +YNH_PHP_VERSION=7.4 # dependencies used by the app -extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-xml" +pkg_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-xml" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 87395c0..cf1945b 100644 --- a/scripts/install +++ b/scripts/install @@ -25,9 +25,9 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH -admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE +admin=$YNH_APP_ARG_ADMIN password=$YNH_APP_ARG_PASSWORD app=$YNH_APP_INSTANCE_NAME @@ -53,6 +53,13 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=language --value=$language +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # CREATE DEDICATED USER #================================================= @@ -90,7 +97,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= @@ -98,7 +105,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SETUP APPLICATION WITH CURL #================================================= -ynh_script_progression --message="Setuping application with CURL..." +ynh_script_progression --message="Setuping application with cURL..." # Set the app as temporarily public for cURL call ynh_permission_update --permission="main" --add="visitors" diff --git a/scripts/remove b/scripts/remove index 41a0c64..14b05fa 100755 --- a/scripts/remove +++ b/scripts/remove @@ -45,6 +45,14 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index 95d7db7..b71992d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -37,8 +37,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " diff --git a/scripts/upgrade b/scripts/upgrade index 2c44578..bfd1539 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,7 +25,6 @@ language=$(ynh_app_setting_get --app=$app --key=language) #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -95,6 +94,14 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading PHP-FPM configuration..." + +# Create a dedicated PHP-FPM config +ynh_add_fpm_config + #================================================= # NGINX CONFIGURATION #================================================= @@ -103,14 +110,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." - -# Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" - #================================================= # SPECIFIC UPGRADE #=================================================