mirror of
https://github.com/YunoHost-Apps/jenkins_ynh.git
synced 2024-09-03 19:26:18 +02:00
Fix config panel
This commit is contained in:
parent
45ff482d2b
commit
c5475035b3
2 changed files with 6 additions and 29 deletions
|
@ -6,19 +6,8 @@ name = "Jenkins configuration"
|
||||||
[main.overwrite_files]
|
[main.overwrite_files]
|
||||||
name = "Overwriting config files"
|
name = "Overwriting config files"
|
||||||
|
|
||||||
[main.overwrite_files.overwrite_nginx]
|
[main.overwrite_files.overwrite_nginx]
|
||||||
ask = "Overwrite the NGINX config file?"
|
ask = "Overwrite the NGINX config file?"
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
default = true
|
default = true
|
||||||
help = "If the file is overwritten, a backup will be created."
|
help = "If the file is overwritten, a backup will be created."
|
||||||
|
|
||||||
|
|
||||||
[main.global_config]
|
|
||||||
name = "Global configuration"
|
|
||||||
|
|
||||||
[main.global_config.email_type]
|
|
||||||
ask = "Send HTML email to admin?"
|
|
||||||
type = "boolean"
|
|
||||||
default = true
|
|
||||||
help = "Allow app scripts to send HTML mails instead of plain text."
|
|
||||||
|
|
|
@ -17,15 +17,10 @@ source /usr/share/yunohost/helpers
|
||||||
# Otherwise, keep the value from the app config.
|
# Otherwise, keep the value from the app config.
|
||||||
|
|
||||||
# Overwrite nginx configuration
|
# Overwrite nginx configuration
|
||||||
old_overwrite_nginx="$(ynh_app_setting_get --app=$app --key=overwrite_nginx)"
|
old_overwrite_nginx="$(ynh_app_setting_get --app="$app" --key="overwrite_nginx")"
|
||||||
old_overwrite_nginx=$(b01_to_bool $old_overwrite_nginx)
|
old_overwrite_nginx=$(b01_to_bool "$old_overwrite_nginx")
|
||||||
overwrite_nginx="${YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX:-$old_overwrite_nginx}"
|
overwrite_nginx="${YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX:-$old_overwrite_nginx}"
|
||||||
|
|
||||||
# Type of admin mail configuration
|
|
||||||
old_admin_mail_html="$(ynh_app_setting_get --app=$app --key=admin_mail_html)"
|
|
||||||
old_admin_mail_html=$(b01_to_bool $old_admin_mail_html)
|
|
||||||
admin_mail_html="${YNH_CONFIG_MAIN_GLOBAL_CONFIG_EMAIL_TYPE:-$old_admin_mail_html}"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SHOW_CONFIG FUNCTION FOR 'SHOW' COMMAND
|
# SHOW_CONFIG FUNCTION FOR 'SHOW' COMMAND
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -35,8 +30,6 @@ show_config() {
|
||||||
# echo "YNH_CONFIG_${PANEL_ID}_${SECTION_ID}_${OPTION_ID}=value"
|
# echo "YNH_CONFIG_${PANEL_ID}_${SECTION_ID}_${OPTION_ID}=value"
|
||||||
|
|
||||||
echo "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX=$overwrite_nginx"
|
echo "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX=$overwrite_nginx"
|
||||||
|
|
||||||
echo "YNH_CONFIG_MAIN_GLOBAL_CONFIG_EMAIL_TYPE=$admin_mail_html"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -44,17 +37,12 @@ show_config() {
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
apply_config() {
|
apply_config() {
|
||||||
|
|
||||||
# Set overwrite_nginx
|
# Set overwrite_nginx
|
||||||
overwrite_nginx=$(bool_to_01 $overwrite_nginx)
|
overwrite_nginx=$(bool_to_01 "$overwrite_nginx")
|
||||||
ynh_app_setting_set --app=$app --key=overwrite_nginx --value="$overwrite_nginx"
|
ynh_app_setting_set --app="$app" --key=overwrite_nginx --value="$overwrite_nginx"
|
||||||
|
|
||||||
# Set admin_mail_html
|
|
||||||
admin_mail_html=$(bool_to_01 $admin_mail_html)
|
|
||||||
ynh_app_setting_set --app=$app --key=admin_mail_html --value="$admin_mail_html"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_app_config_run $1
|
ynh_app_config_run "$1"
|
||||||
|
|
Loading…
Add table
Reference in a new issue