Skip to content

Commit

Permalink
Merge pull request #112 from YunoHost-Apps/version-2
Browse files Browse the repository at this point in the history
Version 2
  • Loading branch information
ericgaspar authored Mar 13, 2023
2 parents 6b43f73 + 72efc88 commit 8756400
Show file tree
Hide file tree
Showing 16 changed files with 114 additions and 484 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Firefly III should give you insight into and control over your finances. Money s
But you get the idea: this is your money. These are your expenses. Stop them from controlling you. I built this tool because I started to dislike money. Having money, not having money, paying bills with money, you get the idea. But no more. I want to feel "safe", whatever my balance is. And I hope this tool can help you. I know it helps me.


**Shipped version:** 5.7.18~ynh1
**Shipped version:** 6.0.4~ynh1

**Demo:** https://demo.firefly-iii.org/login

Expand Down
2 changes: 1 addition & 1 deletion README_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Firefly III should give you insight into and control over your finances. Money s
But you get the idea: this is your money. These are your expenses. Stop them from controlling you. I built this tool because I started to dislike money. Having money, not having money, paying bills with money, you get the idea. But no more. I want to feel "safe", whatever my balance is. And I hope this tool can help you. I know it helps me.


**Version incluse :** 5.7.18~ynh1
**Version incluse :** 6.0.4~ynh1

**Démo :** https://demo.firefly-iii.org/login

Expand Down
6 changes: 0 additions & 6 deletions conf/app.src

This file was deleted.

2 changes: 1 addition & 1 deletion conf/cron
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# cron job for __APP__
0 3 * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/artisan firefly-iii:cron
0 3 * * * __APP__ /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/artisan firefly-iii:cron
2 changes: 1 addition & 1 deletion conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
location __PATH__/ {

# Path to source
alias __FINALPATH__/public/;
alias __INSTALL_DIR__/public/;

index index.php;
if (!-e $request_filename)
Expand Down
Empty file removed doc/DISCLAIMER.md
Empty file.
77 changes: 0 additions & 77 deletions manifest.json

This file was deleted.

70 changes: 70 additions & 0 deletions manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
packaging_format = 2

id = "firefly-iii"
name = "Firefly III"
description.en = "Self-hosted financial manager"
description.fr = "Gestionnaire de finances personnelles"

version = "6.0.4~ynh1"

maintainers = []

[upstream]
license = "GPL-3.0-or-later"
website = "https://firefly-iii.org/"
demo = "https://demo.firefly-iii.org/login"
admindoc = "https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/introduction/"
code = "https://github.com/firefly-iii/firefly-iii"

[integration]
yunohost = ">= 11.1.15"
architectures = "all"
multi_instance = true
ldap = false
sso = false
disk = "50M"
ram.build = "50M"
ram.runtime = "50M"

[install]
[install.domain]
type = "domain"

[install.path]
type = "path"
default = "/firefly"

[install.init_main_permission]
help.en = "If enabled, firefly-iii will be accessible by people who doesn’t have an account. This can be changed later via the webadmin."
help.fr = "Si cette case est cochée, firefly-iii sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."
type = "group"
default = "visitors"

[install.language]
ask.en = "Choose the application language"
ask.fr = "Choisissez la langue de l'application"
type = "string"
choices = ["de_DE", "en_US", "es_ES", "fr_FR", "it_IT", "nl_NL", "pt_PT"]
default = "fr_FR"

[install.admin]
type = "user"

[resources]
[resources.sources.main]
url = "https://github.com/firefly-iii/firefly-iii/archive/refs/tags/v6.0.4.tar.gz"
sha256 = "4b04ea295313f04bae13534983a6e28310770d7b2ce84034df753127c6bc675d"


[resources.system_user]

[resources.install_dir]

[resources.permissions]
main.url = "/"

[resources.apt]
packages = "mariadb-server php8.2-zip php8.2-mysql php8.2-xml php8.2-intl php8.2-mbstring php8.2-gd php8.2-curl php8.2-bcmath php8.2-opcache php8.2-ldap"

[resources.database]
type = "mysql"
7 changes: 1 addition & 6 deletions scripts/_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
# COMMON VARIABLES
#=================================================

YNH_PHP_VERSION="8.0"

# Composer version
YNH_COMPOSER_VERSION="2.3.5"

# dependencies used by the app
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"
YNH_COMPOSER_VERSION="2.5.4"

#=================================================
# PERSONAL HELPERS
Expand Down
21 changes: 1 addition & 20 deletions scripts/backup
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,6 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers

#=================================================
# MANAGE SCRIPT FAILURE
#=================================================

# Exit if an error occurs during the execution of the script
ynh_abort_if_errors

#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info --message="Loading installation settings..."

app=$YNH_APP_INSTANCE_NAME

final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)

#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
Expand All @@ -38,7 +19,7 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR
#=================================================

ynh_backup --src_path="$final_path"
ynh_backup --src_path="$install_dir"

#=================================================
# BACKUP THE NGINX CONFIGURATION
Expand Down
94 changes: 4 additions & 90 deletions scripts/change_url
Original file line number Diff line number Diff line change
Expand Up @@ -9,67 +9,12 @@
source _common.sh
source /usr/share/yunohost/helpers

#=================================================
# RETRIEVE ARGUMENTS
#=================================================

old_domain=$YNH_APP_OLD_DOMAIN
old_path=$YNH_APP_OLD_PATH

new_domain=$YNH_APP_NEW_DOMAIN
new_path=$YNH_APP_NEW_PATH

app=$YNH_APP_INSTANCE_NAME

#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."

# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path)

# Add settings here as needed by your application
language=$(ynh_app_setting_get --app=$app --key=language)
random_key=$(ynh_app_setting_get --app=$app --key=random_key)
email=$(ynh_user_get_info --username=$admin --key=mail)
timezone="$(cat /etc/timezone)"
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)

#=================================================
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..."

# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"

# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors

#=================================================
# CHECK WHICH PARTS SHOULD BE CHANGED
#=================================================

change_domain=0
if [ "$old_domain" != "$new_domain" ]
then
change_domain=1
fi

change_path=0
if [ "$old_path" != "$new_path" ]
then
change_path=1
fi

#=================================================
# STANDARD MODIFICATIONS
Expand All @@ -78,29 +23,7 @@ fi
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..."

nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf

# Change the path in the NGINX config file
if [ $change_path -eq 1 ]
then
# Make a backup of the original NGINX config file if modified
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
# Set global variables for NGINX helper
domain="$old_domain"
path_url="$new_path"
# Create a dedicated NGINX config
ynh_add_nginx_config
fi

# Change the domain for NGINX
if [ $change_domain -eq 1 ]
then
# Delete file checksum for the old conf file location
ynh_delete_file_checksum --file="$nginx_conf_path"
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
# Store file checksum for the new config file location
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
fi
ynh_change_url_nginx_config

#=================================================
# MODIFY A CONFIG FILE
Expand All @@ -110,18 +33,9 @@ ynh_script_progression --message="Modifying a config file..."
domain="$new_domain"
path="$new_path"

ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
chmod 400 "$final_path/.env"
chown $app "$final_path/.env"

#=================================================
# GENERIC FINALISATION
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..."

ynh_systemd_action --service_name=nginx --action=reload
ynh_add_config --template="../conf/.env" --destination="$install_dir/.env"
chmod 400 "$install_dir/.env"
chown $app "$install_dir/.env"

#=================================================
# END OF SCRIPT
Expand Down
Loading

0 comments on commit 8756400

Please sign in to comment.