mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-10-20 23:31:31 +02:00
- Added `clean_name` function to `validation.py` for name validation with max length. - Simplified docstrings in `dnsx` client, parser, and service files for clarity. - Enhanced error handling in `ViewDNSService` to prevent disabling keys on rate limits. - Improved WHOIS service to handle concurrent inserts gracefully with integrity checks. - Updated `Settings` class in worker config to inherit from `BaseAppSettings`. - Added new dependencies in `pyproject.toml` for `apprise` and `cryptography`.
49 lines
1.0 KiB
Python
49 lines
1.0 KiB
Python
_SHARED_NS_TOKENS = frozenset(
|
|
{
|
|
"cloudflare",
|
|
"awsdns",
|
|
"azure-dns",
|
|
"googledomains",
|
|
"ultradns",
|
|
"dnsmadeeasy",
|
|
"akamai",
|
|
"domaincontrol",
|
|
"registrar-servers",
|
|
"worldnic",
|
|
"name-services",
|
|
"cloudns",
|
|
"vercel-dns",
|
|
"wpengine",
|
|
"wixdns",
|
|
"squarespacedns",
|
|
"dnsimple",
|
|
"nsone",
|
|
}
|
|
)
|
|
|
|
_SHARED_NS_DOMAINS = frozenset(
|
|
{
|
|
"he.net",
|
|
"gandi.net",
|
|
"ovh.net",
|
|
"akam.net",
|
|
"name.com",
|
|
"digitalocean.com",
|
|
"linode.com",
|
|
}
|
|
)
|
|
|
|
|
|
def is_shared_nameserver(host: str | None) -> bool:
|
|
if not host:
|
|
return False
|
|
normalized = host.strip().lower().rstrip(".")
|
|
if not normalized:
|
|
return False
|
|
if any(token in normalized for token in _SHARED_NS_TOKENS):
|
|
return True
|
|
return any(
|
|
normalized == domain or normalized.endswith(f".{domain}")
|
|
for domain in _SHARED_NS_DOMAINS
|
|
)
|