1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pluxml_ynh.git synced 2024-09-03 20:16:02 +02:00

Cleaning up

This commit is contained in:
Éric Gaspar 2022-06-16 09:55:49 +02:00
parent b46400e40a
commit d38fb9490e
No known key found for this signature in database
GPG key ID: 574F281483054D44
7 changed files with 39 additions and 48 deletions

View file

@ -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;
}

View file

@ -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"
}
]
}

View file

@ -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

View file

@ -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"

View file

@ -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
#=================================================

View file

@ -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 "

View file

@ -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
#=================================================