netbox-plugin-dns 0.18.2__tar.gz → 0.18.4__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.

Potentially problematic release.


This version of netbox-plugin-dns might be problematic. Click here for more details.

Files changed (85) hide show
  1. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/PKG-INFO +2 -2
  2. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/__init__.py +4 -3
  3. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/api/urls.py +2 -2
  4. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/api/views.py +2 -6
  5. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/apps.py +1 -1
  6. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/models.py +12 -7
  7. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/utilities.py +8 -0
  8. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/validators.py +3 -0
  9. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/pyproject.toml +2 -2
  10. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/LICENSE +0 -0
  11. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/README.md +0 -0
  12. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/admin.py +0 -0
  13. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/api/nested_serializers.py +0 -0
  14. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/api/serializers.py +0 -0
  15. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/fields/__init__.py +0 -0
  16. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/fields/address.py +0 -0
  17. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/fields/network.py +0 -0
  18. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/filters/__init__.py +0 -0
  19. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/filters/nameserver.py +0 -0
  20. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/filters/record.py +0 -0
  21. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/filters/view.py +0 -0
  22. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/filters/zone.py +0 -0
  23. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/forms/__init__.py +0 -0
  24. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/forms/nameserver.py +0 -0
  25. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/forms/record.py +0 -0
  26. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/forms/view.py +0 -0
  27. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/forms/zone.py +0 -0
  28. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/graphql/__init__.py +0 -0
  29. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/graphql/nameserver.py +0 -0
  30. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/graphql/record.py +0 -0
  31. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/graphql/schema.py +0 -0
  32. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/graphql/view.py +0 -0
  33. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/graphql/zone.py +0 -0
  34. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/management/commands/cleanup_database.py +0 -0
  35. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/management/commands/update_soa.py +0 -0
  36. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0001_initial.py +0 -0
  37. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py +0 -0
  38. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0002_zone_default_ttl.py +0 -0
  39. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0003_soa_managed_records.py +0 -0
  40. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0004_create_ptr_for_a_aaaa_records.py +0 -0
  41. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0005_update_ns_records.py +0 -0
  42. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0006_zone_soa_serial_auto.py +0 -0
  43. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0007_alter_zone_soa_serial_auto.py +0 -0
  44. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0008_zone_status_names.py +0 -0
  45. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0009_netbox32.py +0 -0
  46. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0010_update_soa_records.py +0 -0
  47. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0011_add_view_model.py +0 -0
  48. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0012_adjust_zone_and_record.py +0 -0
  49. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0013_add_nameserver_zone_record_description.py +0 -0
  50. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0014_add_view_description.py +0 -0
  51. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0015_add_record_status.py +0 -0
  52. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0016_cleanup_ptr_records.py +0 -0
  53. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0017_alter_record_ttl.py +0 -0
  54. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0018_zone_arpa_network.py +0 -0
  55. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0019_update_ns_ttl.py +0 -0
  56. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0020_netbox_3_4.py +0 -0
  57. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0021_record_ip_address.py +0 -0
  58. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/0022_search.py +0 -0
  59. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/migrations/__init__.py +0 -0
  60. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/navigation.py +0 -0
  61. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/tables/__init__.py +0 -0
  62. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/tables/nameserver.py +0 -0
  63. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/tables/record.py +0 -0
  64. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/tables/view.py +0 -0
  65. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/tables/zone.py +0 -0
  66. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/template_content.py +0 -0
  67. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/templates/netbox_dns/nameserver.html +0 -0
  68. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/templates/netbox_dns/record/managed.html +0 -0
  69. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/templates/netbox_dns/record/related.html +0 -0
  70. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/templates/netbox_dns/record.html +0 -0
  71. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/templates/netbox_dns/view.html +0 -0
  72. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/templates/netbox_dns/zone/base.html +0 -0
  73. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/templates/netbox_dns/zone/child.html +0 -0
  74. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/templates/netbox_dns/zone/managed_record.html +0 -0
  75. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/templates/netbox_dns/zone/record.html +0 -0
  76. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/templates/netbox_dns/zone/related.html +0 -0
  77. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/templates/netbox_dns/zone.html +0 -0
  78. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/templatetags/__init__.py +0 -0
  79. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/templatetags/view_helpers.py +0 -0
  80. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/urls.py +0 -0
  81. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/views/__init__.py +0 -0
  82. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/views/nameserver.py +0 -0
  83. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/views/record.py +0 -0
  84. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/views/view.py +0 -0
  85. {netbox_plugin_dns-0.18.2 → netbox_plugin_dns-0.18.4}/netbox_dns/views/zone.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: netbox-plugin-dns
