"reverse.open-telekom-cloud.com" : "Please get yourself a proper domain name, no static-IP host names",
"static.sl-reverse.messenger.com": "Please get yourself a proper domain name, no static-IP host names",
"documentation.on.seirdy.one" : "Just ignore such lines!",
+ "drankdrankdrank" : "Mass flooding of instances",
}
@lru_cache
domain_helper.raise_on(domain)
if blacklist.is_blacklisted(domain):
- raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ raise Exception(f"domain='{domain}' is blacklisted but function is invoked")
elif not isinstance(headers, dict):
raise ValueError(f"Parameter headers[]='{type(headers)}' is not of type 'dict'")
if blacklist.is_blacklisted(domain):
raise Exception(f"domain='{domain}' is blacklisted but function was invoked")
elif not instances.is_registered(domain):
- raise Exception(f"domain='{domain}' is not registered but function is invoked.")
+ raise Exception(f"domain='{domain}' is not registered but function is invoked")
# Init block list
blocklist = list()
response_time = time.perf_counter() - start
logger.debug("response_time=%s", response_time)
+ instances.set_last_requested_path(domain, path)
instances.set_last_response_time(domain, response_time)
logger.debug("response.ok='%s',response.status_code=%d,response.reason='%s',response_time=%s", response.ok, response.status_code, response.reason, response_time)
allow_redirects=allow_redirects
)
response_time = time.perf_counter() - start
- logger.debug("Setting response_time=%s for domain='%s' ...", response_time, domain)
+ logger.debug("Setting response_time=%s,path='%s' for domain='%s' ...", response_time, path, domain)
+ instances.set_last_requested_path(domain, path)
instances.set_last_response_time(domain, response_time)
logger.debug("response.ok='%s',response.status_code=%d,response.reason='%s',response_time=%s", response.ok, response.status_code, response.reason, response_time)
instances.set_last_error(domain, exception)
response_time = time.perf_counter() - start
- logger.debug("Setting response_time=%s for domain='%s' ...", response_time, domain)
+ logger.debug("Setting response_time=%s,path='%s' for domain='%s' ...", response_time, path, domain)
+ instances.set_last_requested_path(domain, path)
instances.set_last_response_time(domain, response_time)
raise exception
"last_nodeinfo" : {},
# Last response time
"last_response_time" : {},
+ # Last requested path
+ "last_requested_path": {},
# Last status code
"last_status_code" : {},
# Last error details
domain_helper.raise_on(domain)
if not is_registered(domain):
- raise ValueError(f"domain='{domain}' is not registered but function was invoked.")
+ raise ValueError(f"domain='{domain}' is not registered but function was invoked")
elif blacklist.is_blacklisted(domain):
raise Exception(f"domain='{domain}' is blacklisted but function has been invoked")
_set_data("last_response_time", domain, response_time)
logger.debug("EXIT!")
+def set_last_requested_path(domain: str, path: float) -> None:
+ logger.debug("domain='%s',path=%d - CALLED!", domain, path)
+ domain_helper.raise_on(domain)
+
+ if not isinstance(path, str):
+ raise ValueError(f"path[]='{type(path)}' is not of type 'str'")
+ elif path == "":
+ raise ValueError(f"path='{path}' is an empty string")
+ elif not path.startswith("/"):
+ raise ValueError(f"path='{path}' does not start with '/'")
+
+ # Set timestamp
+ _set_data("last_requested_path", domain, path)
+ logger.debug("EXIT!")
+
def set_total_peers(domain: str, peers: list) -> None:
logger.debug("domain='%s',peers()=%d - CALLED!", domain, len(peers))
domain_helper.raise_on(domain)
domain_helper.raise_on(domain)
if blacklist.is_blacklisted(domain):
- raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ raise Exception(f"domain='{domain}' is blacklisted but function is invoked")
elif not instances.is_registered(domain):
- raise Exception(f"domain='{domain}' is not registered but function is invoked.")
+ raise Exception(f"domain='{domain}' is not registered but function is invoked")
blocklist = list()
block_tag = None
domain_helper.raise_on(domain)
if blacklist.is_blacklisted(domain):
- raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ raise Exception(f"domain='{domain}' is blacklisted but function is invoked")
elif not instances.is_registered(domain):
- raise Exception(f"domain='{domain}' is not registered but function is invoked.")
+ raise Exception(f"domain='{domain}' is not registered but function is invoked")
peers = list()
domain_helper.raise_on(domain)
if blacklist.is_blacklisted(domain):
- raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ raise Exception(f"domain='{domain}' is blacklisted but function is invoked")
elif not instances.is_registered(domain):
- raise Exception(f"domain='{domain}' is not registered but function is invoked.")
+ raise Exception(f"domain='{domain}' is not registered but function is invoked")
blocklist = list()
domain_helper.raise_on(domain)
if blacklist.is_blacklisted(domain):
- raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ raise Exception(f"domain='{domain}' is blacklisted but function is invoked")
peers = list()
domain_helper.raise_on(domain)
if blacklist.is_blacklisted(domain):
- raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ raise Exception(f"domain='{domain}' is blacklisted but function is invoked")
elif not instances.is_registered(domain):
- raise Exception(f"domain='{domain}' is not registered but function is invoked.")
+ raise Exception(f"domain='{domain}' is not registered but function is invoked")
# Init variables
doc = None
domain_helper.raise_on(domain)
if blacklist.is_blacklisted(domain):
- raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ raise Exception(f"domain='{domain}' is blacklisted but function is invoked")
elif not instances.is_registered(domain):
- raise Exception(f"domain='{domain}' is not registered but function is invoked.")
+ raise Exception(f"domain='{domain}' is not registered but function is invoked")
# Init variables
blocklist = list()
domain_helper.raise_on(domain)
if blacklist.is_blacklisted(domain):
- raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ raise Exception(f"domain='{domain}' is blacklisted but function is invoked")
elif not instances.is_registered(domain):
- raise Exception(f"domain='{domain}' is not registered but function is invoked.")
+ raise Exception(f"domain='{domain}' is not registered but function is invoked")
logger.debug("domain='%s' is misskey, sending API POST request ...", domain)
peers = list()
domain_helper.raise_on(domain)
if blacklist.is_blacklisted(domain):
- raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ raise Exception(f"domain='{domain}' is blacklisted but function is invoked")
elif not instances.is_registered(domain):
- raise Exception(f"domain='{domain}' is not registered but function is invoked.")
+ raise Exception(f"domain='{domain}' is not registered but function is invoked")
# No CSRF by default, you don't have to add network.api_headers by yourself here
headers = tuple()
domain_helper.raise_on(domain)
if blacklist.is_blacklisted(domain):
- raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ raise Exception(f"domain='{domain}' is blacklisted but function is invoked")
elif not instances.is_registered(domain):
- raise Exception(f"domain='{domain}' is not registered but function is invoked.")
+ raise Exception(f"domain='{domain}' is not registered but function is invoked")
# Init variables
peers = list()
domain_helper.raise_on(domain)
if blacklist.is_blacklisted(domain):
- raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ raise Exception(f"domain='{domain}' is blacklisted but function is invoked")
elif not instances.is_registered(domain):
- raise Exception(f"domain='{domain}' is not registered but function is invoked.")
+ raise Exception(f"domain='{domain}' is not registered but function is invoked")
# Init variables
blockdict = list()
domain_helper.raise_on(domain)
if blacklist.is_blacklisted(domain):
- raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ raise Exception(f"domain='{domain}' is blacklisted but function is invoked")
elif not instances.is_registered(domain):
- raise Exception(f"domain='{domain}' is not registered but function is invoked.")
+ raise Exception(f"domain='{domain}' is not registered but function is invoked")
# Init variables
doc = None
<td>{{'%0.2f'|format(instance['last_response_time']|float)}}</td>
</tr>
+ <tr>
+ <td>Last requested path:</td>
+ <td>{% if instance['last_requested_path']%}{{instance['last_requested_path']}}{%else%}-{%endif%}</td>
+ </tr>
+
<tr>
<td>Obfuscated blocks:</td>
<td>{{instance['obfuscated_blocks']}}</td>