From d4691476ee63b0648ded541cafd6d9c6b1393951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Sat, 20 Jul 2024 19:42:52 +0000 Subject: [PATCH] daily --- backup/system-backup.sh | 7 +++--- debian-setup/packages/iptables | 2 +- security/myattackers-ipsets/ipset/nobis.ipset | 2 ++ webserver/wp-install/wp-cli-run-frontend.php | 24 +++++++++++++++++++ 4 files changed, 30 insertions(+), 5 deletions(-) create mode 100755 webserver/wp-install/wp-cli-run-frontend.php diff --git a/backup/system-backup.sh b/backup/system-backup.sh index cd7adae0..fe0cc82f 100755 --- a/backup/system-backup.sh +++ b/backup/system-backup.sh @@ -2,7 +2,7 @@ # # Backup a server with S3QL. # -# VERSION :3.0.4 +# VERSION :3.0.5 # DATE :2021-05-31 # AUTHOR :Viktor Szépe # URL :https://github.com/szepeviktor/debian-server-tools @@ -125,8 +125,7 @@ Backup_system_dbs() # Error 4x mysqldump --skip-lock-tables mysql >"${TARGET}/db-system/mysql-mysql.sql" \ || Error 41 "MySQL system databases backup failed" # https://dev.mysql.com/doc/refman/5.7/en/performance-schema-variable-table-migration.html - if [ "$(echo 'SELECT VERSION() LIKE "%MariaDB%";' | mysql -N)" == 1 ] \ - || dpkg --compare-versions "$(echo 'SELECT @@GLOBAL.innodb_version;' | mysql -N)" lt 5.7.6; then + if mysqlshow information_schema | grep -q -F -x 'Database: information_schema'; then mysqldump --skip-lock-tables information_schema >"${TARGET}/db-system/mysql-information_schema.sql" \ || Error 42 "MySQL system databases backup failed" fi @@ -163,7 +162,7 @@ Check_db_schemas() # Error 5x # Triggers included by default / --skip-triggers # Event Scheduler --events / excluded by default mysqldump --skip-comments --no-data --routines --triggers --events "$DB" \ - | sed -e '1 s#^/\*!999999\\- enable the sandbox mode \*/##' \ + | sed -e '1,2{/^\/\*!999999\\- enable the sandbox mode \*\//d;/^$/d}' \ | sed -e 's/ AUTO_INCREMENT=[0-9]\+\b//' \ >"$TEMP_SCHEMA" || Error 51 "Schema dump failure" diff --git a/debian-setup/packages/iptables b/debian-setup/packages/iptables index 6d950e1e..8c124732 100755 --- a/debian-setup/packages/iptables +++ b/debian-setup/packages/iptables @@ -23,7 +23,7 @@ set -e -x # http://inai.de/documents/Perfect_Ruleset.pdf # Enable loopback traffic Ip46tables -A INPUT -i lo -j ACCEPT -# Enable statefull rules +# Enable stateful rules Ip46tables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT # Drop invalid state packets Ip46tables -A INPUT -m conntrack --ctstate INVALID -j DROP diff --git a/security/myattackers-ipsets/ipset/nobis.ipset b/security/myattackers-ipsets/ipset/nobis.ipset index f3c77ec2..534beabe 100644 --- a/security/myattackers-ipsets/ipset/nobis.ipset +++ b/security/myattackers-ipsets/ipset/nobis.ipset @@ -34,6 +34,8 @@ add nobis 173.234.144.0/21 # AS396190 - LEASEWEB-USA-SEA-10 add nobis 23.19.248.0/22 #add nobis 23.106.192.0/19 +add nobis 23.106.192.0/24 +add nobis 23.106.193.0/24 #add nobis 23.108.128.0/19 add nobis 23.108.224.0/19 diff --git a/webserver/wp-install/wp-cli-run-frontend.php b/webserver/wp-install/wp-cli-run-frontend.php new file mode 100755 index 00000000..c8a7491a --- /dev/null +++ b/webserver/wp-install/wp-cli-run-frontend.php @@ -0,0 +1,24 @@ +load_wordpress(); + +// EDIT Optionally add your code here +add_filter( + 'woocommerce_admin_features', + static function ($features) { + var_dump($features); + return $features; + }, + 0, + 1 +); + +wp(); +define('WP_USE_THEMES', true); +require_once ABSPATH . WPINC . '/template-loader.php';