1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/moncycle_ynh.git synced 2024-09-03 19:46:16 +02:00

Merge pull request #22 from Limezy/v9.0

V9.0
This commit is contained in:
Limezy 2024-01-31 13:04:33 +07:00 committed by GitHub
commit 3e6ee7bbba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 53 additions and 32 deletions

View file

@ -7,7 +7,7 @@
** https://github.com/jean-io/moncycle.app ** https://github.com/jean-io/moncycle.app
*/ */
define("APP_URL", "__DOMAIN__/__PATH__"); define("APP_URL", "__DOMAIN____PATH__");
define("DB_HOST", "localhost"); define("DB_HOST", "localhost");
define("DB_ID", "__DB_USER__"); define("DB_ID", "__DB_USER__");

15
conf/migrate_7.0.6.sql Normal file
View file

@ -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);

View file

@ -26,12 +26,10 @@ location __PATH__/ {
} }
# Default indexes and catch-all # Default indexes and catch-all
rewrite ^/(export|inscription|compte)$ /$1.php; rewrite ^/(connexion|compte)$ /$1.html;
rewrite ^/(connexion)$ /$1.html; rewrite ^/api/([a-zA-Z0-9_]+)(\?.*)?$ /api/$1.php$2;
rewrite ^/api/(deconnexion)$ /api/$1.php; index index.php index.html;
rewrite ^/img/(captcha)$ /img/$1.php; try_files $uri $uri/ $uri.php?$args;
index index.html index.php;
try_files $uri $uri.php $uri/index.php $uri/ $1?$args $1.php?$args;
# Execute and serve PHP files # Execute and serve PHP files
location ~ [^/]\.php(/|$) { location ~ [^/]\.php(/|$) {

View file

@ -1,3 +1,4 @@
* After installing, you can create your own user using the form * 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` * 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 * 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

View file

@ -5,7 +5,7 @@ name = "Moncycle"
description.en = "Menstrual cycle follow-up for natural family planning" 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" 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"] maintainers = ["Raoul de Limezy"]
@ -29,17 +29,13 @@ ram.runtime = "50M"
[install.domain] [install.domain]
type = "domain" type = "domain"
[install.path]
type = "path"
default = "/moncycle"
[install.init_main_permission] [install.init_main_permission]
type = "group" type = "group"
[resources] [resources]
[resources.sources.main] [resources.sources.main]
url = "https://github.com/jean-io/moncycle.app/archive/4ee55999138825fd2f309fa27a69bafe6f5a0c36.zip" url = "https://github.com/jean-io/moncycle.app/archive/cda74b19c2b392886aed48f0ae3a6c6d9b2869a3.zip"
sha256 = "94c3010d12f9650ea87aecde046ef0ba4102308b566de94868adc76c69c22ccf" sha256 = "e7b4a6b3350d80106245cd27a529e53ed477764ee59686d8a6f599faec9997e6"
[resources.system_user] [resources.system_user]
@ -49,7 +45,7 @@ ram.runtime = "50M"
main.url = "/" main.url = "/"
[resources.apt] [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] [resources.database]
type = "mysql" type = "mysql"

View file

@ -43,6 +43,7 @@ popd
# worckaround while https://github.com/chartjs/Chart.js/issues/11478 is not fixed # 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 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
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 # PHP-FPM CONFIGURATION

View file

@ -44,12 +44,22 @@ pushd "$install_dir"
ynh_script_progression --message="Checking if a database migration is needed" ynh_script_progression --message="Checking if a database migration is needed"
if ynh_compare_current_package_version --comparison le --version 7.0~ynh5 if ynh_compare_current_package_version --comparison le --version 7.0~ynh5
then then
ynh_script_progression --message="Database migration required, migrating" 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.sql" 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.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 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 fi
ynh_script_progression --message="You shouldn't see this"
popd popd
@ -64,7 +74,8 @@ popd
# worckaround while https://github.com/chartjs/Chart.js/issues/11478 is not fixed # 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 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 # PHP-FPM CONFIGURATION

View file

@ -1,17 +1,16 @@
diff --git a/www_data/lib/mail.php b/www_data/lib/mail.php 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 --- a/www_data/lib/mail.php
+++ b/www_data/lib/mail.php +++ b/www_data/lib/mail.php
@@ -15,10 +15,10 @@ function mail_init(){ @@ -15,10 +15,10 @@ function mail_init(){
$mail->isSMTP(); $mail->isSMTP();
$mail->Host = SMTP_HOST; $mail->Host = SMTP_HOST;
- $mail->SMTPAuth = true; - $mail->SMTPAuth = true;
$mail->Username = SMTP_MAIL; $mail->Username = SMTP_MAIL;
$mail->Password = SMTP_PASSWORD; $mail->Password = SMTP_PASSWORD;
- $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; - $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
+ $mail->SMTPAutoTLS = false; + $mail->SMTPAutoTLS = false;
+ $mail->SMTPSecure = false; + $mail->SMTPSecure = false;
$mail->Port = SMTP_PORT; $mail->Port = SMTP_PORT;
$mail->CharSet = 'UTF-8'; $mail->CharSet = 'UTF-8';