3
- Version: 0.18.2
4
- Summary: Netbox DNS is a NetBox plugin for managing DNS data.
3
+ Version: 0.18.4
4
+ Summary: NetBox DNS is a NetBox plugin for managing DNS data.
5
5
  Home-page: https://github.com/peteeckel/netbox-plugin-dns
6
6
  License: MIT
7
7
  Keywords: netbox,netbox-plugin,dns
@@ -1,12 +1,12 @@
1
1
  from extras.plugins import PluginConfig
2
2
 
3
- __version__ = "0.18.2"
3
+ __version__ = "0.18.4"
4
4
 
5
5
 
6
6
  class DNSConfig(PluginConfig):
7
7
  name = "netbox_dns"
8
- verbose_name = "Netbox DNS"
9
- description = "Netbox DNS"
8
+ verbose_name = "NetBox DNS"
9
+ description = "NetBox plugin for DNS data"
10
10
  min_version = "3.5"
11
11
  version = __version__
12
12
  author = "Peter Eckel"
@@ -27,6 +27,7 @@ class DNSConfig(PluginConfig):
27
27
  "SRV",
28
28
  ],
29
29
  "tolerate_non_rfc1035_types": [],
30
+ "enable_root_zones": False,
30
31
  }
31
32
  base_url = "netbox-dns"
32
33
 
@@ -1,7 +1,7 @@
1
1
  from netbox.api.routers import NetBoxRouter
2
2
 
3
3
  from netbox_dns.api.views import (
4
- NetboxDNSRootView,
4
+ NetBoxDNSRootView,
5
5
  ViewViewSet,
6
6
  ZoneViewSet,
7
7
  NameServerViewSet,
@@ -9,7 +9,7 @@ from netbox_dns.api.views import (
9
9
  )
10
10
 
11
11
  router = NetBoxRouter()
12
- router.APIRootView = NetboxDNSRootView
12
+ router.APIRootView = NetBoxDNSRootView
13
13
 
14
14
  router.register("views", ViewViewSet)
15
15
  router.register("zones", ZoneViewSet)
@@ -15,13 +15,9 @@ from netbox_dns.filters import ViewFilter, ZoneFilter, NameServerFilter, RecordF
15
15
  from netbox_dns.models import View, Zone, NameServer, Record
16
16
 
17
17
 
18
- class NetboxDNSRootView(APIRootView):
19
- """
20
- NetboxDNS API root view
21
- """
22
-
18
+ class NetBoxDNSRootView(APIRootView):
23
19
  def get_view_name(self):
24
- return "NetboxDNS"
20
+ return "NetBoxDNS"
25
21
 
26
22
 
27
23
  class ViewViewSet(NetBoxModelViewSet):
@@ -1,6 +1,6 @@
1
1
  from django.apps import AppConfig
2
2
 
3
3
 
4
- class NetboxDnsConfig(AppConfig):
4
+ class NetBoxDNSConfig(AppConfig):
5
5
  default_auto_field = "django.db.models.BigAutoField"
6
6
  name = "netbox_dns"
@@ -289,10 +289,13 @@ class Zone(NetBoxModel):
289
289
  )
290
290
 
291
291
  def __str__(self):
