mirror of
https://github.com/YunoHost-Apps/wordpress_ynh.git
synced 2024-09-03 20:36:10 +02:00
commit
ecd3590bae
5 changed files with 8 additions and 161 deletions
|
@ -20,7 +20,7 @@ WordPress is open source software you can use to create a beautiful website, blo
|
||||||
With this package, you can even activate the [multisite](https://wordpress.org/support/article/glossary/#multisite) option.
|
With this package, you can even activate the [multisite](https://wordpress.org/support/article/glossary/#multisite) option.
|
||||||
|
|
||||||
|
|
||||||
**Shipped version:** 6.3.1~ynh1
|
**Shipped version:** 6.4.2~ynh1
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ WordPress est un logiciel libre que vous pouvez utiliser pour créer un site ou
|
||||||
Avec ce package, vous pouvez même activer l'option [multisite](https://codex.wordpress.org/Glossary#Multisite).
|
Avec ce package, vous pouvez même activer l'option [multisite](https://codex.wordpress.org/Glossary#Multisite).
|
||||||
|
|
||||||
|
|
||||||
**Version incluse :** 6.3.1~ynh1
|
**Version incluse :** 6.4.2~ynh1
|
||||||
|
|
||||||
## Captures d’écran
|
## Captures d’écran
|
||||||
|
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
version = "1.0"
|
|
||||||
|
|
||||||
[main]
|
|
||||||
name = "WordPress configuration"
|
|
||||||
|
|
||||||
[main.maintenance_mode]
|
|
||||||
name = "Maintenance mode"
|
|
||||||
|
|
||||||
[main.maintenance_mode.maintenance_mode]
|
|
||||||
ask = "Enable maintenance mode"
|
|
||||||
type = "boolean"
|
|
||||||
default = "0"
|
|
||||||
|
|
||||||
[main.php_fpm_config]
|
|
||||||
name = "PHP-FPM configuration"
|
|
||||||
|
|
||||||
[main.php_fpm_config.fpm_footprint]
|
|
||||||
ask = "Memory footprint"
|
|
||||||
type = "select"
|
|
||||||
choices.low = "Low, <= 20Mb per pool"
|
|
||||||
choices.medium = "Medium, between 20Mb and 40Mb per pool"
|
|
||||||
choices.high = "High, > 40Mb per pool"
|
|
||||||
choices.specific = "Use specific value"
|
|
||||||
default = "low"
|
|
||||||
|
|
||||||
[main.php_fpm_config.fpm_free_footprint]
|
|
||||||
visible = "fpm_footprint == 'specific'"
|
|
||||||
ask = "Memory footprint of the service?"
|
|
||||||
type = "number"
|
|
||||||
default = "0"
|
|
||||||
help = "Free field to specify exactly the footprint in Mb if you don't want to use one of the three previous values."
|
|
||||||
|
|
||||||
[main.php_fpm_config.fpm_usage]
|
|
||||||
ask = "Expected usage"
|
|
||||||
type = "select"
|
|
||||||
choices = ["low", "medium", "high"]
|
|
||||||
default = "low"
|
|
||||||
help = "low: Personal usage, behind the SSO. No RAM footprint when not used, but the impact on the processor can be high if many users are using the service.<br>medium: Low usage, few people or/and publicly accessible. Low RAM footprint, medium processor footprint when used.<br>high: High usage, frequently visited website. High RAM footprint, but lower on processor usage and quickly responding."
|
|
|
@ -5,7 +5,7 @@ name = "WordPress"
|
||||||
description.en = "Create a beautiful blog or website easily"
|
description.en = "Create a beautiful blog or website easily"
|
||||||
description.fr = "Logiciel de création de blog ou de site Web"
|
description.fr = "Logiciel de création de blog ou de site Web"
|
||||||
|
|
||||||
version = "6.3.1~ynh1"
|
version = "6.4.2~ynh1"
|
||||||
|
|
||||||
maintainers = ["kay0u"]
|
maintainers = ["kay0u"]
|
||||||
|
|
||||||
|
@ -19,8 +19,11 @@ code = "https://core.trac.wordpress.org/browser"
|
||||||
yunohost = ">= 11.2"
|
yunohost = ">= 11.2"
|
||||||
architectures = "all"
|
architectures = "all"
|
||||||
multi_instance = true
|
multi_instance = true
|
||||||
|
|
||||||
ldap = true
|
ldap = true
|
||||||
|
|
||||||
sso = true
|
sso = true
|
||||||
|
|
||||||
disk = "50M"
|
disk = "50M"
|
||||||
ram.build = "50M"
|
ram.build = "50M"
|
||||||
ram.runtime = "50M"
|
ram.runtime = "50M"
|
||||||
|
@ -55,8 +58,8 @@ ram.runtime = "50M"
|
||||||
|
|
||||||
[resources]
|
[resources]
|
||||||
[resources.sources.main]
|
[resources.sources.main]
|
||||||
url = "https://downloads.wordpress.org/release/wordpress-6.3.1.zip"
|
url = "https://downloads.wordpress.org/release/wordpress-6.4.2.zip"
|
||||||
sha256 = "8a3c60c390b1e29143ba49292a5e38d8f7bff2ff6b67a3e4988d157f555a0601"
|
sha256 = "24dac66b4aab05521e0a0eb536ff23fcfdb82f940fc6c380735c2d54fa01f311"
|
||||||
|
|
||||||
[resources.system_user]
|
[resources.system_user]
|
||||||
|
|
||||||
|
|
118
scripts/config
118
scripts/config
|
@ -1,118 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC STARTING
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source _common.sh
|
|
||||||
source /usr/share/yunohost/helpers
|
|
||||||
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RETRIEVE ARGUMENTS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
|
||||||
current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC GETTERS FOR TOML SHORT KEY
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
get__maintenance_mode() {
|
|
||||||
# Maintenance mode status
|
|
||||||
if [ -f $install_dir/.maintenance ]
|
|
||||||
then
|
|
||||||
echo "1"
|
|
||||||
else
|
|
||||||
echo "0"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
get__fpm_footprint() {
|
|
||||||
# Free footprint value for php-fpm
|
|
||||||
# Check if current_fpm_footprint is an integer
|
|
||||||
if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null
|
|
||||||
then
|
|
||||||
echo "specific"
|
|
||||||
else
|
|
||||||
echo "$current_fpm_footprint"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
get__free_footprint() {
|
|
||||||
# Free footprint value for php-fpm
|
|
||||||
# Check if current_fpm_footprint is an integer
|
|
||||||
if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null
|
|
||||||
then
|
|
||||||
# If current_fpm_footprint is an integer, that's a numeric value for the footprint
|
|
||||||
echo "$current_fpm_footprint"
|
|
||||||
else
|
|
||||||
echo "0"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC SETTERS FOR TOML SHORT KEYS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
set__maintenance_mode() {
|
|
||||||
if [ "$maintenance_mode" -eq "1" ]; then
|
|
||||||
# If maintenance_mode was set to 1, enable maintenance mode
|
|
||||||
ynh_exec_as "$app" echo "Site under maintenance." > $install_dir/.maintenance
|
|
||||||
ynh_print_info "Maintenance mode enabled"
|
|
||||||
elif [ "$maintenance_mode" -eq "0" ]; then
|
|
||||||
# If maintenance_mode was set to 0, disable maintenance mode
|
|
||||||
ynh_secure_remove --file=$install_dir/.maintenance
|
|
||||||
ynh_print_info "Maintenance mode disabled"
|
|
||||||
fi
|
|
||||||
ynh_app_setting_set --app=$app --key=maintenance_mode --value="$maintenance_mode"
|
|
||||||
}
|
|
||||||
|
|
||||||
set__fpm_footprint() {
|
|
||||||
if [ "$fpm_footprint" != "specific" ]
|
|
||||||
then
|
|
||||||
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_footprint"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
set__fpm_free_footprint() {
|
|
||||||
if [ "$fpm_footprint" = "specific" ]
|
|
||||||
then
|
|
||||||
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_free_footprint"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_app_config_validate() {
|
|
||||||
_ynh_app_config_validate
|
|
||||||
|
|
||||||
if [ "${changed[fpm_usage]}" == "true" ] || [ "${changed[fpm_footprint]}" == "true" ] || [ "${changed[fpm_free_footprint]}" == "true" ]; then
|
|
||||||
# If fpm_footprint is set to 'specific', use $fpm_free_footprint value.
|
|
||||||
if [ "$fpm_footprint" = "specific" ]
|
|
||||||
then
|
|
||||||
fpm_footprint=$fpm_free_footprint
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$fpm_footprint" == "0" ]
|
|
||||||
then
|
|
||||||
ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below."
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
ynh_app_config_apply() {
|
|
||||||
_ynh_app_config_apply
|
|
||||||
|
|
||||||
ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint
|
|
||||||
}
|
|
||||||
|
|
||||||
ynh_app_config_run $1
|
|
Loading…
Add table
Reference in a new issue