new option --ipa; client IP allowlist:

connections from outside the specified list of IP prefixes are rejected
(docker-friendly alternative to -i 127.0.0.1)

also mkdir any missing folders when logging to file
This commit is contained in:
ed
2023-11-30 20:45:43 +00:00
parent 16766e702e
commit 00812cb1da
5 changed files with 32 additions and 3 deletions

View File

@@ -236,6 +236,10 @@ class HttpCli(object):
if self.is_banned():
return False
if self.args.ipa_re and not self.args.ipa_re.match(self.conn.addr[0]):
self.log("client rejected (--ipa)", 3)
return False
try:
self.s.settimeout(2)
headerlines = read_header(self.sr, self.args.s_thead, self.args.s_thead)