hidden files, allow ips

This commit is contained in:
Q
2024-01-14 09:25:24 +02:00
parent 10ba7ef02b
commit 4eab9a34cd
6 changed files with 155 additions and 69 deletions

View File

@@ -1,6 +1,8 @@
from datetime import datetime
import fnmatch
import secrets
import string
from datetime import datetime
import passlib.hash
VALID_TOKEN_CHARS = string.digits + string.ascii_letters
@@ -38,3 +40,11 @@ def hash_password(password):
def verify_password(password, hash):
return passlib.hash.argon2.verify(password, hash)
def is_ip_allowed(allowed_ip, ip, app):
for rule in allowed_ip.split(","):
rule = rule.strip()
if fnmatch.fnmatch(ip, rule):
return True
return False