diff --git a/README.md b/README.md index 81a2a18..86d4ca9 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,6 @@ Self-hosted financial manager ## Documentation and resources * Official app website: https://firefly-iii.org/ -* Official user documentation: https://yunohost.org/apps * Official admin documentation: https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/introduction/ * Upstream app code repository: https://github.com/firefly-iii/firefly-iii * YunoHost documentation for this app: https://yunohost.org/app_firefly-iii diff --git a/README_fr.md b/README_fr.md index 2ed3e32..8928282 100644 --- a/README_fr.md +++ b/README_fr.md @@ -25,7 +25,6 @@ Gestionnaire de finances personnelles ## Documentations et ressources * Site officiel de l'app : https://firefly-iii.org/ -* Documentation officielle utilisateur : https://yunohost.org/apps * Documentation officielle de l'admin : https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/introduction/ * Dépôt de code officiel de l'app : https://github.com/firefly-iii/firefly-iii * Documentation YunoHost pour cette app : https://yunohost.org/app_firefly-iii diff --git a/conf/.env b/conf/.env index 23d51b3..5cd1104 100644 --- a/conf/.env +++ b/conf/.env @@ -7,7 +7,7 @@ APP_DEBUG=false # This should be your email address. # If you use Docker or similar, you can set this variable from a file by using SITE_OWNER_FILE -SITE_OWNER=mail@example.com +SITE_OWNER=__EMAIL__ # The encryption key for your sessions. Keep this very secure. # Change it to a string of exactly 32 chars or use something like `php artisan key:generate` to generate it. diff --git a/conf/app.src b/conf/app.src index 00d1ccc..9b48108 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,4 +3,3 @@ SOURCE_SUM=13deecec37a01029d7b9057dc7941e6e18e42551477d5ad46683247402904828 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/conf/nginx.conf b/conf/nginx.conf index 40ff3ab..98b151f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,11 +4,6 @@ location __PATH__/ { # Path to source alias __FINALPATH__/public/; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - index index.php; if (!-e $request_filename) { diff --git a/manifest.json b/manifest.json index 8f0eef3..cc0ab02 100644 --- a/manifest.json +++ b/manifest.json @@ -13,7 +13,6 @@ "website": "https://firefly-iii.org/", "demo": "https://demo.firefly-iii.org/login", "admindoc": "https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/introduction/", - "userdoc": "https://yunohost.org/apps", "code": "https://github.com/firefly-iii/firefly-iii" }, "license": "GPL-3.0-or-later", @@ -23,7 +22,7 @@ "url": "https://datamol.org" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ @@ -35,8 +34,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "path", @@ -46,8 +44,7 @@ }, { "name": "admin", - "type": "user", - "example": "johndoe" + "type": "user" }, { "name": "is_public", diff --git a/scripts/_common.sh b/scripts/_common.sh index cfd7a85..0dff24f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,17 +9,12 @@ latest_tag=$(curl -s https://api.github.com/repos/firefly-iii/firefly-iii/releases/latest | grep 'tag_name' | cut -d\" -f4) tag="5.5.11" -pkg_dependencies="redis-server" - -YNH_PHP_VERSION="7.4" +YNH_PHP_VERSION="8.0" # Composer version YNH_COMPOSER_VERSION="2.0.13" -extra_php_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-ldap" - -# Composer version -YNH_COMPOSER_VERSION="2.0.13" +pkg_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-ldap" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 4650867..81b0f6d 100755 --- a/scripts/backup +++ b/scripts/backup @@ -52,14 +52,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= - -ynh_backup --src_path="/etc/logrotate.d/$app" - #================================================= # BACKUP A CRON FILE #================================================= diff --git a/scripts/install b/scripts/install index 7d6ed38..fbeb2e3 100755 --- a/scripts/install +++ b/scripts/install @@ -26,7 +26,9 @@ admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC random_key=$(ynh_string_random --length=32) email=$(ynh_user_get_info --username=$admin --key=mail) +phpversion=$YNH_PHP_VERSION update=1 + app=$YNH_APP_INSTANCE_NAME #================================================= @@ -50,6 +52,7 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=random_key --value=$random_key ynh_app_setting_set --app=$app --key=update --value=$update +ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion #================================================= # INSTALL DEPENDENCIES @@ -91,7 +94,7 @@ ynh_script_progression --message="Cloning Firefly-iii..." ynh_app_setting_set --app=$app --key=final_path --value=$final_path -git clone -b $tag --depth 1 https://github.com/firefly-iii/firefly-iii.git $final_path +git clone --quiet -b $tag --depth 1 https://github.com/firefly-iii/firefly-iii.git $final_path chmod 750 "$final_path" chmod -R o-rwx "$final_path" @@ -112,8 +115,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +ynh_add_fpm_config --usage=low --footprint=low #================================================= # SPECIFIC SETUP @@ -153,14 +155,6 @@ ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." - -# Use logrotate to manage application logfile(s) -ynh_use_logrotate - #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/remove b/scripts/remove index 0f5539b..7af0ae5 100755 --- a/scripts/remove +++ b/scripts/remove @@ -31,14 +31,6 @@ ynh_script_progression --message="Removing the MySQL database..." # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # REMOVE APP MAIN DIR #================================================= @@ -63,6 +55,14 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # SPECIFIC REMOVE #================================================= @@ -73,14 +73,6 @@ ynh_script_progression --message="Removing the cron file..." # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." - -# Remove the app-specific logrotate config -ynh_remove_logrotate - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index b95f289..685b14c 100755 --- a/scripts/restore +++ b/scripts/restore @@ -29,17 +29,14 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) 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 -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +phpversion=$YNH_PHP_VERSION #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= ynh_script_progression --message="Validating restoration parameters..." -ynh_webpath_available --domain=$domain --path_url=$path_url \ -|| ynh_die --message="Path not available: ${domain}${path_url}" -test ! -d $final_path \ -|| ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS @@ -69,16 +66,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring PHP-FPM configuration..." - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -# Recreate a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" - #================================================= # SPECIFIC RESTORATION #================================================= @@ -89,6 +76,16 @@ ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring PHP-FPM configuration..." + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +# Recreate a dedicated PHP-FPM config +ynh_add_fpm_config --usage=low --footprint=low + #================================================= # RESTORE THE MYSQL DATABASE #================================================= @@ -105,13 +102,6 @@ ynh_script_progression --message="Restoring the cron file..." ynh_restore_file --origin_path="/etc/cron.d/$app" -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." - -ynh_restore_file --origin_path="/etc/logrotate.d/$app" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index dfebe20..78df5c3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,11 +25,11 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) random_key=$(ynh_app_setting_get --app=$app --key=random_key) email=$(ynh_user_get_info --username=$admin --key=mail) update=$(ynh_app_setting_get --app=$app --key=update) +phpversion=$YNH_PHP_VERSION #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -92,14 +92,14 @@ then pushd "$final_path" if [ $update -eq 1 ] then - git fetch origin tag $latest_tag --no-tags - git checkout $latest_tag + git fetch --quiet origin tag $latest_tag --no-tags + git checkout --quiet $latest_tag else - git fetch origin tag $tag --no-tags - git checkout $tag + git fetch --quiet origin tag $tag --no-tags + git checkout --quiet $tag --quiet fi - ynh_secure_remove bootstrap/cache/* - ynh_secure_remove vendor/ + ynh_secure_remove --file="$final_path/bootstrap/cache/*" + ynh_secure_remove --file="$final_path/vendor/" popd else ynh_script_progression --message="Upgrading source files..." @@ -120,10 +120,10 @@ then if [ $update -eq 1 ] then - git clone -b $latest_tag --depth 1 https://github.com/firefly-iii/firefly-iii.git $final_path + git clone --quiet -b $latest_tag --depth 1 https://github.com/firefly-iii/firefly-iii.git $final_path else - git clone -b $tag --depth 1 https://github.com/firefly-iii/firefly-iii.git $final_path + git clone --quiet -b $tag --depth 1 https://github.com/firefly-iii/firefly-iii.git $final_path fi @@ -165,8 +165,7 @@ ynh_install_app_dependencies "$pkg_dependencies" ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated php-fpm config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +ynh_add_fpm_config --usage=low --footprint=low #================================================= # SPECIFIC UPGRADE @@ -202,14 +201,6 @@ pushd "$final_path" php$phpversion artisan cache:clear popd -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." - -# Use logrotate to manage app-specific logfile(s) -ynh_use_logrotate --non-append - #================================================= # SETUP A CRON #=================================================