ModernUO/Projects/Server/Network
Kamron Batman 464d4b7f66
feat(bans): blocklist generator script and a default blocklist location
Adds tools/Export-IpBlocklist.ps1, the producer half of the in-app blocklist
gate. It merges a thin, non-overlapping set of public IP threat feeds into one
de-duplicated, bogon-filtered list and writes the plain-text file the shard
reads via `blocklistFile`. Parsing is done in a compiled Add-Type hot loop
because the anchor feed alone is ~4M lines; the output is streamed so millions
of entries never become millions of strings.

The file is written to a .tmp sibling and swapped with File.Replace, so the
shard never observes a half-written list, and a total feed outage refuses to
overwrite a good list with an empty one. Re-running is idempotent: the script
exits without downloading anything while the list on disk is younger than
-MinInterval (default 2h, the anchor feed's own refresh period), so a
misconfigured scheduler cannot hammer the upstream feeds. Age comes from the
`generated=` header the script writes, falling back to mtime, so no sidecar
state file is needed. -Force overrides.

`blocklistFile` now defaults to Configuration/ip-blocklist.txt instead of being
empty. The gate stays inert while that file is absent, so this is a no-op for
shards that never run the generator, and dropping the file in later is picked
up by the existing poll with no restart.

Two fixes this exposed:

- FileBlocklist used the configured path verbatim despite documenting it as
  relative to Core.BaseDirectory, so a relative path resolved against the
  process working directory. Relative paths now resolve against BaseDirectory;
  absolute paths are honored so several shards can share one generated list.
- A missing file is now the shipped default rather than a misconfiguration, so
  boot logs "inert: no blocklist at ..." instead of "loaded 0 entries".

tools/ stays ignored except for this script.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-25 00:40:46 -07:00
..
Bans feat(bans): blocklist generator script and a default blocklist location 2026-07-25 00:40:46 -07:00
Encryption fix: Fixes encryption support for pre-6.0.5 clients (#2365) 2026-03-12 21:59:01 -07:00
Firewall refactor(network): collapse Firewall to a single-threaded persisted store 2026-07-23 20:37:19 -07:00
NetState feat(network): wire ban channel + blocklist into the accept path; threading policy 2026-07-23 20:38:23 -07:00
Packets refactor: decompose mobile/corpse hair, delete VirtualHairInfo, fix removal serial (#2462) (#2463) 2026-06-06 14:33:28 -07:00
EncodedPacketHandler.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
EncodedReader.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
IPRateLimiter.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
MovementThrottle.cs feat: Adds robust speed hack detection and movement throttling (#2266) 2026-03-07 11:44:37 -08:00
NetworkCompression.cs fix(network): restore huffman code for symbol 0x19 (#2528) 2026-07-14 09:26:39 -07:00
PacketHandler.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
PacketUtilities.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
PingServer.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
ServerInfo.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
SocketHelper.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00