mirror of
https://github.com/YunoHost-Apps/firefly-iii_ynh.git
synced 2024-09-03 18:36:13 +02:00
Merge branch 'testing' into patch
This commit is contained in:
commit
85fcb6a2f5
7 changed files with 78 additions and 24 deletions
|
@ -12,7 +12,7 @@
|
||||||
setup_private=1
|
setup_private=1
|
||||||
setup_public=1
|
setup_public=1
|
||||||
upgrade=1
|
upgrade=1
|
||||||
upgrade=1 from_commit=231c5e281e9cafabd35d4a6ef3c27fec6f3c470f
|
upgrade=1 from_commit=5ee628f58c4f9ea6b6fd48d843453c47ed3d34e4
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
change_url=0
|
change_url=0
|
||||||
|
|
12
conf/.env
12
conf/.env
|
@ -212,10 +212,10 @@ ADLDAP_AUTO_CONNECT=true
|
||||||
# LDAP connection settings
|
# LDAP connection settings
|
||||||
# You can set the following variables from a file by appending them with _FILE:
|
# You can set the following variables from a file by appending them with _FILE:
|
||||||
# ADLDAP_CONTROLLERS, ADLDAP_PORT, ADLDAP_BASEDN
|
# ADLDAP_CONTROLLERS, ADLDAP_PORT, ADLDAP_BASEDN
|
||||||
ADLDAP_CONTROLLERS=
|
ADLDAP_CONTROLLERS=127.0.0.1
|
||||||
ADLDAP_PORT=389
|
ADLDAP_PORT=389
|
||||||
ADLDAP_TIMEOUT=5
|
ADLDAP_TIMEOUT=5
|
||||||
ADLDAP_BASEDN=""
|
ADLDAP_BASEDN="dc=yunohost,dc=org"
|
||||||
ADLDAP_FOLLOW_REFFERALS=false
|
ADLDAP_FOLLOW_REFFERALS=false
|
||||||
|
|
||||||
# SSL/TLS settings
|
# SSL/TLS settings
|
||||||
|
@ -233,15 +233,15 @@ ADLDAP_ADMIN_USERNAME=
|
||||||
ADLDAP_ADMIN_PASSWORD=
|
ADLDAP_ADMIN_PASSWORD=
|
||||||
|
|
||||||
# You can set the following variables from a file by appending them with _FILE:
|
# You can set the following variables from a file by appending them with _FILE:
|
||||||
ADLDAP_ACCOUNT_PREFIX=
|
ADLDAP_ACCOUNT_PREFIX="uid="
|
||||||
ADLDAP_ACCOUNT_SUFFIX=
|
ADLDAP_ACCOUNT_SUFFIX=",dc=yunohost,dc=org"
|
||||||
|
|
||||||
# LDAP authentication settings.
|
# LDAP authentication settings.
|
||||||
ADLDAP_PASSWORD_SYNC=false
|
ADLDAP_PASSWORD_SYNC=false
|
||||||
ADLDAP_LOGIN_FALLBACK=false
|
ADLDAP_LOGIN_FALLBACK=false
|
||||||
|
|
||||||
ADLDAP_DISCOVER_FIELD=distinguishedname
|
ADLDAP_DISCOVER_FIELD="uid"
|
||||||
ADLDAP_AUTH_FIELD=distinguishedname
|
ADLDAP_AUTH_FIELD="uid"
|
||||||
|
|
||||||
# field to sync as local username.
|
# field to sync as local username.
|
||||||
# You can set the following variable from a file by appending it with _FILE:
|
# You can set the following variable from a file by appending it with _FILE:
|
||||||
|
|
BIN
doc/screenshots/budget.png
Normal file
BIN
doc/screenshots/budget.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 115 KiB |
|
@ -5,6 +5,10 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
|
|
||||||
|
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"
|
pkg_dependencies="redis-server"
|
||||||
|
|
||||||
YNH_PHP_VERSION="7.4"
|
YNH_PHP_VERSION="7.4"
|
||||||
|
@ -14,6 +18,9 @@ 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"
|
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"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -28,7 +28,6 @@ ynh_script_progression --message="Loading installation settings..."
|
||||||
|
|
||||||
# Needed for helper "ynh_add_nginx_config"
|
# Needed for helper "ynh_add_nginx_config"
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
|
||||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -26,7 +26,7 @@ admin=$YNH_APP_ARG_ADMIN
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
random_key=$(ynh_string_random --length=32)
|
random_key=$(ynh_string_random --length=32)
|
||||||
email=$(ynh_user_get_info --username=$admin --key=mail)
|
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
|
update=1
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -49,6 +49,7 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
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=admin --value=$admin
|
||||||
ynh_app_setting_set --app=$app --key=random_key --value=$random_key
|
ynh_app_setting_set --app=$app --key=random_key --value=$random_key
|
||||||
|
ynh_app_setting_set --app=$app --key=update --value=$update
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
|
@ -75,14 +76,26 @@ db_user=$db_name
|
||||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
|
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# CREATE DEDICATED USER
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Configuring system user..."
|
||||||
|
|
||||||
|
# Create a system user
|
||||||
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up source files..."
|
ynh_script_progression --message="Cloning Firefly-iii..."
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
git clone -b $tag --depth 1 https://github.com/firefly-iii/firefly-iii.git $final_path
|
||||||
|
|
||||||
|
chmod 750 "$final_path"
|
||||||
|
chmod -R o-rwx "$final_path"
|
||||||
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$final_path"
|
||||||
|
|
|
@ -24,6 +24,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||||
random_key=$(ynh_app_setting_get --app=$app --key=random_key)
|
random_key=$(ynh_app_setting_get --app=$app --key=random_key)
|
||||||
email=$(ynh_user_get_info --username=$admin --key=mail)
|
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
|
update=$(ynh_app_setting_get --app=$app --key=update)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -78,6 +79,14 @@ ynh_script_progression --message="Making sure dedicated system user exists..."
|
||||||
# Create a dedicated user (if not existing)
|
# Create a dedicated user (if not existing)
|
||||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# CREATE DEDICATED USER
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Making sure dedicated system user exists..."
|
||||||
|
|
||||||
|
# Create a dedicated user (if not existing)
|
||||||
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -86,30 +95,56 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading source files..."
|
if [ `cd $final_path && git rev-parse --is-inside-work-tree` ];
|
||||||
|
then
|
||||||
|
pushd "$final_path"
|
||||||
|
if [ $update -eq 1 ]
|
||||||
|
then
|
||||||
|
git fetch origin tag $latest_tag --no-tags
|
||||||
|
git checkout $latest_tag
|
||||||
|
else
|
||||||
|
git fetch origin tag $tag --no-tags
|
||||||
|
git checkout $tag
|
||||||
|
fi
|
||||||
|
ynh_secure_remove bootstrap/cache/*
|
||||||
|
ynh_secure_remove vendor/
|
||||||
|
popd
|
||||||
|
else
|
||||||
|
ynh_script_progression --message="Upgrading source files..."
|
||||||
|
# Create a temporary directory
|
||||||
|
tmpdir="$(mktemp -d)"
|
||||||
|
|
||||||
# Create a temporary directory
|
# Backup the config file in the temp dir
|
||||||
tmpdir="$(mktemp -d)"
|
|
||||||
|
|
||||||
# Backup the config file in the temp dir
|
|
||||||
mkdir -p "$tmpdir/storage/upload"
|
mkdir -p "$tmpdir/storage/upload"
|
||||||
mkdir -p "$tmpdir/storage/export"
|
mkdir -p "$tmpdir/storage/export"
|
||||||
mkdir -p "$final_path/storage/upload/"
|
mkdir -p "$final_path/storage/upload/"
|
||||||
mkdir -p "$final_path/storage/export/"
|
mkdir -p "$final_path/storage/export/"
|
||||||
cp -a "$final_path/storage/upload/" "$tmpdir/storage/upload/"
|
cp -aT "$final_path/storage/upload" "$tmpdir/storage/upload/$"
|
||||||
cp -a "$final_path/.env" "$tmpdir/.env"
|
cp -a "$final_path/.env" "$tmpdir/.env"
|
||||||
cp -a "$final_path/storage/export/" "$tmpdir/storage/export/"
|
cp -aT "$final_path/storage/export" "$tmpdir/storage/export/"
|
||||||
ynh_secure_remove --file="$final_path"
|
ynh_secure_remove --file="$final_path"
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
if [ $update -eq 1 ]
|
||||||
|
then
|
||||||
|
|
||||||
# Restore the config file
|
git clone -b $latest_tag --depth 1 https://github.com/firefly-iii/firefly-iii.git $final_path
|
||||||
cp -a "$tmpdir/storage/upload/" "$final_path/storage/upload/"
|
|
||||||
cp -a "$tmpdir/storage/export/" "$final_path/storage/export/"
|
else
|
||||||
|
git clone -b $tag --depth 1 https://github.com/firefly-iii/firefly-iii.git $final_path
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
ynh_secure_remove bootstrap/cache/*
|
||||||
|
# Restore the config file and data
|
||||||
|
mkdir -p "$final_path/storage/upload/"
|
||||||
|
mkdir -p "$final_path/storage/export/"
|
||||||
|
cp -aT "$tmpdir/storage/upload" "$final_path/storage/upload"
|
||||||
|
cp -aT "$tmpdir/storage/export" "$final_path/storage/export"
|
||||||
cp -a "$tmpdir/.env" "$final_path/.env"
|
cp -a "$tmpdir/.env" "$final_path/.env"
|
||||||
# Remove temporary directory
|
# Remove temporary directory
|
||||||
ynh_secure_remove --file="$tmpdir"
|
ynh_secure_remove --file="$tmpdir"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
|
@ -149,7 +184,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
ynh_script_progression --message="Updating PHP dependencies..."
|
ynh_script_progression --message="Updating PHP dependencies..."
|
||||||
|
|
||||||
chown -R $app $final_path
|
chown -R $app $final_path
|
||||||
|
|
||||||
ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$final_path"
|
ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -158,6 +192,7 @@ ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$f
|
||||||
ynh_script_progression --message="Modifying a config file..."
|
ynh_script_progression --message="Modifying a config file..."
|
||||||
|
|
||||||
ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
|
ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
|
||||||
|
|
||||||
chmod 400 "$final_path/.env"
|
chmod 400 "$final_path/.env"
|
||||||
chown $app "$final_path/.env"
|
chown $app "$final_path/.env"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue