mirror of
https://github.com/YunoHost-Apps/leed_ynh.git
synced 2024-09-03 19:26:32 +02:00
Merge pull request #49 from YunoHost-Apps/drop_config_panel
Drop config panel
This commit is contained in:
commit
fed3add159
5 changed files with 0 additions and 463 deletions
53
CHANGELOG.md
53
CHANGELOG.md
|
@ -1,53 +0,0 @@
|
||||||
Changelog
|
|
||||||
=========
|
|
||||||
|
|
||||||
## Unreleased
|
|
||||||
- Nothing for now...
|
|
||||||
|
|
||||||
## [1.8.3~ynh7](https://github.com/YunoHost-Apps/leed_ynh/pull/18) - 2019-03-12
|
|
||||||
|
|
||||||
#### Changed
|
|
||||||
- [Normalization from example_ynh](https://github.com/YunoHost-Apps/leed_ynh/commit/1418b13ff9c3d2f1849ad21b5c645609e3bea863)
|
|
||||||
|
|
||||||
|
|
||||||
## [1.8.3~ynh6](https://github.com/YunoHost-Apps/leed_ynh/pull/17) - 2019-02-03
|
|
||||||
|
|
||||||
#### Added
|
|
||||||
- [Add progression bar](https://github.com/YunoHost-Apps/leed_ynh/commit/9085643892836479b8c33bba6f5054512e4d441f)
|
|
||||||
* [Changelog & ahtml email](https://github.com/YunoHost-Apps/leed_ynh/commit/298f9ebf5767be9c6e163708cc69121a67aca1ed)
|
|
||||||
|
|
||||||
#### Changed
|
|
||||||
- [Update php and nginx conf files to php7](https://github.com/YunoHost-Apps/leed_ynh/commit/1b1b0a4b906edb03a38262f9a63d9d72742480cd)
|
|
||||||
|
|
||||||
|
|
||||||
## [1.8.3~ynh5](https://github.com/YunoHost-Apps/leed_ynh/pull/16) - 2019-01-21
|
|
||||||
|
|
||||||
#### Added
|
|
||||||
- [Advertise config-panel and actions](https://github.com/YunoHost-Apps/leed_ynh/commit/c725a8e6b529d2e595022f860de58bd091390a0b)
|
|
||||||
|
|
||||||
#### Changed
|
|
||||||
- [Update to last standart](https://github.com/YunoHost-Apps/leed_ynh/commit/92d36df30a9ea32a6c9e8a0dfa1f406fe7a49be3)
|
|
||||||
|
|
||||||
|
|
||||||
## [1.8.3~ynh4](https://github.com/YunoHost-Apps/leed_ynh/pull/15) - 2018-09-30
|
|
||||||
|
|
||||||
#### Added
|
|
||||||
* [Add Panel-config and actions](https://github.com/YunoHost-Apps/leed_ynh/commit/83253f60ff31f0ac7a4fe29e80e79c0cebbd3ad1)
|
|
||||||
|
|
||||||
|
|
||||||
## [1.8.3~ynh4](https://github.com/YunoHost-Apps/leed_ynh/pull/14) - 2018-08-05
|
|
||||||
|
|
||||||
#### Fixed
|
|
||||||
- [Fix fail2ban helper](https://github.com/YunoHost-Apps/leed_ynh/commit/c4b966ff2a977b8c0923d4f8ad403d86454883cb)
|
|
||||||
|
|
||||||
|
|
||||||
## [1.8.3~ynh4](https://github.com/YunoHost-Apps/leed_ynh/pull/13) - 2018-07-16
|
|
||||||
|
|
||||||
#### Changed
|
|
||||||
- [Upgrade helpers](https://github.com/YunoHost-Apps/leed_ynh/commit/5cb8744ee1145971518328b242edd68b7ec1310c)
|
|
||||||
|
|
||||||
|
|
||||||
## [1.8.3~ynh3](https://github.com/YunoHost-Apps/leed_ynh/pull/11) - 2018-03-14
|
|
||||||
|
|
||||||
#### Changed
|
|
||||||
- [Update helpers](https://github.com/YunoHost-Apps/leed_ynh/commit/1952ec18681135ecd13d32e53ecf86684ad1ff29)
|
|
117
YEP.md
117
YEP.md
|
@ -1,117 +0,0 @@
|
||||||
#### [Level 0](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-0)
|
|
||||||
[YEP 1.1 - Nommer son app et son dépot](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
|
|
||||||
`Validated`
|
|
||||||
[YEP 1.2 - Inscrire l'app sur un "répertoire" connu](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-12)
|
|
||||||
`Validated`
|
|
||||||
|
|
||||||
#### [Level 1](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-1)
|
|
||||||
[YEP 2.2 - Utiliser bash pour les scripts principaux](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-22)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.5 - Copier correctement des fichiers](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-25)
|
|
||||||
`Don't know`
|
|
||||||
[YEP 2.7 - Donner des permissions suffisantes aux instructions bash](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-27)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.15 - Suivre les instructions d'installation de l'application](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-215)
|
|
||||||
`Validated`
|
|
||||||
|
|
||||||
#### [Level 2](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-2)
|
|
||||||
[YEP 1.5 - Mettre à jour régulièrement le statut de l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.18.2 - Gérer l'installation à la racine d’un nom de domaine](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2182)
|
|
||||||
`Validated` - *Automatically verified.*
|
|
||||||
[YEP 2.18.3 - Gérer l'installation sur un sous-domaine](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2183)
|
|
||||||
`Validated` - *Automatically verified.*
|
|
||||||
[YEP 2.18.4 - Gérer l'installation sur un chemin /path](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2184)
|
|
||||||
`Validated` - *Automatically verified.*
|
|
||||||
[YEP 4.6 - Gère le multi-instance](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
|
|
||||||
`Validated` - *Automatically verified.*
|
|
||||||
|
|
||||||
#### [Level 3](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-3)
|
|
||||||
[YEP 2.3 - Sauvegarder les réponses lors de l'installation](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-23)
|
|
||||||
`Validated`
|
|
||||||
|
|
||||||
#### [Level 4](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-4)
|
|
||||||
[YEP 4.1 - Lier au ldap](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-41)
|
|
||||||
`Validated`
|
|
||||||
[YEP 4.2 - Lier l'authentification au sso](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-42)
|
|
||||||
`Validated`
|
|
||||||
|
|
||||||
#### [Level 5](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-5)
|
|
||||||
[YEP 1.3 - Indiquer la licence associée au paquet](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-13)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.1 - Respecter le format du manifeste](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-21)
|
|
||||||
`Validated` - *Automatically verified.*
|
|
||||||
[YEP 2.12 - Utiliser les commandes pratiques (helpers)](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-212)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.18.1 - Lancer le script d'installation d'une webapp correctement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2181)
|
|
||||||
`Validated`
|
|
||||||
|
|
||||||
#### [Level 6](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-6)
|
|
||||||
[YEP 1.4 - Informer sur l'intention de maintenir un paquet](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-14)
|
|
||||||
`Validated`
|
|
||||||
[YEP 1.6 - Se tenir informé sur l'évolution du packaging d'apps](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-16)
|
|
||||||
`Validated`
|
|
||||||
[YEP 1.7 - Ajouter l'app à l'organisation YunoHost-Apps](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-17)
|
|
||||||
`Validated` - *Automatically verified.*
|
|
||||||
[YEP 1.8 - Publier des demandes de test](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-18)
|
|
||||||
`Validated`
|
|
||||||
[YEP 1.9 - Documenter l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-19)
|
|
||||||
`Validated`
|
|
||||||
[YEP 1.10 - Garder un historique de version propre](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-110)
|
|
||||||
`Don't know`
|
|
||||||
[YEP 2.9 - Enlever toutes traces de l'app lors de la suppression](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-29)
|
|
||||||
`Validated`
|
|
||||||
[YEP 3.3 - Faciliter le contrôle de l'intégrité des sources](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-33)
|
|
||||||
`Validated`
|
|
||||||
[YEP 3.5 - Suivre les recommendations de la documentation de l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-35)
|
|
||||||
`Validated`
|
|
||||||
[YEP 3.6 - Mettre à jour les versions contenant des CVE](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-36)
|
|
||||||
`Validated`
|
|
||||||
[YEP 4.3 - Fournir un script de sauvegarde YunoHost fonctionnel](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-43)
|
|
||||||
`Validated` - *Automatically verified.*
|
|
||||||
[YEP 4.4 - Fournir un script de restauration YunoHost fonctionnel](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-44)
|
|
||||||
`Validated` - *Automatically verified.*
|
|
||||||
|
|
||||||
#### [Level 7](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-7)
|
|
||||||
[YEP 2.6 - Annuler l'action si les valeurs d'entrées sont incorrectes](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-26)
|
|
||||||
`Validated`
|
|
||||||
[YEP 3.2 - Ouvrir un port correctement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-32)
|
|
||||||
`Not applicable`
|
|
||||||
|
|
||||||
#### [Level 8](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-8)
|
|
||||||
[YEP 2.4 - Détecter et gérer les erreurs](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-24)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.8 - Modifier correctement une configuration système](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-28)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.16 - Vérifier la disponibilité des dépendances sur ARM, x86 et x64](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-216)
|
|
||||||
`Not yet validated` - *Automatically verified.*
|
|
||||||
[YEP 2.18.5 - Gérer la tuile YunoHost pour faciliter la navigation entre les applications](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2185)
|
|
||||||
`Validated`
|
|
||||||
[YEP 3.4 - Isoler l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-34)
|
|
||||||
`Partially validated`
|
|
||||||
[YEP 4.5 - Utiliser les hooks](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-45)
|
|
||||||
`Not applicable`
|
|
||||||
|
|
||||||
#### [Level 9](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-9)
|
|
||||||
[YEP 2.10 - Configurer les logs de l'application](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-210)
|
|
||||||
`Not applicable`
|
|
||||||
[YEP 2.11 - Utiliser une variable plutôt que l'app id directement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-211)
|
|
||||||
`Validated`
|
|
||||||
[YEP 2.13 - Traduire le paquet en anglais](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-213)
|
|
||||||
`Not yet validated`
|
|
||||||
[YEP 2.14 - Remplir correctement un fichier de conf](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-214)
|
|
||||||
`Not yet validated`
|
|
||||||
[YEP 2.17 - Prendre en compte la version d'origine lors des mises à jour](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-217)
|
|
||||||
`Validated`
|
|
||||||
[YEP 4.2.1 - Déconnexion](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-421)
|
|
||||||
`Don't know`
|
|
||||||
|
|
||||||
#### Other YEP
|
|
||||||
[YEP 3.1 - Ne pas demander ou stocker de mot de passe LDAP](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-31)
|
|
||||||
`Validated`
|
|
||||||
[YEP 4.7 - Ajouter un module à la CLI](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-47)
|
|
||||||
`Not applicable`
|
|
||||||
[YEP 4.8 - Ajouter un module à l'admin web](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-48)
|
|
||||||
`Not applicable`
|
|
||||||
|
|
||||||
State of each YEP can be one of these: `Validated`, `Partially validated`, `Not yet validated`, `Not applicable`, `Don't know`.
|
|
|
@ -1,61 +0,0 @@
|
||||||
version = "1.0"
|
|
||||||
|
|
||||||
[main]
|
|
||||||
name = "Leed configuration"
|
|
||||||
|
|
||||||
[main.is_public]
|
|
||||||
name = "Public access"
|
|
||||||
|
|
||||||
[main.is_public.is_public]
|
|
||||||
ask = "Is it a public website?"
|
|
||||||
type = "boolean"
|
|
||||||
default = true
|
|
||||||
help = "A public Leed will be accessible for third party apps.<br>By turning on 'anonymous readers' in Leed configuration, you can made your feeds public."
|
|
||||||
|
|
||||||
|
|
||||||
[main.overwrite_files]
|
|
||||||
name = "Overwriting config files"
|
|
||||||
|
|
||||||
[main.overwrite_files.overwrite_nginx]
|
|
||||||
ask = "Overwrite the nginx config file?"
|
|
||||||
type = "boolean"
|
|
||||||
default = true
|
|
||||||
help = "If the file is overwritten, a backup will be created."
|
|
||||||
|
|
||||||
[main.overwrite_files.overwrite_phpfpm]
|
|
||||||
ask = "Overwrite the php-fpm config file?"
|
|
||||||
type = "boolean"
|
|
||||||
default = true
|
|
||||||
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."
|
|
||||||
|
|
||||||
|
|
||||||
[main.php_fpm_config]
|
|
||||||
name = "PHP-FPM configuration"
|
|
||||||
|
|
||||||
[main.php_fpm_config.footprint]
|
|
||||||
ask = "Memory footprint of the service?"
|
|
||||||
choices = ["low", "medium", "high", "specific"]
|
|
||||||
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]
|
|
||||||
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.usage]
|
|
||||||
ask = "Expected usage of the service?"
|
|
||||||
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."
|
|
|
@ -1,84 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC STARTING
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source scripts/_common.sh
|
|
||||||
source /usr/share/yunohost/helpers
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# MANAGE SCRIPT FAILURE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RETRIEVE ARGUMENTS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Get is_public
|
|
||||||
is_public=${YNH_ACTION_IS_PUBLIC}
|
|
||||||
|
|
||||||
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID}
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CHECK IF ARGUMENTS ARE CORRECT
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CHECK IF AN ACTION HAS TO BE DONE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
is_public_old=$(ynh_app_setting_get --app=$app --key=is_public)
|
|
||||||
|
|
||||||
if [ $is_public -eq $is_public_old ]
|
|
||||||
then
|
|
||||||
ynh_die --message="is_public is already set as $is_public." --ret_code=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC ACTION
|
|
||||||
#=================================================
|
|
||||||
# MOVE TO PUBLIC OR PRIVATE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
if [ $is_public -eq 0 ]; then
|
|
||||||
public_private="private"
|
|
||||||
else
|
|
||||||
public_private="public"
|
|
||||||
fi
|
|
||||||
ynh_script_progression --message="Moving the application to $public_private..." --weight=3
|
|
||||||
|
|
||||||
if [ $is_public -eq 0 ]
|
|
||||||
then
|
|
||||||
ynh_app_setting_delete --app=$app --key=unprotected_uris
|
|
||||||
# Set the action.php script public for the cron task
|
|
||||||
ynh_app_setting_set --app=$app --key=skipped_uris --value="/action.php"
|
|
||||||
else
|
|
||||||
ynh_app_setting_delete --app=$app --key=skipped_uris
|
|
||||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
|
||||||
fi
|
|
||||||
|
|
||||||
ynh_script_progression --message="Upgrading SSOwat configuration..."
|
|
||||||
# Regen ssowat configuration
|
|
||||||
yunohost app ssowatconf
|
|
||||||
|
|
||||||
# Update the config of the app
|
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RELOAD NGINX
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reloading nginx web server..."
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# END OF SCRIPT
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_script_progression --message="Execution completed" --last
|
|
148
scripts/config
148
scripts/config
|
@ -1,148 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC STARTING
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source _common.sh
|
|
||||||
source /usr/share/yunohost/helpers
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RETRIEVE ARGUMENTS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID}
|
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD VALUES
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Load the real value from the app config or elsewhere.
|
|
||||||
# Then get the value from the form.
|
|
||||||
# If the form has a value for a variable, take the value from the form,
|
|
||||||
# Otherwise, keep the value from the app config.
|
|
||||||
|
|
||||||
# is_public
|
|
||||||
old_is_public="$(ynh_app_setting_get --app=$app --key=is_public)"
|
|
||||||
is_public="${YNH_CONFIG_MAIN_IS_PUBLIC_IS_PUBLIC:-$old_is_public}"
|
|
||||||
|
|
||||||
# Overwrite nginx configuration
|
|
||||||
old_overwrite_nginx="$(ynh_app_setting_get --app=$app --key=overwrite_nginx)"
|
|
||||||
overwrite_nginx="${YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX:-$old_overwrite_nginx}"
|
|
||||||
|
|
||||||
# Overwrite php-fpm configuration
|
|
||||||
old_overwrite_phpfpm="$(ynh_app_setting_get --app=$app --key=overwrite_phpfpm)"
|
|
||||||
overwrite_phpfpm="${YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_PHPFPM:-$old_overwrite_phpfpm}"
|
|
||||||
|
|
||||||
|
|
||||||
# Type of admin mail configuration
|
|
||||||
old_admin_mail_html="$(ynh_app_setting_get --app=$app --key=admin_mail_html)"
|
|
||||||
admin_mail_html="${YNH_CONFIG_MAIN_GLOBAL_CONFIG_EMAIL_TYPE:-$old_admin_mail_html}"
|
|
||||||
|
|
||||||
|
|
||||||
# Footprint for php-fpm
|
|
||||||
old_fpm_footprint="$(ynh_app_setting_get --app=$app --key=fpm_footprint)"
|
|
||||||
fpm_footprint="${YNH_CONFIG_MAIN_PHP_FPM_CONFIG_FOOTPRINT:-$old_fpm_footprint}"
|
|
||||||
|
|
||||||
# Free footprint value for php-fpm
|
|
||||||
# Check if fpm_footprint is an integer
|
|
||||||
if [ "$fpm_footprint" -eq "$fpm_footprint" ] 2> /dev/null
|
|
||||||
then
|
|
||||||
# If fpm_footprint is an integer, that's a numeric value for the footprint
|
|
||||||
old_free_footprint=$fpm_footprint
|
|
||||||
fpm_footprint=specific
|
|
||||||
else
|
|
||||||
old_free_footprint=0
|
|
||||||
fi
|
|
||||||
free_footprint="${YNH_CONFIG_MAIN_PHP_FPM_CONFIG_FREE_FOOTPRINT:-$old_free_footprint}"
|
|
||||||
|
|
||||||
# Usage for php-fpm
|
|
||||||
old_fpm_usage="$(ynh_app_setting_get --app=$app --key=fpm_usage)"
|
|
||||||
fpm_usage="${YNH_CONFIG_MAIN_PHP_FPM_CONFIG_USAGE:-$old_fpm_usage}"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SHOW_CONFIG FUNCTION FOR 'SHOW' COMMAND
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
show_config() {
|
|
||||||
# here you are supposed to read some config file/database/other then print the values
|
|
||||||
# ynh_return "YNH_CONFIG_${PANEL_ID}_${SECTION_ID}_${OPTION_ID}=value"
|
|
||||||
|
|
||||||
ynh_return "YNH_CONFIG_MAIN_IS_PUBLIC_IS_PUBLIC=$is_public"
|
|
||||||
|
|
||||||
ynh_return "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX=$overwrite_nginx"
|
|
||||||
ynh_return "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_PHPFPM=$overwrite_phpfpm"
|
|
||||||
|
|
||||||
ynh_return "YNH_CONFIG_MAIN_GLOBAL_CONFIG_EMAIL_TYPE=$admin_mail_html"
|
|
||||||
|
|
||||||
ynh_return "YNH_CONFIG_MAIN_PHP_FPM_CONFIG_FOOTPRINT=$fpm_footprint"
|
|
||||||
ynh_return "YNH_CONFIG_MAIN_PHP_FPM_CONFIG_FREE_FOOTPRINT=$free_footprint"
|
|
||||||
ynh_return "YNH_CONFIG_MAIN_PHP_FPM_CONFIG_USAGE=$fpm_usage"
|
|
||||||
}
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# MODIFY THE CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
apply_config() {
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# MODIFY PUBLIC ACCESSIBILITY
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Change public accessibility
|
|
||||||
if [ "$is_public" != "$old_is_public" ]
|
|
||||||
then
|
|
||||||
if [ "$is_public" = "1" ]
|
|
||||||
then
|
|
||||||
yunohost app action run $app public_private --args is_public=1
|
|
||||||
else
|
|
||||||
yunohost app action run $app public_private --args is_public=0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# MODIFY OVERWRITTING SETTINGS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Set overwrite_nginx
|
|
||||||
ynh_app_setting_set --app=$app --key=overwrite_nginx --value="$overwrite_nginx"
|
|
||||||
# Set overwrite_phpfpm
|
|
||||||
ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value="$overwrite_phpfpm"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# MODIFY EMAIL SETTING
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Set admin_mail_html
|
|
||||||
ynh_app_setting_set --app=$app --key=admin_mail_html --value="$admin_mail_html"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RECONFIGURE PHP-FPM
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
if [ "$fpm_usage" != "$old_fpm_usage" ] || [ "$fpm_footprint" != "$old_fpm_footprint" ] || [ "$free_footprint" != "$old_free_footprint" ]
|
|
||||||
then
|
|
||||||
# If fpm_footprint is set to 'specific', use $free_footprint value.
|
|
||||||
if [ "$fpm_footprint" = "specific" ]
|
|
||||||
then
|
|
||||||
fpm_footprint=$free_footprint
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$fpm_footprint" != "0" ]
|
|
||||||
then
|
|
||||||
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
|
|
||||||
else
|
|
||||||
ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
ynh_app_config_run $1
|
|
Loading…
Reference in a new issue