292
- try:
293
- name = dns_name.from_text(self.name, origin=None).to_unicode()
294
- except dns_name.IDNAException:
295
- name = self.name
292
+ if self.name == "." and get_plugin_config("netbox_dns", "enable_root_zones"):
293
+ name = ". (root zone)"
294
+ else:
295
+ try:
296
+ name = dns_name.from_text(self.name, origin=None).to_unicode()
297
+ except dns_name.IDNAException:
298
+ name = self.name
296
299
 
297
300
  if self.view:
298
301
  return f"[{self.view}] {name}"
@@ -451,7 +454,7 @@ class Zone(NetBoxModel):
451
454
  if self.view is None:
452
455
  if (
453
456
  Zone.objects.exclude(pk=self.pk)
454
- .filter(name=self.name, view__isnull=True)
457
+ .filter(name=self.name.rstrip("."), view__isnull=True)
455
458
  .exists()
456
459
  ):
457
460
  raise ValidationError(
@@ -855,7 +858,7 @@ class Record(NetBoxModel):
855
858
  )
856
859
 
857
860
  if self.type not in get_plugin_config(
858
- "netbox_dns", "tolerate_non_rfc1035_types"
861
+ "netbox_dns", "tolerate_non_rfc1035_types", default=list()
859
862
  ):
860
863
  try:
861
864
  validate_extended_hostname(
@@ -863,7 +866,9 @@ class Record(NetBoxModel):
863
866
  (
864
867
  self.type
865
868
  in get_plugin_config(
866
- "netbox_dns", "tolerate_leading_underscore_types"
869
+ "netbox_dns",
870
+ "tolerate_leading_underscore_types",
871
+ default=list(),
867
872
  )
868
873
  ),
869
874
  )
@@ -4,6 +4,8 @@ from dns import name as dns_name
4
4
  from dns.exception import DNSException
5
5
  from netaddr import IPNetwork, AddrFormatError
6
6
 
7
+ from extras.plugins import get_plugin_config
8
+
7
9
 
8
10
  class NameFormatError(Exception):
9
11
  pass
@@ -38,6 +40,9 @@ def arpa_to_prefix(arpa_name):
38
40
 
39
41
 
40
42
  def name_to_unicode(name):
43
+ if name == "." and get_plugin_config("netbox_dns", "enable_root_zones"):
44
+ return "."
45
+
41
46
  try:
42
47
  return dns_name.from_text(name, origin=None).to_unicode()
43
48
  except dns_name.IDNAException:
@@ -54,6 +59,9 @@ def value_to_unicode(value):
54
59
 
55
60
 
56
61
  def normalize_name(name):
62
+ if name == "." and get_plugin_config("netbox_dns", "enable_root_zones"):
63
+ return "."
64
+
57
65
  try:
58
66
  return (
59
67
  dns_name.from_text(name, origin=dns_name.root)
@@ -47,6 +47,9 @@ def validate_extended_hostname(name, tolerate_leading_underscores=False):
47
47
 
48
48
 
49
49
  def validate_domain_name(name):
50
+ if name == "." and get_plugin_config("netbox_dns", "enable_root_zones"):
51
+ return
52
+
50
53
  if get_plugin_config("netbox_dns", "tolerate_underscores_in_hostnames"):
51
54
  regex = rf"^{UNDERSCORE_LABEL}(\.{UNDERSCORE_LABEL})*\.?$"
52
55
  else:
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
  name = "netbox-plugin-dns"
3
- version = "0.18.2"
4
- description = "Netbox DNS is a NetBox plugin for managing DNS data."
3
+ version = "0.18.4"
4
+ description = "NetBox DNS is a NetBox plugin for managing DNS data."
5
5
  authors = ["Peter Eckel <pe-netbox-dns@hindenburgring.com>"]
6
6
  homepage = "https://github.com/peteeckel/netbox-plugin-dns"
7
7
  repository = "https://github.com/peteeckel/netbox-plugin-dns"