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

Upgrade config panel (#158)

* fix pgp home path in a muti-install context

* Update manifest.json

* config panel

* fix

* Update install

* Update upgrade
This commit is contained in:
Éric Gaspar 2022-09-29 23:08:15 +02:00 committed by GitHub
parent 64bb5d2f66
commit 7208b741ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 15 deletions

View file

@ -14,7 +14,7 @@ $config['enigma_debug'] = false;
// REQUIRED! Keys directory for all users.
// Must be writeable by PHP process, and not in the web server document root
$config['enigma_pgp_homedir'] = '__FINALPATH__/plugins/enigma/home';
$config['enigma_pgp_homedir'] = '/var/www/__APP__/plugins/enigma/home';
// Location of gpg binary. By default it will be auto-detected.
// This is also a way to force gpg2 use if there are both 1.x and 2.x on the system.

View file

@ -7,19 +7,24 @@ name = "Roundcube configuration"
name = "PHP-FPM configuration"
[main.php_fpm_config.fpm_footprint]
ask = "Memory footprint of the service?"
choices = ["low", "medium", "high", "specific"]
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"
help = "low <= 20Mb per pool. medium between 20Mb and 40Mb per pool. high > 40Mb per pool.<br>Use specific to set a value with the following option."
[main.php_fpm_config.free_footprint]
[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 of the service?"
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."
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."

View file

@ -6,7 +6,7 @@
"en": "Open Source Webmail software",
"fr": "Webmail Open Source"
},
"version": "1.6.0~ynh2",
"version": "1.6.0~ynh3",
"url": "https://roundcube.net/",
"upstream": {
"license": "GPL-3.0-only",

View file

@ -56,10 +56,10 @@ set__fpm_footprint() {
fi
}
set__free_footprint() {
set__fpm_free_footprint() {
if [ "$fpm_footprint" = "specific" ]
then
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$free_footprint"
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_free_footprint"
fi
}
@ -70,11 +70,11 @@ set__free_footprint() {
ynh_app_config_validate() {
_ynh_app_config_validate
if [ "${changed[fpm_usage]}" == "true" ] || [ "${changed[fpm_footprint]}" == "true" ] || [ "${changed[free_footprint]}" == "true" ]; then
# If fpm_footprint is set to 'specific', use $free_footprint value.
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=$free_footprint
fpm_footprint=$fpm_free_footprint
fi
if [ "$fpm_footprint" == "0" ]

View file

@ -27,6 +27,10 @@ language=$YNH_APP_ARG_LANGUAGE
app=$YNH_APP_INSTANCE_NAME
fpm_footprint="low"
fpm_free_footprint=0
fpm_usage="low"
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
@ -47,6 +51,9 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=with_carddav --value=$with_carddav
ynh_app_setting_set --app=$app --key=language --value=$language
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
#=================================================
# STANDARD MODIFICATIONS
@ -101,8 +108,8 @@ ynh_add_nginx_config
#=================================================
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=low --footprint=low
# Create a dedicated php-fpm config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================

View file

@ -27,6 +27,7 @@ language=$(ynh_app_setting_get --app=$app --key=language)
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint)
fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
#=================================================
@ -89,6 +90,12 @@ if [ -z "$fpm_footprint" ]; then
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
fi
# If fpm_free_footprint doesn't exist, create it
if [ -z "$fpm_free_footprint" ]; then
fpm_free_footprint=0
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
fi
# If fpm_usage doesn't exist, create it
if [ -z "$fpm_usage" ]; then
fpm_usage=low