From 55a020b2fba443311c45834ef5a1c27bdc140bc2 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 26 Jan 2023 00:26:55 +0700 Subject: [PATCH 01/13] fix session lifetime --- conf/extra_php-fpm.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf index cd7febe..b47fe31 100644 --- a/conf/extra_php-fpm.conf +++ b/conf/extra_php-fpm.conf @@ -10,3 +10,7 @@ ; php_admin_value[max_input_time] = 300 ; php_admin_value[memory_limit] = 256M ; php_admin_flag[short_open_tag] = On + +; Session lifetime to avoid disconnections on PWA mode +php_admin_value[session.gc_maxlifetime] = 2592000 +php_admin_value[session.cookie_lifetime] = 2592000 \ No newline at end of file From 2a7698f0bc9a70989838d82101401963f556552c Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 26 Jan 2023 00:41:23 +0700 Subject: [PATCH 02/13] Don't know why this was removed --- scripts/upgrade | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 615950e..afe1eaa 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -82,6 +82,10 @@ then ynh_setup_source --dest_dir="$final_path" --keep="config.php" fi +# Void and recreate final_path +ynh_secure_remove --file="$final_path" +ynh_exec_warn_less mkdir "$final_path" + chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" From b35450d2dcd09b0a9030ae0161af60f0b056d0e8 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 26 Jan 2023 00:46:26 +0700 Subject: [PATCH 03/13] Stupid mistake --- scripts/upgrade | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index afe1eaa..a7100cb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,6 +74,10 @@ ynh_system_user_create --username=$app --home_dir="$final_path" # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +# Void and recreate final_path +ynh_secure_remove --file="$final_path" +ynh_exec_warn_less mkdir "$final_path" + if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 @@ -82,10 +86,6 @@ then ynh_setup_source --dest_dir="$final_path" --keep="config.php" fi -# Void and recreate final_path -ynh_secure_remove --file="$final_path" -ynh_exec_warn_less mkdir "$final_path" - chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" From c56f558fac48951d7ac02269c9e78b239346c668 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 26 Jan 2023 01:07:17 +0700 Subject: [PATCH 04/13] Correct php version --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index b7e2a5e..f9f5492 100755 --- a/scripts/install +++ b/scripts/install @@ -102,8 +102,8 @@ popd ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage="low" --footprint="low" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +ynh_add_fpm_config --usage="low" --footprint="low" #================================================= # NGINX CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index a7100cb..7325835 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -108,8 +108,8 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$phpversion --usage="low" --footprint="low" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +ynh_add_fpm_config --phpversion=$phpversion --usage="low" --footprint="low" #================================================= # NGINX CONFIGURATION From 0671134f5f5a8596bf071c73fbd366ec59411041 Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 26 Jan 2023 01:12:59 +0700 Subject: [PATCH 05/13] Update upgrade --- scripts/upgrade | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 7325835..12c8d13 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -122,12 +122,12 @@ ynh_add_nginx_config #================================================= # CONFIGURATION UPGRADE #================================================= -#ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression --message="Adding a configuration file..." --weight=1 -#ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php" +ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php" -#chmod 400 "$final_path/config.php" -#chown $app:$app "$final_path/config.php" +chmod 400 "$final_path/config.php" +chown $app:$app "$final_path/config.php" #================================================= # GENERIC FINALIZATION From bd128f29dbfb793bebf23c46c8940fb59f264cbd Mon Sep 17 00:00:00 2001 From: Limezy Date: Thu, 26 Jan 2023 01:16:37 +0700 Subject: [PATCH 06/13] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 7e92268..a3bd664 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Menstrual cycle follow-up for natural family planning", "fr": "Suivi de cycle pour les méthodes naturelles de régulation de naissance" }, - "version": "7.0~ynh1", + "version": "7.0~ynh2", "url": "https://moncycle.app", "upstream": { "license": "CC-BY-NC-SA-4.0", From 64ada4af84195af832315fec521db2822534a548 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 25 Jan 2023 18:17:08 +0000 Subject: [PATCH 07/13] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index df41bf4..ff50fe1 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Menstrual cycle follow-up for natural family planning -**Shipped version:** 7.0~ynh1 +**Shipped version:** 7.0~ynh2 **Demo:** https://tableau.moncycle.app/connexion.php?email1=demo@moncycle.app&mdp=demo diff --git a/README_fr.md b/README_fr.md index 1c80f96..e66d0a2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -56,7 +56,7 @@ Il existe plusieurs méthodes proposées par différentes associations. Voici un 🧠 moncycle.app n'a pas pour objectif de prédire ou de contrôler la bonne application des méthodes (ni de remplacer vos moniteurs) mais seulement de proposer un support numérique. Vous restez le cerveau derrière votre tableau. Si vous ne connaissez pas les méthodes naturelles ou si vous avez des questions sur les règles de celles-ci, rapprochez-vous d'un moniteur de l'une des associations ci-dessus. -**Version incluse :** 7.0~ynh1 +**Version incluse :** 7.0~ynh2 **Démo :** https://tableau.moncycle.app/connexion.php?email1=demo@moncycle.app&mdp=demo From 1055673a305b218b08aa25475e34c817dd6025e1 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 1 Feb 2023 09:01:15 +0700 Subject: [PATCH 08/13] Update upgrade --- scripts/upgrade | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 12c8d13..202b3d8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,16 +74,17 @@ ynh_system_user_create --username=$app --home_dir="$final_path" # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -# Void and recreate final_path -ynh_secure_remove --file="$final_path" -ynh_exec_warn_less mkdir "$final_path" - if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 + # Move config.php to temp folder + # Can't use the --keep="config.php" option + pushd "$final_path" + ynh_exec_warn_less mv ./config.php /tmp/ + popd # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep="config.php" + ynh_setup_source --dest_dir="$final_path" --full_replace fi chmod 750 "$final_path" @@ -92,6 +93,7 @@ chown -R $app:www-data "$final_path" pushd "$final_path" ynh_exec_warn_less mv ./www_data/* . + ynh_exec_warn_less mv /tmp/config.php . ynh_exec_warn_less ./module/install.sh popd @@ -119,16 +121,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CONFIGURATION UPGRADE -#================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 - -ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php" - -chmod 400 "$final_path/config.php" -chown $app:$app "$final_path/config.php" - #================================================= # GENERIC FINALIZATION #================================================= From dab3abe26b281618f508a862930c2309a4bb90d1 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 1 Feb 2023 09:07:38 +0700 Subject: [PATCH 09/13] Update upgrade --- scripts/upgrade | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 202b3d8..8b5c375 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,18 +74,15 @@ ynh_system_user_create --username=$app --home_dir="$final_path" # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=1 - # Move config.php to temp folder - # Can't use the --keep="config.php" option - pushd "$final_path" - ynh_exec_warn_less mv ./config.php /tmp/ - popd +ynh_script_progression --message="Upgrading source files..." --weight=1 +# Move config.php to temp folder +# Can't use the --keep="config.php" option +pushd "$final_path" + ynh_exec_warn_less mv ./config.php /tmp/ +popd - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --full_replace -fi +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$final_path" --full_replace chmod 750 "$final_path" chmod -R o-rwx "$final_path" From 7f2c0f69d3ee5ec1db045bd971e1d2a4c1a5370f Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 1 Feb 2023 09:18:57 +0700 Subject: [PATCH 10/13] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index f9f5492..b7e2a5e 100755 --- a/scripts/install +++ b/scripts/install @@ -102,8 +102,8 @@ popd ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated PHP-FPM config -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) ynh_add_fpm_config --usage="low" --footprint="low" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION From 4413be1af7c070e4f20fc2604adc185404faaff1 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 1 Feb 2023 09:59:09 +0700 Subject: [PATCH 11/13] phpversion --- scripts/install | 1 - scripts/upgrade | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index b7e2a5e..7704aef 100755 --- a/scripts/install +++ b/scripts/install @@ -103,7 +103,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage="low" --footprint="low" -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 8b5c375..a5930fc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION @@ -107,7 +108,6 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated PHP-FPM config -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) ynh_add_fpm_config --phpversion=$phpversion --usage="low" --footprint="low" #================================================= From a9b94ce9470235c2688ba4d7a7cdc6bade3915da Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 1 Feb 2023 10:04:05 +0700 Subject: [PATCH 12/13] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index a5930fc..225ea71 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,7 +83,7 @@ pushd "$final_path" popd # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" --full_replace +ynh_setup_source --dest_dir="$final_path" -r chmod 750 "$final_path" chmod -R o-rwx "$final_path" From f4de06ca21f24d7b34e1292a26e3b1f5f196f588 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 1 Feb 2023 10:10:04 +0700 Subject: [PATCH 13/13] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 225ea71..adfeccf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,7 +83,7 @@ pushd "$final_path" popd # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" -r +ynh_setup_source --dest_dir="$final_path" --full_replace=1 chmod 750 "$final_path" chmod -R o-rwx "$final_path"