From 2e1395cccf17448b78cb3179729243af9cf22230 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sat, 20 Jun 2020 17:56:42 +0200 Subject: [PATCH 1/4] Give up maintenance... https://github.com/YunoHost/apps/commit/60d3fbcf03a6a07d100dd2f4af0732a25cb83c8a --- manifest.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index a764961..f46c2a4 100644 --- a/manifest.json +++ b/manifest.json @@ -10,9 +10,13 @@ "url": "https://lut.im", "license": "AGPL-3.0", "maintainer": { + "name": "None...", + "email": "" + }, + "previous_maintainers": [{ "name": "Maniack Crudelis et matlink", "email": "maniackc_dev@crudelis.fr" - }, + }], "requirements": { "yunohost": ">= 3.7" }, From 6db2542fe5768cd1d2c797424b41cc08326bbd9b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 5 Oct 2020 22:02:46 +0200 Subject: [PATCH 2/4] Upgrade to 0.12.0 --- README.md | 10 ++++------ README_fr.md | 26 ++++++++++++-------------- conf/app.src | 6 +++--- manifest.json | 5 +++-- scripts/_common.sh | 4 +++- scripts/_variables | 4 ---- scripts/backup | 16 ++++++---------- scripts/change_url | 16 ++++++++-------- scripts/install | 10 ++++------ scripts/remove | 8 ++++---- scripts/restore | 8 +++----- scripts/upgrade | 2 -- 12 files changed, 50 insertions(+), 65 deletions(-) delete mode 100644 scripts/_variables diff --git a/README.md b/README.md index b9d2ec3..2677715 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to Lutim stores images and allows you to see them, download them or share them on social networks. Images are indefinitely stored unless you request that they will be deleted at first view or after 24 hours / one week / one month / one year. -**Shipped version:** 0.11.6 +**Shipped version:** 0.12.0 ## Screenshots @@ -23,7 +23,7 @@ Images are indefinitely stored unless you request that they will be deleted at f ## Configuration -Edit the file `/var/www/lutim/lutim.conf` to edit the configuration of Lutim. +Edit the file `/var/www/lutim/lutim.conf` to configure Lutim. Then reload the lutim service. ## Documentation @@ -39,9 +39,8 @@ Not relevant. #### Supported architectures -* x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/lutim%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/lutim/) +* x86-64 - [![](https://ci-apps.yunohost.org/ci/logs/lutim%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/lutim/) * ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/lutim%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/lutim/) -* Buster x86-64b - [![](https://ci-buster.nohost.me/ci/logs/lutim%20%28Apps%29.svg)](https://ci-buster.nohost.me/ci/apps/lutim/) ## Limitations @@ -56,8 +55,7 @@ Not relevant. --- -Developers infos ----------------- +## Developers infos Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/lutim_ynh/tree/testing). diff --git a/README_fr.md b/README_fr.md index 6e4cda1..203f874 100644 --- a/README_fr.md +++ b/README_fr.md @@ -8,12 +8,12 @@ > *Ce package vous permet d'installer Lutim rapidement et simplement sur un serveur YunoHost. Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/install_fr) pour savoir comment l'installer et en profiter.* -## Résumé +## Vue d'ensemble Lutim stocke les images et vous permet de les voir, de les télécharger ou de les partager sur les réseaux sociaux. Les images sont stockées indéfiniment à moins que vous ne demandiez qu'elles soient effacées à la première vue ou après 24 heures / une semaine / un mois / un an. -**Version embarquée:** 0.11.6 +**Version embarquée :** 0.12.0 ## Captures d'écran @@ -23,13 +23,13 @@ Les images sont stockées indéfiniment à moins que vous ne demandiez qu'elles ## Configuration -Editez le fichier `/var/www/lutim/lutim.conf` pour éditer la configuration de Lutim. -Rechargez ensuite le service lutim. +Éditez le fichier `/var/www/lutim/lutim.conf` pour configurer Lutim. +Rechargez ensuite le service Lutim. ## Documentation - * Documentation officielle: https://framagit.org/luc/lutim/wikis/home - * Documentation YunoHost: Il n'y a pas d'autre documentation, n'hésitez pas à contribuer. + * Documentation officielle : https://framagit.org/luc/lutim/wikis/home + * Documentation YunoHost : https://yunohost.org/#/app_lutim_fr ## Fonctionnalités spécifiques à YunoHost @@ -39,9 +39,8 @@ Non applicable. #### Architectures supportées. -* x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/lutim%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/lutim/) +* x86-64 - [![](https://ci-apps.yunohost.org/ci/logs/lutim%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/lutim/) * ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/lutim%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/lutim/) -* Buster x86-64b - [![](https://ci-buster.nohost.me/ci/logs/lutim%20%28Apps%29.svg)](https://ci-buster.nohost.me/ci/apps/lutim/) ## Limitations @@ -49,15 +48,14 @@ Non applicable. ## Liens - * Reporter un bug: https://github.com/YunoHost-Apps/lutim_ynh/issues - * Site de Lutim: https://lut.im/ - * Dépôt de Lutim: https://framagit.org/fiat-tux/hat-softwares/lutim - * Site de YunoHost: https://yunohost.org/ + * Reporter un bug : https://github.com/YunoHost-Apps/lutim_ynh/issues + * Site de Lutim : https://lut.im/ + * Dépôt de Lutim : https://framagit.org/fiat-tux/hat-softwares/lutim + * Site de YunoHost : https://yunohost.org/ --- -Informations à l'intention des développeurs ----------------- +## Informations à l'intention des développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/lutim_ynh/tree/testing). diff --git a/conf/app.src b/conf/app.src index ab8ab41..095066a 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://framagit.org/fiat-tux/hat-softwares/lutim/-/archive/0.11.6/lutim-0.11.6.tar.gz -SOURCE_SUM=092fc5b914fc8a2dd46f7101fe94c493 -SOURCE_SUM_PRG=md5sum +SOURCE_URL=https://framagit.org/fiat-tux/hat-softwares/lutim/-/archive/0.12.0/lutim-0.12.0.tar.gz +SOURCE_SUM=d431bf4c1fb2323cc4a51958f3f312e9bfe0a5d100afe2e7f99e1ce42f1a5d02 +SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true SOURCE_FILENAME= diff --git a/manifest.json b/manifest.json index f46c2a4..d0dc722 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Self hosting images and sharing anonymous application", "fr": "Application d'hébergement et de partage d'images anonyme" }, - "version": "0.11.6~ynh4", + "version": "0.12.0~ynh1", "url": "https://lut.im", "license": "AGPL-3.0", "maintainer": { @@ -54,7 +54,8 @@ }, "default": false, "help": { - "en": "If you set Lutim as public, everyone will be able to upload images and share them.
But even if not public, everyone can see an image from a link shared with your Lutim." + "en": "If you set Lutim as public, everyone will be able to upload images and share them.
But even if not public, everyone can see an image from a link shared with your Lutim.", + "fr": "Si vous définissez Lutim comme public, tout le monde pourra télécharger des images et les partager.
Mais même si ce n'est pas public, tout le monde peut voir une image à partir d'un lien partagé avec votre Lutim." } }, { diff --git a/scripts/_common.sh b/scripts/_common.sh index 3770c0f..c85111f 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,9 +1,11 @@ #!/bin/bash #================================================= -# PERSONAL HELPERS +# COMMON VARIABLES #================================================= +app_depencencies="carton perlmagick libpq-dev shared-mime-info" + #================================================= # BACKUP #================================================= diff --git a/scripts/_variables b/scripts/_variables deleted file mode 100644 index 6510e96..0000000 --- a/scripts/_variables +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -# Dependencies -app_depencencies="carton perlmagick libpq-dev shared-mime-info" diff --git a/scripts/backup b/scripts/backup index d6be7f4..68dd31c 100644 --- a/scripts/backup +++ b/scripts/backup @@ -19,7 +19,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 +ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -27,11 +27,13 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) #================================================= -# STANDARD BACKUP STEPS +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_script_progression --message="Backing up the main app directory..." CHECK_SIZE "$final_path" ynh_backup --src_path="$final_path" @@ -39,30 +41,24 @@ ynh_backup --src_path="$final_path" #================================================= # BACKUP NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Backing up nginx web server configuration..." ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP #================================================= # BACKUP LOGROTATE #================================================= -ynh_script_progression --message="Backing up logrotate configuration" ynh_backup --src_path="/etc/logrotate.d/$app" #================================================= # BACKUP SYSTEMD #================================================= -ynh_script_progression --message="Backing up systemd configuration" ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= # BACKUP A CRON FILE #================================================= -ynh_script_progression --message="Backing up cron file" ynh_backup --src_path="/etc/cron.d/$app" @@ -70,4 +66,4 @@ ynh_backup --src_path="/etc/cron.d/$app" # END OF SCRIPT #================================================= -ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last +ynh_print_info --message="Backup script completed for Lutim. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 8bb481c..11bc9c5 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -33,7 +33,7 @@ port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." --weight=20 +ynh_script_progression --message="Backing up Lutim before changing its URL (may take a while)..." --weight=20 # Backup the current version of the app ynh_backup_before_upgrade @@ -79,21 +79,21 @@ fi #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating nginx web server configuration..." --weight=2 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf -# Change the path in the nginx config file +# Change the path in the NGINX config file if [ $change_path -eq 1 ] then - # Make a backup of the original nginx config file if modified + # Make a backup of the original NGINX config file if modified ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for nginx helper + # Set global variables for NGINX helper domain="$old_domain" path_url="$new_path" - # Create a dedicated nginx config + # Create a dedicated NGINX config ynh_add_nginx_config fi @@ -138,7 +138,7 @@ ynh_replace_string --match_string="\(^ *prefix.*=> '\).*" --replace_string="\1$n #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -163,4 +163,4 @@ ynh_maintenance_mode_OFF # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression --message="Change of URL completed for Lutim" --last diff --git a/scripts/install b/scripts/install index 749c212..303d192 100644 --- a/scripts/install +++ b/scripts/install @@ -7,8 +7,6 @@ #================================================= # Load common variables for all scripts. -source _variables - source _common.sh source /usr/share/yunohost/helpers @@ -88,9 +86,9 @@ ynh_install_app_dependencies $app_depencencies #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --weight=2 +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -225,7 +223,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=2 +ynh_script_progression --message="Reloading NGINX web server..." --weight=2 ynh_systemd_action --service_name=nginx --action=reload @@ -264,4 +262,4 @@ ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="root" --type # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression --message="Installation of Lutim completed" --last diff --git a/scripts/remove b/scripts/remove index 5c04deb..ca834b6 100644 --- a/scripts/remove +++ b/scripts/remove @@ -51,7 +51,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=2 +ynh_script_progression --message="Removing Lutim main directory..." --weight=2 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -59,9 +59,9 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration..." -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= @@ -94,4 +94,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression --message="Removal of Lutim completed" --last diff --git a/scripts/restore b/scripts/restore index d522562..829679a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -7,8 +7,6 @@ #================================================= # Load common variables for all scripts. -source ../settings/scripts/_variables - source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -62,7 +60,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring Lutim main directory..." ynh_restore_file --origin_path="$final_path" @@ -130,7 +128,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=2 +ynh_script_progression --message="Reloading NGINX web server..." --weight=2 ynh_systemd_action --service_name=nginx --action=reload @@ -169,4 +167,4 @@ ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="root" --type # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression --message="Restoration completed for Lutim" --last diff --git a/scripts/upgrade b/scripts/upgrade index 309da4b..bccdbc2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,8 +7,6 @@ #================================================= # Load common variables for all scripts. -source _variables - source _common.sh source /usr/share/yunohost/helpers From 5800d7ca485e594328d2945b54386afbc05a582a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 18 Oct 2020 22:45:48 +0200 Subject: [PATCH 3/4] Upgrade to v.0.12.1 --- CHANGELOG.md | 4 +- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 4 +- manifest.json | 4 +- scripts/_common.sh | 192 +++++---------------------------------------- scripts/install | 2 +- scripts/upgrade | 8 +- 8 files changed, 32 insertions(+), 186 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 416ed08..0298450 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ Changelog ========= -## Unreleased -- Nothing for now... +## [0.12.1~ynh1](https://github.com/YunoHost-Apps/lutim_ynh/pull/46) - 2020-10-18 +* [Update to Lutim 0.12.1](https://github.com/YunoHost-Apps/lutim_ynh/pull/52) ## [0.11.6~ynh4](https://github.com/YunoHost-Apps/lutim_ynh/pull/46) - 2020-04-25 diff --git a/README.md b/README.md index 2677715..5454c59 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to Lutim stores images and allows you to see them, download them or share them on social networks. Images are indefinitely stored unless you request that they will be deleted at first view or after 24 hours / one week / one month / one year. -**Shipped version:** 0.12.0 +**Shipped version:** 0.12.1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 203f874..79725c0 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/inst Lutim stocke les images et vous permet de les voir, de les télécharger ou de les partager sur les réseaux sociaux. Les images sont stockées indéfiniment à moins que vous ne demandiez qu'elles soient effacées à la première vue ou après 24 heures / une semaine / un mois / un an. -**Version embarquée :** 0.12.0 +**Version embarquée :** 0.12.1 ## Captures d'écran diff --git a/conf/app.src b/conf/app.src index 095066a..11db593 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://framagit.org/fiat-tux/hat-softwares/lutim/-/archive/0.12.0/lutim-0.12.0.tar.gz -SOURCE_SUM=d431bf4c1fb2323cc4a51958f3f312e9bfe0a5d100afe2e7f99e1ce42f1a5d02 +SOURCE_URL=https://framagit.org/fiat-tux/hat-softwares/lutim/-/archive/0.12.1/lutim-0.12.1.tar.gz +SOURCE_SUM=141f142d47e3a8367e0c292304ddbecfc34b49ae7e561e2c3526000040318973 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index d0dc722..8e01235 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Self hosting images and sharing anonymous application", "fr": "Application d'hébergement et de partage d'images anonyme" }, - "version": "0.12.0~ynh1", + "version": "0.12.1~ynh1", "url": "https://lut.im", "license": "AGPL-3.0", "maintainer": { @@ -18,7 +18,7 @@ "email": "maniackc_dev@crudelis.fr" }], "requirements": { - "yunohost": ">= 3.7" + "yunohost": ">= 3.8.1" }, "multi_instance": false, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index c85111f..eadaee3 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -267,27 +267,27 @@ __PRE_TAG1__$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/service #================================================= -ynh_debian_release () { - lsb_release --codename --short -} +# ynh_debian_release () { +# lsb_release --codename --short +# } -is_stretch () { - if [ "$(ynh_debian_release)" == "stretch" ] - then - return 0 - else - return 1 - fi -} +# is_stretch () { +# if [ "$(ynh_debian_release)" == "stretch" ] +# then +# return 0 +# else +# return 1 +# fi +# } -is_jessie () { - if [ "$(ynh_debian_release)" == "jessie" ] - then - return 0 - else - return 1 - fi -} +# is_jessie () { +# if [ "$(ynh_debian_release)" == "jessie" ] +# then +# return 0 +# else +# return 1 +# fi +# } #================================================= @@ -581,160 +581,6 @@ ynh_check_ram () { fi } -#================================================= - -# Define the values to configure php-fpm -# -# usage: ynh_get_scalable_phpfpm --usage=usage --footprint=footprint [--print] -# | arg: -f, --footprint - Memory footprint of the service (low/medium/high). -# low - Less than 20Mb of ram by pool. -# medium - Between 20Mb and 40Mb of ram by pool. -# high - More than 40Mb of ram by pool. -# Or specify exactly the footprint, the load of the service as Mb by pool instead of having a standard value. -# To have this value, use the following command and stress the service. -# watch -n0.5 ps -o user,cmd,%cpu,rss -u APP -# -# | arg: -u, --usage - Expected usage of the service (low/medium/high). -# low - Personal usage, behind the sso. -# medium - Low usage, few people or/and publicly accessible. -# high - High usage, frequently visited website. -# -# | arg: -p, --print - Print the result -# -# -# -# The footprint of the service will be used to defined the maximum footprint we can allow, which is half the maximum RAM. -# So it will be used to defined 'pm.max_children' -# A lower value for the footprint will allow more children for 'pm.max_children'. And so for -# 'pm.start_servers', 'pm.min_spare_servers' and 'pm.max_spare_servers' which are defined from the -# value of 'pm.max_children' -# NOTE: 'pm.max_children' can't exceed 4 times the number of processor's cores. -# -# The usage value will defined the way php will handle the children for the pool. -# A value set as 'low' will set the process manager to 'ondemand'. Children will start only if the -# service is used, otherwise no child will stay alive. This config gives the lower footprint when the -# service is idle. But will use more proc since it has to start a child as soon it's used. -# Set as 'medium', the process manager will be at dynamic. If the service is idle, a number of children -# equal to pm.min_spare_servers will stay alive. So the service can be quick to answer to any request. -# The number of children can grow if needed. The footprint can stay low if the service is idle, but -# not null. The impact on the proc is a little bit less than 'ondemand' as there's always a few -# children already available. -# Set as 'high', the process manager will be set at 'static'. There will be always as many children as -# 'pm.max_children', the footprint is important (but will be set as maximum a quarter of the maximum -# RAM) but the impact on the proc is lower. The service will be quick to answer as there's always many -# children ready to answer. -ynh_get_scalable_phpfpm () { - local legacy_args=ufp - # Declare an array to define the options of this helper. - declare -Ar args_array=( [u]=usage= [f]=footprint= [p]=print ) - local usage - local footprint - local print - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - # Set all characters as lowercase - footprint=${footprint,,} - usage=${usage,,} - print=${print:-0} - - if [ "$footprint" = "low" ] - then - footprint=20 - elif [ "$footprint" = "medium" ] - then - footprint=35 - elif [ "$footprint" = "high" ] - then - footprint=50 - fi - - # Define the way the process manager handle child processes. - if [ "$usage" = "low" ] - then - php_pm=ondemand - elif [ "$usage" = "medium" ] - then - php_pm=dynamic - elif [ "$usage" = "high" ] - then - php_pm=static - else - ynh_die --message="Does not recognize '$usage' as an usage value." - fi - - # Get the total of RAM available, except swap. - local max_ram=$(ynh_check_ram --no_swap) - - less0() { - # Do not allow value below 1 - if [ $1 -le 0 ] - then - echo 1 - else - echo $1 - fi - } - - # Define pm.max_children - # The value of pm.max_children is the total amount of ram divide by 2 and divide again by the footprint of a pool for this app. - # So if php-fpm start the maximum of children, it won't exceed half of the ram. - php_max_children=$(( $max_ram / 2 / $footprint )) - # If process manager is set as static, use half less children. - # Used as static, there's always as many children as the value of pm.max_children - if [ "$php_pm" = "static" ] - then - php_max_children=$(( $php_max_children / 2 )) - fi - php_max_children=$(less0 $php_max_children) - - # To not overload the proc, limit the number of children to 4 times the number of cores. - local core_number=$(nproc) - local max_proc=$(( $core_number * 4 )) - if [ $php_max_children -gt $max_proc ] - then - php_max_children=$max_proc - fi - - if [ "$php_pm" = "dynamic" ] - then - # Define pm.start_servers, pm.min_spare_servers and pm.max_spare_servers for a dynamic process manager - php_min_spare_servers=$(( $php_max_children / 8 )) - php_min_spare_servers=$(less0 $php_min_spare_servers) - - php_max_spare_servers=$(( $php_max_children / 2 )) - php_max_spare_servers=$(less0 $php_max_spare_servers) - - php_start_servers=$(( $php_min_spare_servers + ( $php_max_spare_servers - $php_min_spare_servers ) /2 )) - php_start_servers=$(less0 $php_start_servers) - else - php_min_spare_servers=0 - php_max_spare_servers=0 - php_start_servers=0 - fi - - if [ $print -eq 1 ] - then - ynh_debug --message="Footprint=${footprint}Mb by pool." - ynh_debug --message="Process manager=$php_pm" - ynh_debug --message="Max RAM=${max_ram}Mb" - if [ "$php_pm" != "static" ]; then - ynh_debug --message="\nMax estimated footprint=$(( $php_max_children * $footprint ))" - ynh_debug --message="Min estimated footprint=$(( $php_min_spare_servers * $footprint ))" - fi - if [ "$php_pm" = "dynamic" ]; then - ynh_debug --message="Estimated average footprint=$(( $php_max_spare_servers * $footprint ))" - elif [ "$php_pm" = "static" ]; then - ynh_debug --message="Estimated footprint=$(( $php_max_children * $footprint ))" - fi - ynh_debug --message="\nRaw php-fpm values:" - ynh_debug --message="pm.max_children = $php_max_children" - if [ "$php_pm" = "dynamic" ]; then - ynh_debug --message="pm.start_servers = $php_start_servers" - ynh_debug --message="pm.min_spare_servers = $php_min_spare_servers" - ynh_debug --message="pm.max_spare_servers = $php_max_spare_servers" - fi - fi -} #================================================= diff --git a/scripts/install b/scripts/install index 303d192..dc2333e 100644 --- a/scripts/install +++ b/scripts/install @@ -246,7 +246,7 @@ ynh_systemd_action --action=restart --line_match="Manager.*started" --log_path=" # SEND A README FOR THE ADMIN #================================================= -# Get main domain and buid the url of the admin panel of the app. +# Get main domain and buid the URL of the admin panel of the app. admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app" echo "You can find a config file at $final_path/lutim.conf diff --git a/scripts/upgrade b/scripts/upgrade index bccdbc2..2674aea 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -137,7 +137,7 @@ ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=15 +ynh_script_progression --message="Backing up Lutim before upgrading (may take a while)..." --weight=15 # Backup the current version of the app ynh_backup_before_upgrade @@ -191,7 +191,7 @@ ynh_install_app_dependencies $app_depencencies # Overwrite the nginx configuration only if it's allowed if [ $overwrite_nginx -eq 1 ] then - ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2 + ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 ynh_add_nginx_config fi @@ -297,7 +297,7 @@ chown $app -R /var/log/$app #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -344,4 +344,4 @@ ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="root" --type # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression --message="Upgrade of Lutim completed" --last From 93e24ecbf4f0955bb73c0e4eaba12a53140c5bd0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 18 Oct 2020 22:55:32 +0200 Subject: [PATCH 4/4] Update remove --- scripts/remove | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index ca834b6..c1d7449 100644 --- a/scripts/remove +++ b/scripts/remove @@ -36,7 +36,7 @@ ynh_remove_systemd_config # Check if the service is declared in YunoHost if ynh_exec_fully_quiet yunohost service status $app then - ynh_script_progression --message="Removing $app service..." + ynh_script_progression --message="Removing Lutim service..." yunohost service remove $app fi