diff --git a/README.md b/README.md index 222aaeb..3b9ee25 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ It aims to ease you perform your 2FA authentication steps whatever the device yo - Edit accounts, even the imported ones - Generate TOTP and HOTP security codes -**Shipped version:** 3.3.2~ynh1 +**Shipped version:** 3.4.0~ynh1 **Demo:** https://demo.2fauth.app/login diff --git a/README_fr.md b/README_fr.md index 90a72cd..9b8eae8 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,7 +27,7 @@ It aims to ease you perform your 2FA authentication steps whatever the device yo - Edit accounts, even the imported ones - Generate TOTP and HOTP security codes -**Version incluse :** 3.3.2~ynh1 +**Version incluse :** 3.4.0~ynh1 **Démo :** https://demo.2fauth.app/login diff --git a/conf/app.src b/conf/app.src index 7ab7721..fbe5786 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/Bubka/2FAuth/archive/refs/tags/v3.3.2.tar.gz -SOURCE_SUM=4c81b4323d7496753253ee34bfac5cbdfac1f7b772bd1b8061e4c78ade9a406e +SOURCE_URL=https://github.com/Bubka/2FAuth/archive/refs/tags/v3.4.0.tar.gz +SOURCE_SUM=3262de96b5a1525b6b51dc679d655dd602d0cd523b8901dfbb0e25dd844a069d SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 1033459..a10ee52 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,5 @@ -location / { +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { # Path to source root __FINALPATH__/public/; diff --git a/manifest.json b/manifest.json index cb40b8c..0b9af36 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "self-hosted alternative to One Time Passcode", "fr": "Alternative auto-hébergée a One Time Passcode" }, - "version": "3.3.2~ynh1", + "version": "3.4.0~ynh1", "url": "https://github.com/Bubka/2FAuth", "upstream": { "license": "AGPL-3.0", @@ -20,12 +20,12 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.3.0" + "yunohost": ">= 11.0.9" }, "multi_instance": true, "services": [ "nginx", - "php8.0-fpm", + "php8.1-fpm", "mysql" ], "arguments": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 3b24e4d..fa08dce 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,10 +4,10 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="8.0" +YNH_PHP_VERSION="8.1" # Composer version -YNH_COMPOSER_VERSION="2.3.5" +YNH_COMPOSER_VERSION="2.4.4" pkg_dependencies="php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-mysql" diff --git a/scripts/install b/scripts/install index ed1fc44..47c0c27 100755 --- a/scripts/install +++ b/scripts/install @@ -29,10 +29,11 @@ path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC phpversion=$YNH_PHP_VERSION admin=$YNH_APP_ARG_ADMIN -email=$(ynh_user_get_info --username=$admin --key=mail) app=$YNH_APP_INSTANCE_NAME +email=$(ynh_user_get_info --username=$admin --key=mail) + #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= @@ -91,14 +92,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -107,6 +100,14 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config ynh_add_fpm_config +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." --weight=1 + +# Create a dedicated NGINX config +ynh_add_nginx_config + #================================================= # INSTALL 2FAUTH WITH COMPOSER #================================================= diff --git a/scripts/restore b/scripts/restore index c97b681..f362880 100755 --- a/scripts/restore +++ b/scripts/restore @@ -45,13 +45,6 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -86,6 +79,13 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weig ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +#================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index c0c24a0..b04ed31 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -60,13 +60,6 @@ if ! ynh_permission_exists --permission="api"; then ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true" fi -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=6 - -ynh_install_app_dependencies $pkg_dependencies - #================================================= # CREATE DEDICATED USER #================================================= @@ -84,13 +77,28 @@ then ynh_script_progression --message="Upgrading source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep="$final_path/.env $final_path/storage" + ynh_setup_source --dest_dir="$final_path" --keep=".env storage" fi chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=6 + +ynh_install_app_dependencies $pkg_dependencies + +#================================================= +# PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 + +# Create a dedicated PHP-FPM config +ynh_add_fpm_config + #================================================= # NGINX CONFIGURATION #================================================= @@ -100,15 +108,7 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - ynh_add_nginx_config #================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 - -# Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$phpversion - -#================================================= -# INSTALL LYCHEE WITH COMPOSER +# INSTALL 2FAUTH WITH COMPOSER #================================================= ynh_script_progression --message="Installing $app with Composer..." --weight=15