1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Merge branch 'main' into dynamic-zones

This commit is contained in:
Ross McFarland
2023-08-10 16:27:07 -06:00
committed by GitHub
4 changed files with 72 additions and 28 deletions

View File

@@ -9,33 +9,32 @@ The architecture is pluggable and the tooling is flexible to make it applicable
## Table of Contents
- [DNS as code - Tools for managing DNS across multiple providers](#dns-as-code---tools-for-managing-dns-across-multiple-providers)
- [Table of Contents](#table-of-contents)
- [Getting started](#getting-started)
* [Workspace](#workspace)
+ [Installing a specific commit SHA](#installing-a-specific-commit-sha)
* [Config](#config)
* [Noop](#noop)
* [Making changes](#making-changes)
* [Workflow](#workflow)
* [Bootstrapping config files](#bootstrapping-config-files)
- [Providers](#providers)
* [Updating to use extracted providers](#updating-to-use-extracted-providers)
- [Sources](#sources)
+ [Notes](#notes)
- [Compatibility and Compliance](#compatibilty-and-compliance)
* [`lenient`](#-lenient-)
* [`strict_supports`](#-strict-supports-)
* [Configuring `strict_supports`](#configuring--strict-supports-)
- [Custom Sources and Providers](#custom-sources-and-providers)
- [Other Uses](#other-uses)
* [Syncing between providers](#syncing-between-providers)
* [Dynamic sources](#dynamic-sources)
- [Contributing](#contributing)
- [Getting help](#getting-help)
- [Related Projects and Resources](#related-projects-and-resources)
- [License](#license)
- [Authors](#authors)
* [Getting started](#getting-started)
* [Workspace](#workspace)
* [Installing a specific commit SHA](#installing-a-specific-commit-sha)
* [Config](#config)
* [Noop](#noop)
* [Making changes](#making-changes)
* [Workflow](#workflow)
* [Bootstrapping config files](#bootstrapping-config-files)
* [Providers](#providers)
* [Updating to use extracted providers](#updating-to-use-extracted-providers)
* [Sources](#sources)
* [Notes](#notes)
* [Automatic PTR generation](#automatic-ptr-generation)
* [Compatibility and Compliance](#compatibility-and-compliance)
* [`lenient`](#lenient)
* [`strict_supports`](#strict_supports)
* [Configuring `strict_supports`](#configuring-strict_supports)
* [Custom Sources and Providers](#custom-sources-and-providers)
* [Other Uses](#other-uses)
* [Syncing between providers](#syncing-between-providers)
* [Dynamic sources](#dynamic-sources)
* [Contributing](#contributing)
* [Getting help](#getting-help)
* [Related Projects and Resources](#related-projects-and-resources)
* [License](#license)
* [Authors](#authors)
## Getting started
@@ -312,7 +311,7 @@ Similar to providers, but can only serve to populate records into a zone, cannot
| [ZoneFileSource](/octodns/source/axfr.py) | A, AAAA, CAA, CNAME, MX, NS, PTR, SPF, SRV, TXT | No | read-only |
| [TinyDnsFileSource](/octodns/source/tinydns.py) | A, CNAME, MX, NS, PTR | No | read-only |
#### Notes
### Notes
* ALIAS support varies a lot from provider to provider care should be taken to verify that your needs are met in detail.
* Dyn's UI doesn't allow editing or view of TTL, but the API accepts and stores the value provided, this value does not appear to be used when served

View File

@@ -132,6 +132,10 @@ class SrvValue(EqualityTupleMixin, dict):
def data(self):
return self
@property
def rdata_text(self):
return f"{self.priority} {self.weight} {self.port} {self.target}"
def __hash__(self):
return hash(self.__repr__())

31
script/markdown-toc Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env python
from re import compile
from sys import stdin
splitter = compile(r'\s+')
in_pre = False
headings = []
for line in stdin:
if line.startswith('```'):
in_pre = not in_pre
if in_pre or not line.startswith('#'):
continue
level, heading = splitter.split(line, 1)
if 'Table of Contents' in heading:
continue
headings.append((len(level), heading.strip()))
# ignore the first one, it's more of a title
headings.pop(0)
print('\n## Table of Contents\n')
min_level = min(h[0] for h in headings)
for heading in headings:
level = heading[0] - min_level
pre = ' ' * (level * 3)
title = heading[1]
link = title.lower().replace(' ', '-').replace('`', '')
print(f'{pre}* [{title}](#{link})')
print()

View File

@@ -141,6 +141,16 @@ class TestRecordSrv(TestCase):
self.assertEqual(2, a.values[0].weight)
self.assertEqual(3, a.values[0].port)
self.assertEqual('srv.unit.tests.', a.values[0].target)
self.assertEqual('1 2 3 srv.unit.tests.', a.values[0].rdata_text)
# both directions should match
rdata = '1 2 3 srv.unit.tests.'
record = SrvRecord(
zone,
'_srv._tcp',
{'ttl': 32, 'value': SrvValue.parse_rdata_text(rdata)},
)
self.assertEqual(rdata, record.values[0].rdata_text)
def test_srv_value(self):
a = SrvValue({'priority': 0, 'weight': 0, 'port': 0, 'target': 'foo.'})