Done an overhaul of the IP BAN CHECK page. Forum users will be on band automatically from the firewall directly and fail2ban.. Ordinarily fail2ban unban would be enough... BUT..
When F2B we stars like on the server reboot or I changed the jails et cetera, it then gets stuck in a "restore ban loop" where it will not even give me the status of the client until its finished "restoring bans" . It is basically hangs indefinitely until its completed what it's doing.. Which can literally take several hours or longer now.
The problem seems to stem from F2B keeping an internal record of what was banned so when the server is rebooted, it automatically lads all the banned IP is back into IPtables etc.. Unfortunately when you have literally millions of IP addresses that becomes the total hindrance and is just not realistic to operate that way.
However you can set f2B to store a lesser sized database of a couple hours rather than 24hours as its currently set by default. So the fail2ban.sqlite3 database is now 14MB and not 416MB. So while the restore ban will still work up to 4 hours everything else is simply ignored now..
The firewall will automatically save and restore itself directly via a Demon script thingy. So there is no need for F2B to restore bans at all any more... But I left it as a couple of hours just in case anyway..
This also brings me back to my IP ban check script because that simply could not run and would hang for literally hours because it could not access the F2B jails.
We now have about 2.5 million IP addresses banned over the past week or so... I'm slowly working on reporting them to the abuse database much more efficiently.. So the list is rapidly going down now..
I have also optimised some php stuff. the PHP cache wasn't enabled when I upgraded PHP.. So thats now fixed. Normally PHP scripts are compiled in real-time as they are used which takes up CPU time. So they are all cached for 10 seconds now. Normally this is done for like a power or something, but because my scripts change so frequently, really don't want to wait longer than 10 seconds every time I change a script

it should help reduce the server load a fair bit.
I also enabled a swap file, it is set to only be used when the server is critically low on RAM.
I also found nginx was struggling a fair bit for connections. So I have upped the limit on that as well.
I also realise that the UFW wasn't running.. I think I disabled that a while ago because it was causing no end of problems .. But I cannot remember what those problems were any more ...

but in any case I got the AI to write a script to reset it all for me.. So will see how things go..
There's also been several other small fixes and updates here and there which I probably forgotten about already.
I got some other stuff I need to change as well yet, but I'm going to have to keep off the forum and the PC for the next few days because my hands are killing me again now
