1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/matomo_ynh.git synced 2024-09-03 19:45:56 +02:00
This commit is contained in:
Éric Gaspar 2021-07-08 08:12:50 +02:00 committed by GitHub
parent 8abfaa2701
commit 1aa0f970e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 19 deletions

View file

@ -1,2 +1,2 @@
MAILTO="admin"
MAILTO="__EMAIL__"
5 * * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/console core:archive --url=https://__DOMAIN____PATH__ > /dev/null

View file

@ -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=

View file

@ -43,6 +43,11 @@
"example": "/matomo",
"default": "/matomo"
},
{
"name": "admin",
"type": "user",
"example": "johndoe"
},
{
"name": "is_public",
"type": "boolean",

View file

@ -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"
# Composer version
YNH_COMPOSER_VERSION="2.0.13"
#=================================================
# PERSONAL HELPERS
#=================================================

View file

@ -22,6 +22,8 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
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
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"
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# SPECIFIC SETUP
#=================================================
#=================================================
# SETUP A CRON
#=================================================

View file

@ -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)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
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
@ -46,6 +48,11 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi
# If admin doesn't exist
if [ -z "$admin" ]; then
email=root@$domain
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
@ -91,8 +98,19 @@ then
# This condition is only for CI test to go through the upgrade process
ynh_setup_source --dest_dir="$final_path"
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
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
@ -116,16 +134,14 @@ 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"
#=================================================
# SPECIFIC UPGRADE
#=================================================
#=================================================
# SETUP A CRON
#=================================================
ynh_script_progression --message="Setuping a cron..."
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