devnomads-cli 0.17.1__tar.gz → 0.17.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/PKG-INFO +1 -1
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/devnomads_cli.egg-info/PKG-INFO +1 -1
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/dncli.py +43 -17
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/pyproject.toml +1 -1
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/tests/test_generated_cli.py +90 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/LICENSE +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/README.md +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/devnomads_cli.egg-info/SOURCES.txt +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/devnomads_cli.egg-info/dependency_links.txt +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/devnomads_cli.egg-info/entry_points.txt +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/devnomads_cli.egg-info/requires.txt +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/devnomads_cli.egg-info/top_level.txt +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/setup.cfg +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/tests/test_agent_features.py +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/tests/test_cert.py +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/tests/test_cli.py +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/tests/test_config.py +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/tests/test_generate.py +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/tests/test_helpers.py +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/tests/test_hook.py +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/tests/test_sites_publish.py +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/tests/test_sites_ssh.py +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/tests/test_skill_install.py +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/tests/test_ssh_keys.py +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/tests/test_transfer.py +0 -0
- {devnomads_cli-0.17.1 → devnomads_cli-0.17.3}/tests/test_versions.py +0 -0
|
@@ -72,7 +72,7 @@ from rich.markup import escape
|
|
|
72
72
|
from rich.table import Table
|
|
73
73
|
from typer.core import TyperGroup
|
|
74
74
|
|
|
75
|
-
__version__ = "0.17.
|
|
75
|
+
__version__ = "0.17.3"
|
|
76
76
|
|
|
77
77
|
# Distribution names, for reporting versions via `dncli version`.
|
|
78
78
|
CLI_PACKAGE = "devnomads-cli"
|
|
@@ -4022,7 +4022,7 @@ def _wait_for_batch(
|
|
|
4022
4022
|
|
|
4023
4023
|
# --- BEGIN GENERATED COMMANDS (tools/generate.py; do not edit by hand) ---
|
|
4024
4024
|
|
|
4025
|
-
API_VERSION = "0.6.
|
|
4025
|
+
API_VERSION = "0.6.33"
|
|
4026
4026
|
SKILL_MD = """\
|
|
4027
4027
|
---
|
|
4028
4028
|
name: devnomads
|
|
@@ -4182,6 +4182,7 @@ Job `status` is one of `queued`, `running`, `completed`, `failed`,
|
|
|
4182
4182
|
| `--key-id` | `dncli keys list` | `name` |
|
|
4183
4183
|
| `--handle-id-*`, `--handle-id` | `dncli handles list` | |
|
|
4184
4184
|
| `--nameserver-group-id` | `dncli nameserver-groups list` | `name` |
|
|
4185
|
+
| nameserver id argument | `dncli nameserver-groups nameservers list <group>` | `hostname` |
|
|
4185
4186
|
| `--volume-id` | `dncli containers clusters volumes list <cluster_id>` | `path` |
|
|
4186
4187
|
| `--user-id`, `--database-user-id` | `dncli databases clusters users list <cluster_id>` | `username` |
|
|
4187
4188
|
|
|
@@ -4377,10 +4378,14 @@ dncli containers deploy <service_id> --wait # nothing runs until deployed
|
|
|
4377
4378
|
- New handles can only be used for domains once their job has completed.
|
|
4378
4379
|
- A domain's nameservers come from a nameserver group: DevNomads' shared
|
|
4379
4380
|
group (DevNomads manages the DNS) or one of the client's own. Ask which
|
|
4380
|
-
one when registering (`--nameserver-group-id`)
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4381
|
+
one when registering (`--nameserver-group-id`). Nameservers added to an
|
|
4382
|
+
own group (`dncli nameserver-groups nameservers create`) must already
|
|
4383
|
+
resolve to both an IPv4 and an IPv6 address.
|
|
4384
|
+
- `dncli domains update <domain>` turns DNSSEC on (`--dnssec`) or off
|
|
4385
|
+
(`--no-dnssec`) at the registrar, and moves a domain to another group
|
|
4386
|
+
(`--nameserver-group-id`). One of `--dnssec`/`--no-dnssec` is always
|
|
4387
|
+
required, and a group move needs `--no-dnssec`: switch DNSSEC back on
|
|
4388
|
+
with a second update after the move's job has completed.
|
|
4384
4389
|
"""
|
|
4385
4390
|
|
|
4386
4391
|
LOOKUPS: dict[str, dict[str, Any]] = {
|
|
@@ -4424,6 +4429,12 @@ LOOKUPS: dict[str, dict[str, Any]] = {
|
|
|
4424
4429
|
"list": "/services/domains/nameserver-groups",
|
|
4425
4430
|
"name": "name",
|
|
4426
4431
|
},
|
|
4432
|
+
"nameserver_id": {
|
|
4433
|
+
"what": "nameserver",
|
|
4434
|
+
"list": "/services/domains/nameserver-groups/{nameserverGroupId}/nameservers",
|
|
4435
|
+
"name": "hostname",
|
|
4436
|
+
"each": {"nameserverGroupId": "/services/domains/nameserver-groups"},
|
|
4437
|
+
},
|
|
4427
4438
|
"proxies:cluster_id": {
|
|
4428
4439
|
"what": "proxy cluster",
|
|
4429
4440
|
"list": "/services/proxies/clusters",
|
|
@@ -6636,10 +6647,10 @@ def gen_nameserverGroups_nameservers_show(
|
|
|
6636
6647
|
metavar="NAMESERVER_GROUP_ID",
|
|
6637
6648
|
help="Nameserver group id, from `dncli nameserver-groups list`. The nameserver group's unique `name` works too.",
|
|
6638
6649
|
),
|
|
6639
|
-
nameserver_id:
|
|
6650
|
+
nameserver_id: str = typer.Argument(
|
|
6640
6651
|
...,
|
|
6641
6652
|
metavar="NAMESERVER_ID",
|
|
6642
|
-
help="Nameserver id, from `dncli nameserver-groups nameservers list`.",
|
|
6653
|
+
help="Nameserver id, from `dncli nameserver-groups nameservers list`. The nameserver's unique `hostname` works too.",
|
|
6643
6654
|
),
|
|
6644
6655
|
timeout: int = _TIMEOUT_OPT,
|
|
6645
6656
|
output: OutputFormat | None = _OUTPUT_OPT,
|
|
@@ -6652,7 +6663,10 @@ def gen_nameserverGroups_nameservers_show(
|
|
|
6652
6663
|
"GET",
|
|
6653
6664
|
"/services/domains/nameserver-groups/{nameserverGroupId}/nameservers/{nameserverId}",
|
|
6654
6665
|
{"nameserverGroupId": nameserver_group_id, "nameserverId": nameserver_id},
|
|
6655
|
-
lookups={
|
|
6666
|
+
lookups={
|
|
6667
|
+
"nameserverGroupId": "nameserver_group_id",
|
|
6668
|
+
"nameserverId": "nameserver_id",
|
|
6669
|
+
},
|
|
6656
6670
|
timeout=timeout,
|
|
6657
6671
|
output=output,
|
|
6658
6672
|
select=columns,
|
|
@@ -6704,10 +6718,10 @@ def gen_nameserverGroups_nameservers_update(
|
|
|
6704
6718
|
metavar="NAMESERVER_GROUP_ID",
|
|
6705
6719
|
help="Nameserver group id, from `dncli nameserver-groups list`. The nameserver group's unique `name` works too.",
|
|
6706
6720
|
),
|
|
6707
|
-
nameserver_id:
|
|
6721
|
+
nameserver_id: str = typer.Argument(
|
|
6708
6722
|
...,
|
|
6709
6723
|
metavar="NAMESERVER_ID",
|
|
6710
|
-
help="Nameserver id, from `dncli nameserver-groups nameservers list`.",
|
|
6724
|
+
help="Nameserver id, from `dncli nameserver-groups nameservers list`. The nameserver's unique `hostname` works too.",
|
|
6711
6725
|
),
|
|
6712
6726
|
hostname: str = typer.Option(..., help="New hostname of the nameserver."),
|
|
6713
6727
|
wait: bool = _WAIT_OPT,
|
|
@@ -6726,7 +6740,10 @@ def gen_nameserverGroups_nameservers_update(
|
|
|
6726
6740
|
"/services/domains/nameserver-groups/{nameserverGroupId}/nameservers/{nameserverId}",
|
|
6727
6741
|
{"nameserverGroupId": nameserver_group_id, "nameserverId": nameserver_id},
|
|
6728
6742
|
body={"hostname": hostname},
|
|
6729
|
-
lookups={
|
|
6743
|
+
lookups={
|
|
6744
|
+
"nameserverGroupId": "nameserver_group_id",
|
|
6745
|
+
"nameserverId": "nameserver_id",
|
|
6746
|
+
},
|
|
6730
6747
|
dry_run=dry_run,
|
|
6731
6748
|
wait=wait,
|
|
6732
6749
|
timeout=timeout,
|
|
@@ -8811,9 +8828,14 @@ def gen_services_domains_update(
|
|
|
8811
8828
|
metavar="SERVICE_ID",
|
|
8812
8829
|
help="Service id, or the service's unique entity name (usually its domain or name).",
|
|
8813
8830
|
),
|
|
8814
|
-
|
|
8831
|
+
is_dnssec_enabled: bool = typer.Option(
|
|
8815
8832
|
...,
|
|
8816
|
-
|
|
8833
|
+
"--dnssec/--no-dnssec",
|
|
8834
|
+
help="DNSSEC at the registrar: --dnssec to turn it on, --no-dnssec to turn it off. Must be --no-dnssec when changing the nameserver group.",
|
|
8835
|
+
),
|
|
8836
|
+
nameserver_group_id: str | None = typer.Option(
|
|
8837
|
+
None,
|
|
8838
|
+
help="Nameserver group to move the domain to, from `dncli nameserver-groups list`. The nameserver group's unique `name` works too.",
|
|
8817
8839
|
),
|
|
8818
8840
|
wait: bool = _WAIT_OPT,
|
|
8819
8841
|
dry_run: bool = _DRY_RUN_OPT,
|
|
@@ -8821,16 +8843,20 @@ def gen_services_domains_update(
|
|
|
8821
8843
|
output: OutputFormat | None = _OUTPUT_OPT,
|
|
8822
8844
|
columns: str | None = _COLUMNS_OPT,
|
|
8823
8845
|
) -> None:
|
|
8824
|
-
"""
|
|
8846
|
+
"""Turn DNSSEC on or off at the registrar, or move a domain to another nameserver group.
|
|
8825
8847
|
|
|
8826
|
-
The registry gets the
|
|
8848
|
+
--dnssec or --no-dnssec is always required. Moving to another group needs --no-dnssec; turn DNSSEC back on with a second update once the move is done. The registry gets the changes in the background.
|
|
8849
|
+
"""
|
|
8827
8850
|
|
|
8828
8851
|
_generated_call(
|
|
8829
8852
|
ctx,
|
|
8830
8853
|
"PUT",
|
|
8831
8854
|
"/services/domains/{serviceId}",
|
|
8832
8855
|
{"serviceId": service_id},
|
|
8833
|
-
body={
|
|
8856
|
+
body={
|
|
8857
|
+
"is_dnssec_enabled": is_dnssec_enabled,
|
|
8858
|
+
"nameserver_group_id": nameserver_group_id,
|
|
8859
|
+
},
|
|
8834
8860
|
resolve="/services/domains",
|
|
8835
8861
|
lookups={"nameserver_group_id": "nameserver_group_id"},
|
|
8836
8862
|
dry_run=dry_run,
|
|
@@ -668,3 +668,93 @@ def test_sites_create_help_mentions_proxy_and_database():
|
|
|
668
668
|
result = runner.invoke(app, ["sites", "create", "--help"], env={"COLUMNS": "200"})
|
|
669
669
|
assert "dncli proxies create" in result.output
|
|
670
670
|
assert "dncli databases create" in result.output
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
NAMESERVER_GROUPS = [
|
|
674
|
+
{"id": 1, "client_id": None, "name": "devnomads"},
|
|
675
|
+
{"id": 5, "client_id": 9, "name": "own-dns"},
|
|
676
|
+
]
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
def _mock_domains_and_groups():
|
|
680
|
+
respx.get(f"{API}/services/domains").mock(
|
|
681
|
+
return_value=Response(200, json=[{"service_id": 42, "entity": "example.com"}])
|
|
682
|
+
)
|
|
683
|
+
respx.get(f"{API}/services/domains/nameserver-groups").mock(
|
|
684
|
+
return_value=Response(200, json={"data": NAMESERVER_GROUPS})
|
|
685
|
+
)
|
|
686
|
+
return respx.put(f"{API}/services/domains/42").mock(
|
|
687
|
+
return_value=Response(202, json={"data": []})
|
|
688
|
+
)
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
@respx.mock
|
|
692
|
+
def test_domains_update_turns_dnssec_on_by_entity(configured):
|
|
693
|
+
route = _mock_domains_and_groups()
|
|
694
|
+
result = runner.invoke(app, ["domains", "update", "example.com", "--dnssec"])
|
|
695
|
+
assert result.exit_code == 0, result.output
|
|
696
|
+
assert json.loads(route.calls.last.request.content) == {"is_dnssec_enabled": True}
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
@respx.mock
|
|
700
|
+
def test_domains_update_moves_group_by_name(configured):
|
|
701
|
+
route = _mock_domains_and_groups()
|
|
702
|
+
result = runner.invoke(
|
|
703
|
+
app,
|
|
704
|
+
[
|
|
705
|
+
"domains",
|
|
706
|
+
"update",
|
|
707
|
+
"example.com",
|
|
708
|
+
"--no-dnssec",
|
|
709
|
+
"--nameserver-group-id",
|
|
710
|
+
"own-dns",
|
|
711
|
+
],
|
|
712
|
+
)
|
|
713
|
+
assert result.exit_code == 0, result.output
|
|
714
|
+
assert json.loads(route.calls.last.request.content) == {
|
|
715
|
+
"is_dnssec_enabled": False,
|
|
716
|
+
"nameserver_group_id": 5,
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
def test_domains_update_requires_a_dnssec_choice(configured):
|
|
721
|
+
result = runner.invoke(
|
|
722
|
+
app, ["domains", "update", "example.com", "--nameserver-group-id", "5"]
|
|
723
|
+
)
|
|
724
|
+
assert result.exit_code != 0
|
|
725
|
+
assert "--dnssec" in result.output
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
@respx.mock
|
|
729
|
+
def test_nameserver_resolves_by_hostname_within_its_group(configured):
|
|
730
|
+
respx.get(f"{API}/services/domains/nameserver-groups").mock(
|
|
731
|
+
return_value=Response(200, json={"data": NAMESERVER_GROUPS})
|
|
732
|
+
)
|
|
733
|
+
respx.get(f"{API}/services/domains/nameserver-groups/5/nameservers").mock(
|
|
734
|
+
return_value=Response(
|
|
735
|
+
200,
|
|
736
|
+
json={
|
|
737
|
+
"data": [
|
|
738
|
+
{"id": 11, "hostname": "ns1.example.com"},
|
|
739
|
+
{"id": 12, "hostname": "ns2.example.com"},
|
|
740
|
+
]
|
|
741
|
+
},
|
|
742
|
+
)
|
|
743
|
+
)
|
|
744
|
+
detail = respx.get(
|
|
745
|
+
f"{API}/services/domains/nameserver-groups/5/nameservers/12"
|
|
746
|
+
).mock(return_value=Response(200, json={"id": 12, "hostname": "ns2.example.com"}))
|
|
747
|
+
result = runner.invoke(
|
|
748
|
+
app,
|
|
749
|
+
[
|
|
750
|
+
"--out",
|
|
751
|
+
"json",
|
|
752
|
+
"nameserver-groups",
|
|
753
|
+
"nameservers",
|
|
754
|
+
"show",
|
|
755
|
+
"own-dns",
|
|
756
|
+
"ns2.example.com",
|
|
757
|
+
],
|
|
758
|
+
)
|
|
759
|
+
assert result.exit_code == 0, result.output
|
|
760
|
+
assert detail.called
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|