Compare commits

..

No commits in common. "main" and "dev" have entirely different histories.
main ... dev

10 changed files with 47 additions and 110 deletions

View file

@ -1 +1,2 @@
just 1.25.2
just 1.16.0
lefthook 1.4.6

View file

@ -7,23 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
## [v0.3.5](https://git.44net.ch/olofvndrhr/octodns-netbox-dns/compare/v0.3.4...v0.3.5) - 2024-03-04
### Commits
- add new tests [`a8ecfab`](https://git.44net.ch/olofvndrhr/octodns-netbox-dns/commit/a8ecfab93096cd3201efcb06a65bc86a2444611a)
- fix typo in method call and add function for semicolons [`afe1826`](https://git.44net.ch/olofvndrhr/octodns-netbox-dns/commit/afe182628a7b2fc784dc48bebaf9978c85d682d2)
- update ci files for github [`6b06cad`](https://git.44net.ch/olofvndrhr/octodns-netbox-dns/commit/6b06cada38751648b9365fd27b850aa2b6d250a8)
- unescape the changeset before comparison to live records to have an accurate changeset. fixes changes for txt records [`4fe8be6`](https://git.44net.ch/olofvndrhr/octodns-netbox-dns/commit/4fe8be62918b5bea821f4f88a151918899b61e91)
- rollback changes to semicolon escaping [`91ba03a`](https://git.44net.ch/olofvndrhr/octodns-netbox-dns/commit/91ba03af7f5f53a7f3b5218f0f4a905eebcdb914)
- revert: change from repr to string in changeset [`8d29b5e`](https://git.44net.ch/olofvndrhr/octodns-netbox-dns/commit/8d29b5e639b25bb57b43e9e85bbe78e51d70b493)
- update logging [`ff1a47c`](https://git.44net.ch/olofvndrhr/octodns-netbox-dns/commit/ff1a47cf8cda21695fb4e30910dd92d0f9cb8b63)
- update test cases [`f38a103`](https://git.44net.ch/olofvndrhr/octodns-netbox-dns/commit/f38a1036b79b9779a8480c2d1f79132370b83bb4)
- change from repr to string in changeset [`696d2a2`](https://git.44net.ch/olofvndrhr/octodns-netbox-dns/commit/696d2a2532eef05fee95cddff627c9b09736ae52)
- only unescape txt and spf records [`78448d2`](https://git.44net.ch/olofvndrhr/octodns-netbox-dns/commit/78448d2bde85fda1718c64e6cd8983b4fcb20fe0)
- fix semicolon escaping [`6e624a7`](https://git.44net.ch/olofvndrhr/octodns-netbox-dns/commit/6e624a79a75051295d1863f9af7e907d44a9b307)
- fix tests [`2e468c8`](https://git.44net.ch/olofvndrhr/octodns-netbox-dns/commit/2e468c85699808ed9ba2edb35a6cc39591869346)
## [v0.3.4](https://git.44net.ch/olofvndrhr/octodns-netbox-dns/compare/v0.3.3...v0.3.4) - 2024-02-29
### Commits

View file

@ -1,6 +1,6 @@
FROM lscr.io/linuxserver/netbox:4.0.7
FROM lscr.io/linuxserver/netbox:3.7.3
RUN pip install -U \
wheel \
setuptools \
netbox-plugin-dns==1.0.4
netbox-plugin-dns

View file

@ -14,7 +14,7 @@ PLUGINS_CONFIG = {
"zone_nameservers": ["ns1.example.com", "ns2.example.com"],
"zone_soa_mname": "ns1.example.com",
"zone_soa_rname": "admin.example.com",
"tolerate_underscores_in_labels": False,
"tolerate_underscores_in_hostnames": False,
"tolerate_leading_underscore_types": [
"TXT",
"SRV",

View file

@ -1,43 +0,0 @@
manager:
max_workers: 1
plan_outputs:
html:
class: octodns.provider.plan.PlanMarkdown
processors:
spf:
class: octodns_spf.SpfDnsLookupProcessor
no-root-ns:
class: octodns.processor.filter.IgnoreRootNsFilter
min-max-ttl:
class: octodns.processor.restrict.TtlRestrictionFilter
allowed_ttls:
- 60
- 300
- 600
- 900
- 1800
- 3600
- 7200
- 10800
providers:
config:
class: octodns.provider.yaml.YamlProvider
directory: ./zones
default_ttl: 3600
enforce_order: true
populate_should_replace: false
netbox:
class: octodns_netbox_dns.NetBoxDNSProvider
url: http://localhost:8000
token: 1ca8f8de1d651b0859052dc5e6a0858fd1e43e3d # change token for netbox
view: false
replace_duplicates: false
make_absolute: true
zones:
"*":
sources:
- config
processors:
- spf
targets:
- netbox

View file

@ -77,8 +77,5 @@ sync *args:
dump *args:
hatch -v run default:dump {{ args }}
dump2 *args:
hatch -v run default:dump2 {{ args }}
validate *args:
hatch -v run default:validate {{ args }}

14
lefthook.yml Normal file
View file

@ -0,0 +1,14 @@
colors: true
no_tty: false
pre-commit:
commands:
01_ruff_check:
stage_fixed: true
glob: "*.py"
run: ruff check --fix-only --exit-zero --silent {all_files}
02_ruff_format:
stage_fixed: true
glob: "*.py"
run: ruff format {all_files}

View file

@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling>=1.24", "hatch-regex-commit>=0.0.3"]
requires = ["hatchling>=1.18", "hatch-regex-commit>=0.0.3"]
build-backend = "hatchling.build"
[project]
@ -11,7 +11,7 @@ requires-python = ">=3.11"
dynamic = ["version"]
authors = [
{ name = "Jeffrey C. Ollie", email = "" },
{ name = "Ivan Schaller", email = "ivan@schaller.sh" },
{ name = "Ivan Schaller", email = "ivan@schaller.sh" }
]
classifiers = [
"License :: OSI Approved :: MIT License",
@ -19,7 +19,10 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.11",
]
dependencies = ["pynetbox>=7.2.0", "dnspython>=2.4.2"]
dependencies = [
"pynetbox>=7.2.0",
"dnspython>=2.4.2",
]
[project.urls]
Homepage = "https://github.com/olofvndrhr/octodns-netbox-dns"
@ -45,9 +48,9 @@ packages = ["src/octodns_netbox_dns"]
[tool.hatch.envs.default]
python = "3.11"
dependencies = [
"pytest==8.2.2",
"coverage==7.5.3",
"octodns==1.9.1",
"pytest==7.4.4",
"coverage==7.4.2",
"octodns==1.5.0",
"octodns-spf==0.0.2",
]
@ -58,23 +61,28 @@ cov-report = ["- coverage combine", "coverage report", "coverage xml"]
cov = ["test-cov", "cov-report"]
sync = ["cd dev && octodns-sync --debug --config-file sync.yml --force {args}"]
dump = [
"cd dev && octodns-dump --debug --config-file sync.yml --output-dir output {args} '*' netbox",
]
dump2 = [
"cd dev && octodns-dump --debug --config-file sync2.yml --output-dir output {args} '*' netbox",
]
dump = ["cd dev && octodns-dump --debug --config-file sync.yml --output-dir output {args} '*' netbox"]
validate = ["cd dev && octodns-validate --debug --config-file sync.yml {args}"]
[tool.hatch.envs.lint]
python = "3.11"
detached = true
dependencies = ["mypy==1.10.0", "ruff==0.4.8"]
dependencies = [
"mypy==1.8.0",
"ruff==0.2.2",
]
[tool.hatch.envs.lint.scripts]
typing = "mypy --non-interactive --install-types {args:src/octodns_netbox_dns}"
style = ["ruff check --diff {args:.}", "ruff format --check --diff {args:.}"]
fmt = ["ruff check --fix {args:.}", "ruff format {args:.}", "style"]
style = [
"ruff check --diff {args:.}",
"ruff format --check --diff {args:.}"
]
fmt = [
"ruff check --fix {args:.}",
"ruff format {args:.}",
"style"
]
all = ["style", "typing"]
###
@ -104,7 +112,7 @@ exclude = [
"dist",
"node_modules",
"venv",
"dev",
"dev"
]
[tool.ruff.lint]
@ -135,18 +143,8 @@ select = [
"W",
"YTT",
]
ignore = [
"E501",
"D103",
"D100",
"D102",
"PLR2004",
"D403",
"ISC001",
"FBT001",
"FBT002",
"FBT003",
]
ignore-init-module-imports = true
ignore = ["E501", "D103", "D100", "D102", "PLR2004", "D403", "ISC001", "FBT001", "FBT002", "FBT003"]
unfixable = ["F401"]
[tool.ruff.format]
@ -233,10 +231,7 @@ parallel = true
omit = ["src/octodns_netbox_dns/__about__.py"]
[tool.coverage.paths]
octodns_netbox_dns = [
"src/octodns_netbox_dns",
"*/octodns-netbox-dns/src/octodns_netbox_dns",
]
octodns_netbox_dns = ["src/octodns_netbox_dns", "*/octodns-netbox-dns/src/octodns_netbox_dns"]
tests = ["tests", "*/octodns-netbox-dns/tests"]
[tool.coverage.report]

View file

@ -1 +1 @@
__version__ = "0.3.6"
__version__ = "0.3.4"

View file

@ -430,13 +430,3 @@ class NetBoxDNSProvider(octodns.provider.base.BaseProvider):
value=record,
disable_ptr=self.disable_ptr,
)
def list_zones(self) -> list[str]:
"""get all zones from netbox
@return: a list with all active zones
"""
query_params = {"status": "active", **self.nb_view}
zones = self.api.plugins.netbox_dns.zones.filter(**query_params)
return sorted([self._make_absolute(z.name) for z in zones])