From 882781c77f8f9ea479b451ba2ae9d704cca0219f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 19 Jun 2024 23:49:42 +0200 Subject: [PATCH] remove log plugin --- manifest.toml | 8 -------- scripts/backup | 3 --- scripts/install | 16 ---------------- scripts/remove | 2 -- scripts/restore | 7 ------- scripts/upgrade | 18 ------------------ 6 files changed, 54 deletions(-) diff --git a/manifest.toml b/manifest.toml index 5c59732..214e74f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -61,23 +61,15 @@ ram.runtime = "50M" url = "https://piwigo.org/download/dlcounter.php?code=14.4.0" sha256 = "d9c4c422626537e1beb65a9cadcf712a5ead2f63cae3775d85ae17241c3e3dc0" format = "zip" - autoupdate.strategy = "latest_github_release" [resources.sources.ldap_plugin] url = "https://piwigo.org/ext/download.php?rid=7036" sha256 = "3c22652f6c0653aaeebe239435796748ee57612ad44e8e5f2553277545d36e5e" format = "zip" - autoupdate.upstream = "https://github.com/kipjr/ldap_login" autoupdate.strategy = "latest_github_release" - [resources.sources.log_failed_logins_plugin] - url = "http://piwigo.org/ext/download.php?rid=5525" - sha256 = "85b9a06f2c7ca8ae9698e6151c7631f519c945f696b02da72f9ff53243d7e4ca" - in_subdir = false - format = "zip" - [resources.system_user] [resources.install_dir] diff --git a/scripts/backup b/scripts/backup index 773fbb3..e6f6b65 100644 --- a/scripts/backup +++ b/scripts/backup @@ -27,9 +27,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" -ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" - #================================================= # BACKUP THE MYSQL DATABASE #================================================= diff --git a/scripts/install b/scripts/install index f50651a..814cce1 100644 --- a/scripts/install +++ b/scripts/install @@ -85,22 +85,6 @@ UPDATE piwigo_ldap_login_config SET value='' WHERE param = 'ld_binddn'; UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'allow_new_users'; UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'ld_group_user_active';" -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP FAIL2BAN -#================================================= -ynh_script_progression --message="Configuring Fail2Ban..." --weight=6 - -# Configure and activate log_failed_logins plugin -ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "INSERT INTO plugins (id,state,version) VALUES ('log_failed_logins','active','1.2');" -ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "INSERT INTO config (param, value) VALUES ('logFailedLoginsFilename','/var/log/${app}FailedLogins.log');" - -touch "/var/log/${app}FailedLogins.log" -chown "$app:" "/var/log/${app}FailedLogins.log" - -ynh_add_fail2ban_config --logpath="/var/log/${app}FailedLogins.log" --failregex="ip=" --max_retry=6 - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 1512187..5c53b0f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -16,8 +16,6 @@ ynh_remove_nginx_config ynh_remove_fpm_config -ynh_remove_fail2ban_config - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index e814040..004568c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -34,13 +34,6 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -touch "/var/log/${app}FailedLogins.log" -chown "$app:" "/var/log/${app}FailedLogins.log" - -ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" -ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" -ynh_systemd_action --action=restart --service_name=fail2ban - #================================================= # RELOAD NGINX AND PHP-FPM #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 42bdf7f..858f458 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -103,24 +103,6 @@ if [ -f "$install_dir/plugins/Ldap_Login/data.dat" ] ; then ynh_secure_remove --file="$install_dir/plugins/Ldap_Login/data.dat" fi -#================================================= -# UPGRADE FAIL2BAN -#================================================= -ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=8 - -# Configure and activate log_failed_logins plugin -if ! ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "INSERT INTO plugins (id,state,version) VALUES ('log_failed_logins','active','1.2');" 2>&1 > /dev/null; then - ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "UPDATE plugins SET state='active' WHERE id='log_failed_logins';" -fi -if ! ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "INSERT INTO config (param, value) VALUES ('logFailedLoginsFilename','/var/log/${app}FailedLogins.log');" 2>&1 > /dev/null; then - ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "UPDATE config SET value='/var/log/${app}FailedLogins.log' WHERE param='logFailedLoginsFilename';" -fi - -touch "/var/log/${app}FailedLogins.log" -chown "$app:" "/var/log/${app}FailedLogins.log" - -ynh_add_fail2ban_config --logpath="/var/log/${app}FailedLogins.log" --failregex="ip=" --max_retry=6 - #================================================= # END OF SCRIPT #=================================================