Replace dig usage
This commit is contained in:
parent
400792922b
commit
780dd5a624
3 changed files with 246 additions and 207 deletions
|
|
@ -3,8 +3,7 @@ import click
|
|||
from transip_client.main import detect
|
||||
|
||||
|
||||
DEFAULT_DNS = "myip.opendns.com"
|
||||
DEFAULT_DNS_NAME = "@resolver1.opendns.com"
|
||||
DEFAULT_SERVICE = "https://api.ipify.org"
|
||||
DEFAULT_API_URL = "https://api.transip.nl/v6"
|
||||
|
||||
|
||||
|
|
@ -13,11 +12,18 @@ DEFAULT_API_URL = "https://api.transip.nl/v6"
|
|||
@click.option("--token", envvar="TOKEN")
|
||||
@click.option("--login", envvar="LOGIN")
|
||||
@click.option("--private-key-path", envvar="PRIVATE_KEY_PATH")
|
||||
@click.option("--dns", envvar="DNS", default=DEFAULT_DNS)
|
||||
@click.option("--dns-name", envvar="DNS_NAME", default=DEFAULT_DNS_NAME)
|
||||
@click.option("--service", envvar="SERVICE", default=DEFAULT_SERVICE)
|
||||
@click.option("--api-url", envvar="API_URL", default=DEFAULT_API_URL)
|
||||
@click.option("--read-only/--write", envvar="READ_ONLY", default=False)
|
||||
def run(domains, token, login, private_key_path, dns, dns_name, api_url, read_only):
|
||||
def run(
|
||||
domains: list[str],
|
||||
token: str,
|
||||
login: str,
|
||||
private_key_path: str,
|
||||
service: str,
|
||||
api_url: str,
|
||||
read_only: bool,
|
||||
) -> None:
|
||||
if not domains:
|
||||
raise ValueError("No domain(s) specified")
|
||||
|
||||
|
|
@ -40,7 +46,7 @@ def run(domains, token, login, private_key_path, dns, dns_name, api_url, read_on
|
|||
|
||||
detect(
|
||||
domains,
|
||||
(dns, dns_name),
|
||||
service,
|
||||
(private_key_path, login),
|
||||
token,
|
||||
api_url,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue