mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
cleaning
This commit is contained in:
parent
98d24a9930
commit
92ca88779a
2 changed files with 21 additions and 15 deletions
|
@ -27,7 +27,7 @@ ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=5
|
|||
# Restore the file first, so it can have a backup if different
|
||||
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||
|
||||
# Recreate a dedicated php-fpm config
|
||||
# Recreate a dedicated PHP-FPM config
|
||||
ynh_add_fpm_config
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -63,13 +63,14 @@ exec_occ() {
|
|||
}
|
||||
|
||||
#=================================================
|
||||
# HANDLE DATABASE MIGRATION
|
||||
# HANDLE DATABASE MIGRATION FROM MYSL TO PSQL
|
||||
#=================================================
|
||||
|
||||
mysql_db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||
|
||||
if [ -n "$mysql_db_pwd" ]
|
||||
then
|
||||
ynh_script_progression --message="Migrating to PostgreSQL database..."
|
||||
ynh_script_progression --message="Migrating to PostgreSQL database..." --weight=3
|
||||
|
||||
ynh_backup_if_checksum_is_different --file="$install_dir/config/config.php"
|
||||
|
||||
|
@ -85,6 +86,10 @@ then
|
|||
ynh_store_file_checksum --file="${install_dir}/config/config.php"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
||||
# Define a function to add an external storage
|
||||
# Create the external storage for the given folders and enable sharing
|
||||
create_external_storage() {
|
||||
|
@ -97,7 +102,6 @@ local mount_id=$(exec_occ files_external:create --output=json \
|
|||
|| exec_occ files_external:option "$mount_id" enable_sharing true
|
||||
}
|
||||
|
||||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading Nextcloud..." --weight=3
|
||||
|
@ -290,7 +294,7 @@ EOF
|
|||
fi
|
||||
|
||||
#=================================================
|
||||
# REGEN SYSTEM CONFIGURATIONS
|
||||
# REGEN PERMISSIONS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reapplying file permissions..." --weight=2
|
||||
|
||||
|
@ -310,15 +314,15 @@ chmod 750 $install_dir
|
|||
#=================================================
|
||||
ynh_script_progression --message="Regenerating system configurations for $app..." --weight=2
|
||||
|
||||
# -------
|
||||
#-------------------------------------------------
|
||||
# PHP-FPM
|
||||
# -------
|
||||
#-------------------------------------------------
|
||||
|
||||
ynh_add_fpm_config
|
||||
|
||||
# -------
|
||||
#-------------------------------------------------
|
||||
# NGINX
|
||||
# -------
|
||||
#-------------------------------------------------
|
||||
|
||||
# Delete current NGINX configuration to be able to check if .well-known is already served.
|
||||
ynh_backup_if_checksum_is_different --file="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
@ -340,9 +344,10 @@ fi
|
|||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
|
||||
# -------
|
||||
#-------------------------------------------------
|
||||
# CRON JOB
|
||||
# -------
|
||||
#-------------------------------------------------
|
||||
|
||||
cron_path="/etc/cron.d/$app"
|
||||
ynh_add_config --template="../conf/nextcloud.cron" --destination="$cron_path"
|
||||
chown root: "$cron_path"
|
||||
|
@ -350,14 +355,15 @@ chmod 644 "$cron_path"
|
|||
|
||||
exec_occ background:cron
|
||||
|
||||
# -------
|
||||
#-------------------------------------------------
|
||||
# LOGROTATE
|
||||
# -------
|
||||
#-------------------------------------------------
|
||||
|
||||
ynh_use_logrotate --non-append
|
||||
|
||||
# -------
|
||||
#-------------------------------------------------
|
||||
# FAIL2BAN
|
||||
# -------
|
||||
#-------------------------------------------------
|
||||
|
||||
# Create a dedicated Fail2Ban config
|
||||
ynh_add_fail2ban_config --logpath="$data_dir/data/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: '<HOST>'.*$" --max_retry=5
|
||||
|
|
Loading…
Add table
Reference in a new issue