mirror of
https://github.com/YunoHost-Apps/matomo_ynh.git
synced 2024-09-03 19:45:56 +02:00
Patch (#49)
This commit is contained in:
parent
8abfaa2701
commit
1aa0f970e1
6 changed files with 29 additions and 19 deletions
|
@ -1,2 +1,2 @@
|
||||||
MAILTO="admin"
|
MAILTO="__EMAIL__"
|
||||||
5 * * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/console core:archive --url=https://__DOMAIN____PATH__ > /dev/null
|
5 * * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/console core:archive --url=https://__DOMAIN____PATH__ > /dev/null
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
SOURCE_URL=https://github.com/matomo-org/matomo-icons/archive/e96ef33bf490794829831cbb795fd4ea67259699.tar.gz
|
|
||||||
SOURCE_SUM=9a6457d8f138216f911621db7a5af5fbce7214e62d6f184730f216986e498b53
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=tar.gz
|
|
||||||
SOURCE_IN_SUBDIR=true
|
|
||||||
SOURCE_FILENAME=
|
|
|
@ -43,6 +43,11 @@
|
||||||
"example": "/matomo",
|
"example": "/matomo",
|
||||||
"default": "/matomo"
|
"default": "/matomo"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "admin",
|
||||||
|
"type": "user",
|
||||||
|
"example": "johndoe"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
|
|
|
@ -8,9 +8,6 @@ YNH_PHP_VERSION="7.3"
|
||||||
|
|
||||||
extra_php_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring"
|
extra_php_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring"
|
||||||
|
|
||||||
# Composer version
|
|
||||||
YNH_COMPOSER_VERSION="2.0.13"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -22,6 +22,8 @@ ynh_abort_if_errors
|
||||||
|
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url=$YNH_APP_ARG_PATH
|
path_url=$YNH_APP_ARG_PATH
|
||||||
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
|
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
@ -94,10 +96,6 @@ ynh_script_progression --message="Configuring PHP-FPM..."
|
||||||
ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies"
|
ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies"
|
||||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC SETUP
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP A CRON
|
# SETUP A CRON
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -21,6 +21,8 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
|
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -46,6 +48,11 @@ if [ -z "$final_path" ]; then
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If admin doesn't exist
|
||||||
|
if [ -z "$admin" ]; then
|
||||||
|
email=root@$domain
|
||||||
|
fi
|
||||||
|
|
||||||
# Cleaning legacy permissions
|
# Cleaning legacy permissions
|
||||||
if ynh_legacy_permissions_exists; then
|
if ynh_legacy_permissions_exists; then
|
||||||
ynh_legacy_permissions_delete_all
|
ynh_legacy_permissions_delete_all
|
||||||
|
@ -91,8 +98,19 @@ then
|
||||||
# This condition is only for CI test to go through the upgrade process
|
# This condition is only for CI test to go through the upgrade process
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
ynh_setup_source --dest_dir="$final_path"
|
||||||
else
|
else
|
||||||
|
# Create a temporary directory
|
||||||
|
tmpdir="$(mktemp -d)"
|
||||||
|
|
||||||
|
cp -a "$final_path/config/config.ini.php" "$tmpdir/config.ini.php"
|
||||||
|
# Remove the app directory securely
|
||||||
|
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" --keep="$final_path/config/config.ini.php"
|
ynh_setup_source --dest_dir="$final_path"
|
||||||
|
cp -a "$tmpdir/config.ini.php" "$final_path/config/config.ini.php"
|
||||||
|
# Remove the tmp directory securely
|
||||||
|
ynh_secure_remove --file="$tmpdir"
|
||||||
|
|
||||||
|
ynh_exec_as $app php${phpversion} $final_path/console core:update -n
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -116,16 +134,14 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..."
|
||||||
# Create a dedicated PHP-FPM config
|
# Create 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 --package="$extra_php_dependencies"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC UPGRADE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP A CRON
|
# SETUP A CRON
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setuping a cron..."
|
ynh_script_progression --message="Setuping a cron..."
|
||||||
|
|
||||||
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
||||||
|
chown root: "/etc/cron.d/$app"
|
||||||
|
chmod 644 "/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
Loading…
Reference in a new issue