mirror of
https://github.com/YunoHost-Apps/firefly-iii_ynh.git
synced 2024-09-03 18:36:13 +02:00
commit
691ffbe321
11 changed files with 19 additions and 71 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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": [
|
||||
|
|
|
@ -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"
|
||||
|
||||
# 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
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -29,15 +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..."
|
||||
|
||||
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
|
||||
|
@ -75,7 +74,7 @@ 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"
|
||||
ynh_add_fpm_config --usage=low --footprint=low
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
|
@ -103,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
|
||||
#=================================================
|
||||
|
|
|
@ -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,11 +92,11 @@ 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/
|
||||
|
@ -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
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue