1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/firefly-iii_ynh.git synced 2024-09-03 18:36:13 +02:00

Merge pull request #124 from philippstappert/testing

Update to 6.1.11 and ZIP-files
This commit is contained in:
Alexandre Aubin 2024-04-25 17:11:17 +02:00 committed by GitHub
commit 9b4c8eba3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 38 additions and 282 deletions

View file

@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
Firefly III is a manager for your personal finances. It can help you keep track of your expenses and income, so you can spend less and save more. Firefly III supports the use of budgets, categories and tags. Using external tools, ie [Firefly III Importer](https://github.com/YunoHost-Apps/firefly-iii-di_ynh), you can import data. It also has many neat financial reports available.
**Shipped version:** 6.1.4~ynh1
**Shipped version:** 6.1.11~ynh1
**Demo:** https://demo.firefly-iii.org/login

View file

@ -1,30 +0,0 @@
version = "1.0"
[main]
name = "Firefly-iii configuration"
[main.php_fpm_config]
name = "PHP-FPM configuration"
[main.php_fpm_config.fpm_footprint]
ask = "Memory footprint"
type = "select"
choices.low = "Low, <= 20Mb per pool"
choices.medium = "Medium, between 20Mb and 40Mb per pool"
choices.high = "High, > 40Mb per pool"
choices.specific = "Use specific value"
default = "low"
[main.php_fpm_config.fpm_free_footprint]
visible = "fpm_footprint == 'specific'"
ask = "Memory footprint of the service?"
type = "number"
default = "0"
help = "Free field to specify exactly the footprint in Mb if you don't want to use one of the three previous values."
[main.php_fpm_config.fpm_usage]
ask = "Expected usage"
type = "select"
choices = ["low", "medium", "high"]
default = "low"
help = "low: Personal usage, behind the SSO. No RAM footprint when not used, but the impact on the processor can be high if many users are using the service.<br>medium: Low usage, few people or/and publicly accessible. Low RAM footprint, medium processor footprint when used.<br>high: High usage, frequently visited website. High RAM footprint, but lower on processor usage and quickly responding."

View file

@ -5,7 +5,7 @@ name = "Firefly III"
description.en = "Self-hosted financial manager"
description.fr = "Gestionnaire de finances personnelles"
version = "6.1.4~ynh1"
version = "6.1.11~ynh1"
maintainers = []
@ -55,10 +55,12 @@ ram.runtime = "50M"
[resources]
[resources.sources.main]
url = "https://github.com/firefly-iii/firefly-iii/archive/refs/tags/v6.1.4.tar.gz"
sha256 = "69df1131e25a1dab67fc8c48097478503f53da6d7011c7c6e913773a5b2c9418"
url = "https://github.com/firefly-iii/firefly-iii/releases/download/v6.1.11/FireflyIII-v6.1.11.zip"
sha256 = "f6e3df061c9351daf8b70935e30b5ae6d8650efae27d1cc988e1c2a917d8de87"
extract = true
in_subdir = false
autoupdate.strategy = "latest_github_release"
autoupdate.asset = "tarball"
autoupdate.asset = "zipball"
[resources.system_user]

View file

@ -1,11 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
@ -15,28 +9,12 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_backup --src_path="$install_dir"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="/etc/cron.d/$app"
#=================================================

View file

@ -1,18 +1,8 @@
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
email=$(ynh_user_get_info --username=$admin --key=mail)
timezone="$(cat /etc/timezone)"

View file

@ -1,94 +0,0 @@
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
#=================================================
# SPECIFIC GETTERS FOR TOML SHORT KEY
#=================================================
get__fpm_footprint() {
# Free footprint value for php-fpm
# Check if current_fpm_footprint is an integer
if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null
then
echo "specific"
else
echo "$current_fpm_footprint"
fi
}
get__free_footprint() {
# Free footprint value for php-fpm
# Check if current_fpm_footprint is an integer
if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null
then
# If current_fpm_footprint is an integer, that's a numeric value for the footprint
echo "$current_fpm_footprint"
else
echo "0"
fi
}
#=================================================
# SPECIFIC SETTERS FOR TOML SHORT KEYS
#=================================================
set__fpm_footprint() {
if [ "$fpm_footprint" != "specific" ]
then
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_footprint"
fi
}
set__fpm_free_footprint() {
if [ "$fpm_footprint" = "specific" ]
then
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_free_footprint"
fi
}
#=================================================
# GENERIC FINALIZATION
#=================================================
ynh_app_config_validate() {
_ynh_app_config_validate
if [ "${changed[fpm_usage]}" == "true" ] || [ "${changed[fpm_footprint]}" == "true" ] || [ "${changed[fpm_free_footprint]}" == "true" ]; then
# If fpm_footprint is set to 'specific', use $fpm_free_footprint value.
if [ "$fpm_footprint" = "specific" ]
then
fpm_footprint=$fpm_free_footprint
fi
if [ "$fpm_footprint" == "0" ]
then
ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below."
exit 0
fi
fi
}
ynh_app_config_apply() {
_ynh_app_config_apply
ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint
}
ynh_app_config_run $1

View file

@ -1,34 +1,12 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
random_key=$(ynh_string_random --length=32)
email=$(ynh_user_get_info --username=$admin --key=mail)
timezone=$(cat /etc/timezone)
fpm_footprint="low"
fpm_free_footprint=0
fpm_usage="low"
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_app_setting_set --app=$app --key=random_key --value=$random_key
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -42,27 +20,21 @@ chown -R $app:www-data "$install_dir"
chmod -R 775 $install_dir/storage
#=================================================
# PHP-FPM CONFIGURATION
# SYSTEL CONFIGURATIONS
#=================================================
ynh_script_progression --message="Configuring PHP-FPM..."
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
ynh_script_progression --message="Add system configurations related to $app..."
ynh_add_fpm_config
ynh_add_nginx_config
#=================================================
# SPECIFIC SETUP
#=================================================
# INSTALL COMPOSER DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing composer dependencies..."
ynh_exec_warn_less ynh_install_composer --phpversion=$phpversion --workdir=$install_dir
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..."
ynh_script_progression --message="Adding $app configuration..."
ynh_add_config --template=".env" --destination="$install_dir/.env"
@ -74,17 +46,11 @@ chown $app "$install_dir/.env"
#=================================================
ynh_script_progression --message="Deploying..."
#pushd "$install_dir"
# php$phpversion artisan migrate:refresh --seed
# php$phpversion artisan firefly-iii:upgrade-database
# php$phpversion artisan passport:install
#popd
pushd "$install_dir"
php$phpversion artisan firefly-iii:upgrade-database
php$phpversion artisan firefly-iii:correct-database
php$phpversion artisan firefly-iii:report-integrity
php$phpversion artisan passport:install
php$phpversion artisan firefly-iii:upgrade-database
php$phpversion artisan firefly-iii:correct-database
php$phpversion artisan firefly-iii:report-integrity
php$phpversion artisan passport:keys || true
popd
#=================================================

View file

@ -1,18 +1,12 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# REMOVE NGINX CONFIGURATION
# REMOVE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..."
ynh_script_progression --message="Removing configurations related to $app..."
ynh_remove_nginx_config

View file

@ -1,11 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
@ -30,7 +24,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..."
ynh_script_progression --message="Restoring configurations related to $app..."
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
@ -43,8 +37,6 @@ chmod 644 "/etc/cron.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX AND PHP-FPM
#=================================================
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..."
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload

View file

@ -1,60 +1,23 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
email=$(ynh_user_get_info --username=$admin --key=mail)
timezone="$(cat /etc/timezone)"
#=================================================
# CHECK VERSION
#=================================================
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
# If fpm_footprint doesn't exist, create it
if [ -z "${fpm_footprint:-}" ]; then
fpm_footprint=low
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
fi
# If fpm_free_footprint doesn't exist, create it
if [ -z "${fpm_free_footprint:-}" ]; then
fpm_free_footprint=0
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
fi
# If fpm_usage doesn't exist, create it
if [ -z "${fpm_usage:-}" ]; then
fpm_usage=low
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
if [ -z "${language:-}" ]; then
language="en_US"
ynh_app_setting_set --app=$app --key=language --value=$language
fi
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..."
ynh_script_progression --message="Upgrading source files..."
ynh_setup_source --dest_dir="$install_dir" --keep=".env storage/upload storage/export"
fi
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".env storage"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
@ -63,43 +26,38 @@ chmod -R 775 $install_dir/storage
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading PHP-FPM configuration..."
ynh_script_progression --message="Upgrading system configurations related to $app..."
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
ynh_add_fpm_config
ynh_add_nginx_config
#=================================================
# SPECIFIC UPGRADE
#=================================================
# UPDATE PHP DEPENDENCIES
#=================================================
ynh_script_progression --message="Updating PHP dependencies..."
ynh_exec_warn_less ynh_install_composer
#=================================================
# UPDATE A CONFIG FILE
#=================================================
# ynh_script_progression --message="Updating a configuration file..."
ynh_script_progression --message="Updating $app configuration..."
# ynh_add_config --template=".env" --destination="$install_dir/.env"
ynh_add_config --template=".env" --destination="$install_dir/.env"
# chmod 400 "$install_dir/.env"
# chown $app "$install_dir/.env"
chmod 400 "$install_dir/.env"
chown $app "$install_dir/.env"
#=================================================
# DEPLOYMENT
#=================================================
ynh_script_progression --message="Deploying..."
ynh_script_progression --message="Upgrading database..."
pushd "$install_dir"
ynh_secure_remove --file="bootstrap/cache/*"
php$phpversion artisan cache:clear
php$phpversion artisan migrate --seed
php$phpversion artisan firefly-iii:upgrade-database
php$phpversion artisan passport:install
php$phpversion artisan cache:clear
php$phpversion artisan migrate --seed
php$phpversion artisan firefly-iii:decrypt-all
php$phpversion artisan cache:clear
php$phpversion artisan firefly-iii:upgrade-database
php$phpversion artisan passport:keys || true
php$phpversion artisan cache:clear
popd
#=================================================