diff --git a/conf/config.php b/conf/config.php index 3bfef15..c12e1ad 100644 --- a/conf/config.php +++ b/conf/config.php @@ -7,6 +7,8 @@ ** https://github.com/jean-io/moncycle.app */ +define("APP_URL", "__DOMAIN__/__PATH__"); + define("DB_HOST", "localhost"); define("DB_ID", "__DB_USER__"); define("DB_NAME", "__DB_NAME__"); diff --git a/conf/nginx.conf b/conf/nginx.conf index 1a00e86..a48fa91 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -26,9 +26,12 @@ location __PATH__/ { } # Default indexes and catch-all - rewrite ^__PATH__/(connexion|inscription|compte|export)$ __PATH__/$1.php; + 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/ __PATH__/index.php?$args; + try_files $uri $uri.php $uri/index.php $uri/ $1?$args $1.php?$args; # Execute and serve PHP files location ~ [^/]\.php(/|$) { diff --git a/manifest.toml b/manifest.toml index 0306217..a7d8eb0 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~ynh5" +version = "7.0~ynh6" maintainers = ["Raoul de Limezy"] @@ -35,12 +35,11 @@ ram.runtime = "50M" [install.init_main_permission] type = "group" - default = false [resources] [resources.sources.main] - url = "https://github.com/jean-io/moncycle.app/archive/v7.tar.gz" - sha256 = "25f435a55304a5692f55a681971ac41a034c527a87198612e3bfadb7a3b92028" + url = "https://github.com/jean-io/moncycle.app/archive/4ee55999138825fd2f309fa27a69bafe6f5a0c36.zip" + sha256 = "94c3010d12f9650ea87aecde046ef0ba4102308b566de94868adc76c69c22ccf" [resources.system_user] @@ -50,7 +49,7 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "mariadb-server, php8.2-gd, php8.2-mysql" + packages = "mariadb-server, php8.2-gd, php8.2-mysql, php8.2-mbstring" [resources.database] type = "mysql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 1e47ce7..68a2ae1 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,6 +6,8 @@ # PHP APP SPECIFIC #================================================= +YNH_COMPOSER_VERSION="2.6.5" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index e5bd13b..c248549 100755 --- a/scripts/install +++ b/scripts/install @@ -18,6 +18,8 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" ynh_exec_warn_less mkdir "$install_dir/sessions" +ynh_exec_warn_less mkdir "$install_dir/soap_cache" +ynh_exec_warn_less mkdir "$install_dir/composer" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" @@ -25,11 +27,23 @@ chown -R $app:www-data "$install_dir" pushd "$install_dir" ynh_exec_warn_less mv ./www_data/* . - ynh_exec_warn_less ./module/install.sh ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < db/table.sql ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < db/demo.sql popd +#================================================= + # SPECIFIC SETUP + #================================================= + # INSTALL COMPOSER DEPENDENCIES + #================================================= + ynh_script_progression --message="Installing composer dependencies..." --weight=1 + + ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --composerversion="$YNH_COMPOSER_VERSION" --workdir="$install_dir" + +# 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 + #================================================= # PHP-FPM CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8c62497..f938b44 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,6 +30,8 @@ popd ynh_setup_source --dest_dir="$install_dir" --full_replace=1 ynh_exec_warn_less mkdir "$install_dir/sessions" +ynh_exec_warn_less mkdir "$install_dir/soap_cache" +ynh_exec_warn_less mkdir "$install_dir/composer" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" @@ -51,6 +53,19 @@ pushd "$install_dir" popd +#================================================= + # SPECIFIC SETUP + #================================================= + # INSTALL COMPOSER DEPENDENCIES + #================================================= + ynh_script_progression --message="Installing composer dependencies..." --weight=1 + + ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --composerversion="$YNH_COMPOSER_VERSION" --workdir="$install_dir" + +# 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 + #================================================= # PHP-FPM CONFIGURATION #=================================================