mirror of
https://github.com/YunoHost-Apps/piwigo_ynh.git
synced 2024-09-03 20:06:03 +02:00
remove log plugin
This commit is contained in:
parent
2a74cd6975
commit
882781c77f
6 changed files with 0 additions and 54 deletions
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -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=<HOST>" --max_retry=6
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -16,8 +16,6 @@ ynh_remove_nginx_config
|
|||
|
||||
ynh_remove_fpm_config
|
||||
|
||||
ynh_remove_fail2ban_config
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -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=<HOST>" --max_retry=6
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue