1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/grocy_ynh.git synced 2024-09-03 19:25:54 +02:00
grocy_ynh/scripts/config

96 lines
2.7 KiB
Text
Raw Normal View History

2021-12-09 11:50:09 +01:00
#!/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__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__fpm_footprint() {
if [ "$fpm_footprint" != "specific" ]
then
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_footprint"
fi
}
Testing (#46) * Upgrade to v.3.0.0 * Fix * Fix * Add README_fr * Fix * Update nginx.conf * Fix * Update manifest.json * Update upgrade * Update upgrade * Remove service * Update upgrade * Update config-dist.php * Remove path * Update README_fr.md * Update README_fr.md * Upgrade to 3.0.1 (#4) * Upgrade to 3.0.1 * 3.0.1 (#7) * Upgrade to 3.0.1 * Update manifest.json * add pull request * Cleaning up * Update manifest.json * Cleaning up * Fix * Fix path * Fix * Fix permissions * [autopatch] Update issue and PR templates (#11) * Testing (#9) * Cleaning up * [autopatch] Update issue and PR templates Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> * Fix * [autopatch] Update issue and PR templates (#12) * Testing (#9) * Cleaning up * [autopatch] Update issue and PR templates Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> * Add headers (#13) * Cleaning up * Update manifest.json * 3.1.0 (#15) * 3.1.0 * Fix * Auto-update README * Fix * Auto-update README * Set client_max_body_size to 50M * Update manifest.json * Auto-update README * Update manifest.json * 3.1.1 * Auto-update README * Fix * Update manifest.json * Upgrade 3.1.2 (#20) * Auto-update README * Add mbstring * Update manifest.json * Auto-update README * 3.1.3 (#24) * 3.1.3 * Allow api (#27) * Allow API * Update upgrade * Update scripts/upgrade Co-authored-by: tituspijean <tituspijean@outlook.com> Co-authored-by: tituspijean <tituspijean@outlook.com> * Update manifest.json * Auto-update README * remove https * Update DESCRIPTION.md * Auto-update README * Add config panel * Ericgaspar patch 1 (#30) * Testing (#28) * Allow API * Create updater.yml * Auto-update README * Update upgrade * Fix * Auto-update README * version bump * Auto-update README * 3.2.0 * Auto-update README * Update manifest.json * Update manifest.json * Upgrade to v3.2.0 (#36) Co-authored-by: yunohost-bot <yunohost-bot@users.noreply.github.com> * Update nginx.conf * 3.3.0 * Auto-update README * Update _common.sh * Update upgrade * Update config-dist.php * Update nginx.conf * Update check_process * Update _common.sh * 3.3.1 * Auto-update README * Auto-update README * Update manifest.json * Update upgrade * Update upgrade * Update manifest.json * Auto-update README * 3.3.2 * Auto-update README * add PHP * fix * Update manifest.json * Auto-update README Co-authored-by: YunoHost Bot <yunohost-bot@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> Co-authored-by: tituspijean <tituspijean@outlook.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: yalh76 <yalh@yahoo.com>
2023-01-12 09:28:16 +01:00
set__fpm_free_footprint() {
if [ "$fpm_footprint" = "specific" ]
2021-12-09 11:50:09 +01:00
then
Testing (#46) * Upgrade to v.3.0.0 * Fix * Fix * Add README_fr * Fix * Update nginx.conf * Fix * Update manifest.json * Update upgrade * Update upgrade * Remove service * Update upgrade * Update config-dist.php * Remove path * Update README_fr.md * Update README_fr.md * Upgrade to 3.0.1 (#4) * Upgrade to 3.0.1 * 3.0.1 (#7) * Upgrade to 3.0.1 * Update manifest.json * add pull request * Cleaning up * Update manifest.json * Cleaning up * Fix * Fix path * Fix * Fix permissions * [autopatch] Update issue and PR templates (#11) * Testing (#9) * Cleaning up * [autopatch] Update issue and PR templates Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> * Fix * [autopatch] Update issue and PR templates (#12) * Testing (#9) * Cleaning up * [autopatch] Update issue and PR templates Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> * Add headers (#13) * Cleaning up * Update manifest.json * 3.1.0 (#15) * 3.1.0 * Fix * Auto-update README * Fix * Auto-update README * Set client_max_body_size to 50M * Update manifest.json * Auto-update README * Update manifest.json * 3.1.1 * Auto-update README * Fix * Update manifest.json * Upgrade 3.1.2 (#20) * Auto-update README * Add mbstring * Update manifest.json * Auto-update README * 3.1.3 (#24) * 3.1.3 * Allow api (#27) * Allow API * Update upgrade * Update scripts/upgrade Co-authored-by: tituspijean <tituspijean@outlook.com> Co-authored-by: tituspijean <tituspijean@outlook.com> * Update manifest.json * Auto-update README * remove https * Update DESCRIPTION.md * Auto-update README * Add config panel * Ericgaspar patch 1 (#30) * Testing (#28) * Allow API * Create updater.yml * Auto-update README * Update upgrade * Fix * Auto-update README * version bump * Auto-update README * 3.2.0 * Auto-update README * Update manifest.json * Update manifest.json * Upgrade to v3.2.0 (#36) Co-authored-by: yunohost-bot <yunohost-bot@users.noreply.github.com> * Update nginx.conf * 3.3.0 * Auto-update README * Update _common.sh * Update upgrade * Update config-dist.php * Update nginx.conf * Update check_process * Update _common.sh * 3.3.1 * Auto-update README * Auto-update README * Update manifest.json * Update upgrade * Update upgrade * Update manifest.json * Auto-update README * 3.3.2 * Auto-update README * add PHP * fix * Update manifest.json * Auto-update README Co-authored-by: YunoHost Bot <yunohost-bot@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> Co-authored-by: tituspijean <tituspijean@outlook.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: yalh76 <yalh@yahoo.com>
2023-01-12 09:28:16 +01:00
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_free_footprint"
2021-12-09 11:50:09 +01:00
fi
}
#=================================================
# GENERIC FINALIZATION
#=================================================
ynh_app_config_validate() {
_ynh_app_config_validate
Testing (#46) * Upgrade to v.3.0.0 * Fix * Fix * Add README_fr * Fix * Update nginx.conf * Fix * Update manifest.json * Update upgrade * Update upgrade * Remove service * Update upgrade * Update config-dist.php * Remove path * Update README_fr.md * Update README_fr.md * Upgrade to 3.0.1 (#4) * Upgrade to 3.0.1 * 3.0.1 (#7) * Upgrade to 3.0.1 * Update manifest.json * add pull request * Cleaning up * Update manifest.json * Cleaning up * Fix * Fix path * Fix * Fix permissions * [autopatch] Update issue and PR templates (#11) * Testing (#9) * Cleaning up * [autopatch] Update issue and PR templates Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> * Fix * [autopatch] Update issue and PR templates (#12) * Testing (#9) * Cleaning up * [autopatch] Update issue and PR templates Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> * Add headers (#13) * Cleaning up * Update manifest.json * 3.1.0 (#15) * 3.1.0 * Fix * Auto-update README * Fix * Auto-update README * Set client_max_body_size to 50M * Update manifest.json * Auto-update README * Update manifest.json * 3.1.1 * Auto-update README * Fix * Update manifest.json * Upgrade 3.1.2 (#20) * Auto-update README * Add mbstring * Update manifest.json * Auto-update README * 3.1.3 (#24) * 3.1.3 * Allow api (#27) * Allow API * Update upgrade * Update scripts/upgrade Co-authored-by: tituspijean <tituspijean@outlook.com> Co-authored-by: tituspijean <tituspijean@outlook.com> * Update manifest.json * Auto-update README * remove https * Update DESCRIPTION.md * Auto-update README * Add config panel * Ericgaspar patch 1 (#30) * Testing (#28) * Allow API * Create updater.yml * Auto-update README * Update upgrade * Fix * Auto-update README * version bump * Auto-update README * 3.2.0 * Auto-update README * Update manifest.json * Update manifest.json * Upgrade to v3.2.0 (#36) Co-authored-by: yunohost-bot <yunohost-bot@users.noreply.github.com> * Update nginx.conf * 3.3.0 * Auto-update README * Update _common.sh * Update upgrade * Update config-dist.php * Update nginx.conf * Update check_process * Update _common.sh * 3.3.1 * Auto-update README * Auto-update README * Update manifest.json * Update upgrade * Update upgrade * Update manifest.json * Auto-update README * 3.3.2 * Auto-update README * add PHP * fix * Update manifest.json * Auto-update README Co-authored-by: YunoHost Bot <yunohost-bot@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> Co-authored-by: tituspijean <tituspijean@outlook.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: yalh76 <yalh@yahoo.com>
2023-01-12 09:28:16 +01:00
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" ]
2021-12-09 11:50:09 +01:00
then
Testing (#46) * Upgrade to v.3.0.0 * Fix * Fix * Add README_fr * Fix * Update nginx.conf * Fix * Update manifest.json * Update upgrade * Update upgrade * Remove service * Update upgrade * Update config-dist.php * Remove path * Update README_fr.md * Update README_fr.md * Upgrade to 3.0.1 (#4) * Upgrade to 3.0.1 * 3.0.1 (#7) * Upgrade to 3.0.1 * Update manifest.json * add pull request * Cleaning up * Update manifest.json * Cleaning up * Fix * Fix path * Fix * Fix permissions * [autopatch] Update issue and PR templates (#11) * Testing (#9) * Cleaning up * [autopatch] Update issue and PR templates Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> * Fix * [autopatch] Update issue and PR templates (#12) * Testing (#9) * Cleaning up * [autopatch] Update issue and PR templates Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> * Add headers (#13) * Cleaning up * Update manifest.json * 3.1.0 (#15) * 3.1.0 * Fix * Auto-update README * Fix * Auto-update README * Set client_max_body_size to 50M * Update manifest.json * Auto-update README * Update manifest.json * 3.1.1 * Auto-update README * Fix * Update manifest.json * Upgrade 3.1.2 (#20) * Auto-update README * Add mbstring * Update manifest.json * Auto-update README * 3.1.3 (#24) * 3.1.3 * Allow api (#27) * Allow API * Update upgrade * Update scripts/upgrade Co-authored-by: tituspijean <tituspijean@outlook.com> Co-authored-by: tituspijean <tituspijean@outlook.com> * Update manifest.json * Auto-update README * remove https * Update DESCRIPTION.md * Auto-update README * Add config panel * Ericgaspar patch 1 (#30) * Testing (#28) * Allow API * Create updater.yml * Auto-update README * Update upgrade * Fix * Auto-update README * version bump * Auto-update README * 3.2.0 * Auto-update README * Update manifest.json * Update manifest.json * Upgrade to v3.2.0 (#36) Co-authored-by: yunohost-bot <yunohost-bot@users.noreply.github.com> * Update nginx.conf * 3.3.0 * Auto-update README * Update _common.sh * Update upgrade * Update config-dist.php * Update nginx.conf * Update check_process * Update _common.sh * 3.3.1 * Auto-update README * Auto-update README * Update manifest.json * Update upgrade * Update upgrade * Update manifest.json * Auto-update README * 3.3.2 * Auto-update README * add PHP * fix * Update manifest.json * Auto-update README Co-authored-by: YunoHost Bot <yunohost-bot@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> Co-authored-by: tituspijean <tituspijean@outlook.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: yalh76 <yalh@yahoo.com>
2023-01-12 09:28:16 +01:00
fpm_footprint=$fpm_free_footprint
2021-12-09 11:50:09 +01:00
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