]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 28 May 2023 09:24:42 +0000 (11:24 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 28 May 2023 09:24:42 +0000 (11:24 +0200)
- let also user install their software on sub paths ...

fba.py
fetch_instances.py

diff --git a/fba.py b/fba.py
index e5549ce4e3987da5b60ccc61730620dc7f1a5f25..af111d373914fda48a7f6727291c8166c85507e8 100644 (file)
--- a/fba.py
+++ b/fba.py
@@ -736,10 +736,10 @@ def update_last_seen(blocker: str, blocked: str, block_level: str):
 
 def block_instance(blocker: str, blocked: str, reason: str, block_level: str):
     # DEBUG: print("DEBUG: blocker,blocked,reason,block_level:", blocker, blocked, reason, block_level)
-    if not validators.domain(blocker):
+    if not validators.domain(blocker.split("/")[0]):
         print("WARNING: Bad blocker:", blocker)
         raise
-    elif not validators.domain(blocked):
+    elif not validators.domain(blocked.split("/")[0]):
         print("WARNING: Bad blocked:", blocked)
         raise
 
@@ -784,10 +784,10 @@ def is_instance_registered(domain: str) -> bool:
 
 def add_instance(domain: str, origin: str, originator: str):
     # DEBUG: print("DEBUG: domain,origin:", domain, origin, originator)
-    if not validators.domain(domain):
+    if not validators.domain(domain.split("/")[0]):
         print("WARNING: Bad domain name:", domain)
         raise
-    elif origin is not None and not validators.domain(origin):
+    elif origin is not None and not validators.domain(origin.split("/")[0]):
         print("WARNING: Bad origin name:", origin)
         raise
 
index 34c9df952013e0a221a68daa589ededa91ada751..3e85543a4661c5cd5851a165db74263684628884 100644 (file)
@@ -30,8 +30,8 @@ def fetch_instances(domain: str, origin: str, software: str):
         if instance == "":
             print("WARNING: Empty instance after tidyup(), domain:", domain)
             continue
-        elif not validators.domain(instance):
-            print("WARNING: Bad instance name,domain:", instance, domain)
+        elif not validators.domain(instance.split("/")[0]):
+            print(f"WARNING: Bad instance='{domain} from domain='{domain}',origin='{origin}',software='{software}'")
             continue
         elif fba.is_blacklisted(instance):
             # NOISY-DEBUG: print("DEBUG: instance is blacklisted:", instance)