diff --git a/README.md b/README.md index df6c799..9a02c8d 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Make it easy to monitor menstrual cycles and apply natural methods. Billings. Sy - automatic sending of cycles by email - no data sales/no advertising -**Shipped version:** 7.0~ynh6 +**Shipped version:** 9.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 cf5c3ea..4bc0f56 100644 --- a/README_fr.md +++ b/README_fr.md @@ -36,7 +36,7 @@ Rendre facile le suivi des cycles menstruels et l’application des méthodes na - pas de vente de données/pas de publicité -**Version incluse :** 7.0~ynh6 +**Version incluse :** 9.0~ynh2 **Démo :** https://tableau.moncycle.app/connexion.php?email1=demo@moncycle.app&mdp=demo diff --git a/conf/config.php b/conf/config.php index c12e1ad..04f2655 100644 --- a/conf/config.php +++ b/conf/config.php @@ -7,7 +7,7 @@ ** https://github.com/jean-io/moncycle.app */ -define("APP_URL", "__DOMAIN__/__PATH__"); +define("APP_URL", "__DOMAIN____PATH__"); define("DB_HOST", "localhost"); define("DB_ID", "__DB_USER__"); diff --git a/conf/migrate_7.0.6.sql b/conf/migrate_7.0.6.sql new file mode 100644 index 0000000..836fa4e --- /dev/null +++ b/conf/migrate_7.0.6.sql @@ -0,0 +1,15 @@ +ALTER TABLE `compte` +ADD `totp_etat` smallint(5) unsigned DEFAULT NULL; + +ALTER TABLE `compte` +ADD `totp_secret` varchar(255) DEFAULT NULL; + +CREATE TABLE `cle_valeur` ( + `cle` varchar(255) NOT NULL, + `valeur` bigint(20) unsigned DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; + +INSERT INTO `cle_valeur` (`cle`, `valeur`) VALUES +('pub_visite_mensuel', 0), +('pub_visite_hebdo', 0), +('pub_visite_jour', 0); diff --git a/conf/nginx.conf b/conf/nginx.conf index a48fa91..37886f7 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -26,12 +26,10 @@ location __PATH__/ { } # Default indexes and catch-all - rewrite ^/(export|inscription|compte)$ /$1.php; - rewrite ^/(connexion)$ /$1.html; - rewrite ^/api/(deconnexion)$ /api/$1.php; - rewrite ^/img/(captcha)$ /img/$1.php; - index index.html index.php; - try_files $uri $uri.php $uri/index.php $uri/ $1?$args $1.php?$args; + rewrite ^/(connexion|compte)$ /$1.html; + rewrite ^/api/([a-zA-Z0-9_]+)(\?.*)?$ /api/$1.php$2; + index index.php index.html; + try_files $uri $uri/ $uri.php?$args; # Execute and serve PHP files location ~ [^/]\.php(/|$) { diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index 138bffa..00f1c19 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -1,3 +1,4 @@ * After installing, you can create your own user using the form * Once done, you can (if you want) set the account creation to false in `__INSTALL_DIR__/config.php` * If you want to use the app in PWA mode, be sure to be connected to your account first +* After upgrading from 7.0 to 9.0, you may experience issues if you don't clean your browser cache diff --git a/manifest.toml b/manifest.toml index a7d8eb0..19edd99 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Moncycle" description.en = "Menstrual cycle follow-up for natural family planning" description.fr = "Suivi de cycle pour les méthodes naturelles de régulation de naissance" -version = "7.0~ynh6" +version = "9.0~ynh2" maintainers = ["Raoul de Limezy"] @@ -29,17 +29,13 @@ ram.runtime = "50M" [install.domain] type = "domain" - [install.path] - type = "path" - default = "/moncycle" - [install.init_main_permission] type = "group" [resources] [resources.sources.main] - url = "https://github.com/jean-io/moncycle.app/archive/4ee55999138825fd2f309fa27a69bafe6f5a0c36.zip" - sha256 = "94c3010d12f9650ea87aecde046ef0ba4102308b566de94868adc76c69c22ccf" + url = "https://github.com/jean-io/moncycle.app/archive/cda74b19c2b392886aed48f0ae3a6c6d9b2869a3.zip" + sha256 = "e7b4a6b3350d80106245cd27a529e53ed477764ee59686d8a6f599faec9997e6" [resources.system_user] @@ -49,7 +45,7 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "mariadb-server, php8.2-gd, php8.2-mysql, php8.2-mbstring" + packages = "mariadb-server, php8.2-gd, php8.2-mysql, php8.2-xml, php8.2-mbstring" [resources.database] type = "mysql" diff --git a/scripts/install b/scripts/install index c248549..4025c36 100755 --- a/scripts/install +++ b/scripts/install @@ -43,6 +43,7 @@ popd # worckaround while https://github.com/chartjs/Chart.js/issues/11478 is not fixed ynh_exec_warn_less mkdir "$install_dir/vendor/chartjs" ynh_exec_warn_less curl -o "$install_dir/vendor/chartjs"/chart.js https://cdn.jsdelivr.net/npm/chart.js +ynh_exec_warn_less curl -o "$install_dir/vendor/chartjs"/chart.umd.js.map https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.js.map #================================================= # PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index f938b44..813267f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -44,12 +44,22 @@ pushd "$install_dir" ynh_script_progression --message="Checking if a database migration is needed" if ynh_compare_current_package_version --comparison le --version 7.0~ynh5 then - ynh_script_progression --message="Database migration required, migrating" - ynh_add_config --template="../conf/migrate_7.0.5.sql" --destination="$install_dir/migrate.sql" - ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate.sql + ynh_script_progression --message="7.0.5 to 8.0 database migration required, migrating" + ynh_add_config --template="../conf/migrate_7.0.5.sql" --destination="$install_dir/migrate_7.0.5.sql" + ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate_7.0.5.sql + ynh_add_config --template="../conf/migrate_7.0.6.sql" --destination="$install_dir/migrate_7.0.6.sql" + ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate_7.0.6.sql else - ynh_script_progression --message="Database migration not required" + if ynh_compare_current_package_version --comparison le --version 7.0~ynh6 + then + ynh_script_progression --message="7.0.6 to 8.0 database migration required, migrating" + ynh_add_config --template="../conf/migrate_7.0.6.sql" --destination="$install_dir/migrate_7.0.6.sql" + ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < migrate_7.0.6.sql + else + ynh_script_progression --message="7.0.6 to 8.0 database migration not required since package > 7.0.6" + fi fi + ynh_script_progression --message="You shouldn't see this" popd @@ -64,7 +74,8 @@ popd # worckaround while https://github.com/chartjs/Chart.js/issues/11478 is not fixed ynh_exec_warn_less mkdir "$install_dir/vendor/chartjs" -ynh_exec_warn_less curl -o "$install_dir/vendor/chartjs"/chart.js https://cdn.jsdelivr.net/npm/chart.js +ynh_exec_warn_less curl -o "$install_dir/vendor/chartjs"/chart.js https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.js +ynh_exec_warn_less curl -o "$install_dir/vendor/chartjs"/chart.umd.js.map https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.js.map #================================================= # PHP-FPM CONFIGURATION diff --git a/sources/patches/app-01-mail.patch b/sources/patches/app-01-mail.patch index 87b81ef..c8db56e 100644 --- a/sources/patches/app-01-mail.patch +++ b/sources/patches/app-01-mail.patch @@ -1,17 +1,16 @@ diff --git a/www_data/lib/mail.php b/www_data/lib/mail.php -index f153e3c..e56f1fd 100644 +index 363aeb7..343e33b 100644 --- a/www_data/lib/mail.php +++ b/www_data/lib/mail.php @@ -15,10 +15,10 @@ function mail_init(){ - $mail->isSMTP(); - $mail->Host = SMTP_HOST; -- $mail->SMTPAuth = true; - $mail->Username = SMTP_MAIL; - $mail->Password = SMTP_PASSWORD; -- $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; -+ $mail->SMTPAutoTLS = false; -+ $mail->SMTPSecure = false; - $mail->Port = SMTP_PORT; - $mail->CharSet = 'UTF-8'; - + $mail->isSMTP(); + $mail->Host = SMTP_HOST; +- $mail->SMTPAuth = true; + $mail->Username = SMTP_MAIL; + $mail->Password = SMTP_PASSWORD; +- $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; ++ $mail->SMTPAutoTLS = false; ++ $mail->SMTPSecure = false; + $mail->Port = SMTP_PORT; + $mail->CharSet = 'UTF-8';