# Selectel DNS provider for octoDNS
An [octoDNS](https://github.com/octodns/octodns/) provider that targets [Selectel DNS](https://docs.selectel.com/cloud-services/dns-hosting/dns_hosting/).
## Contents
* [Installation](#installation)
* [Capabilities](#capabilities)
* [Configuration](#configuration)
* [Quickstart](#quickstart)
* [Current provider vs. Legacy provider](#current-provider-vs-legacy-provider)
* [Migration from legacy DNS API](#migration-from-legacy-dns-api)
* [Development](#development)
## Installation
Install Selectel plugin in your environment and [octodns](https://github.com/octodns/octodns) itself if it is not present.
```bash
pip install octodns octodns-selectel
```
## Capabilities
| What | Value |
|-------------------|---------------------------------------------------|
| Supported records | A, AAAA, ALIAS, CAA, CNAME, DNAME, MX, NS, SRV, SSHFP, TXT |
| Dynamic records | ❌ |
## Configuration
Add selectel provider to `config.yaml`.
```yaml
providers:
selectel:
class: octodns_selectel.SelectelProvider
token: env/KEYSTONE_PROJECT_TOKEN
```
Set **KEYSTONE_PROJECT_TOKEN** environmental variable or write value directly in config without `env/` prefix.
How to obtain required token you can read [here](https://developers.selectel.com/docs/control-panel/authorization/#project-token)
## Quickstart
To get more details on configuration and capabilities check [octodns repository](https://github.com/octodns/octodns)
#### 1. Organize your configs.
```bash
Project
└── .octodns
├── config.yaml
└── zones
├── octodns-test-alias.com.yaml
└── octodns-test.com.yaml
```
#### 2. Fill octodns configuration file
```yaml
# .octodns/config.yaml
providers:
config:
class: octodns.provider.yaml.YamlProvider
directory: ./octodns/zones
default_ttl: 3600
enforce_order: True
selectel:
class: octodns_selectel.SelectelProvider
token: env/KEYSTONE_PROJECT_TOKEN
zones:
octodns-test.com.:
sources:
- config
targets:
- selectel
octodns-test-alias.com.:
sources:
- config
targets:
- selectel
```
#### 3. Prepare config for each of your zones
```yaml
# .octodns/zones/octodns-test.com.yaml
'':
- ttl: 3600
type: A
values:
- 1.2.3.4
- 1.2.3.5
- ttl: 3600
type: AAAA
values:
- 6dc1:b9af:74ca:84e9:6c7c:5c0f:c292:9188
- 5051:e345:9038:052c:00db:eb98:d871:8ae6
- ttl: 3600
type: MX
value:
exchange: mail1.octodns-test.com.
preference: 10
- ttl: 3600
type: TXT
values:
- "bar"
- "foo"
_sip._tcp:
- ttl: 3600
type: SRV
values:
- port: 5060
priority: 10
target: phone1.example.com.
weight: 60
- port: 5030
priority: 20
target: phone2.example.com.
weight: 0
caa:
- ttl: 3600
type: CAA
values:
- flags: 0
tag: issue
value: octodns-test.com.
dname:
- ttl: 3600
type: DNAME
value: octodns-test.com.
foo:
- ttl: 3600
type: CNAME
value: bar.octodns-test.com.
sshfp:
- ttl: 3600
type: SSHFP
values:
- algorithm: 1
fingerprint: "4158f281921260b0205508121c6f5cee879e15f22bdbc319ef2ae9fd308db3be"
fingerprint_type: 2
- algorithm: 4
fingerprint: "123456789abcdef67890123456789abcdef67890123456789abcdef123456789"
fingerprint_type: 2
txt:
- ttl: 3600
type: TXT
values:
- "bar_txt"
- "foo_txt"
```
```yaml
# .octodns/zones/octodns-test-alias.com.yaml
'':
- ttl: 3600
type: ALIAS
value: octodns-test.com.
```
#### 4. Check and apply!
```bash
# Run config and check suggested changes
octodns-sync --config-file=.octodns/config.yaml
# Apply changes if everything is ok by adding
octodns-sync --config-file=.octodns/config.yaml --doit
```
### Current provider vs. Legacy provider
Current provider is `octodns_selectel.SelectelProvider`
Legacy provider is `octodns_selectel.SelectelProviderLegacy`
They are not compatible. They utilize different API and created zones live on different authoritative servers.
Zone created in v2 API with current provider is entirely new zone, and not available via v1 api and vice versa.
If you are going to create new zone, we strongly recommend to use `SelectelProvider`.
If you have zones in v1, you still can manage them with `SelectelLegacyProvider`.
If you updated plugin from unstable (0.x.x) version you should rename provider class in octodns config from `SelectelProvider` to `SelectelLegacyProvider`
to work with legacy api.
### Migration from legacy DNS API
If v1 API is still available for you and your zones are hosted there, then you probably would like to move your zones to v2. Legacy API will be eventually shutdown.
With octodns you can sync ALL your v1 zone with v2 by using both providers as in example below.
❗️IMPORTANT❗️
`SELECTEL_TOKEN` and `KEYSTONE_PROJECT_TOKEN` are **different** tokens!
Above we mentioned how to get keystone token, how to obtain selectel token read [here](https://developers.selectel.com/docs/control-panel/authorization/#selectel-token-api-key)
```yaml
processors:
# Selectel doesn't allow manage Root NS records
# for skipping root ns use IgnoreRootNsFilter class
no-root-ns:
class: octodns.processor.filter.IgnoreRootNsFilter
providers:
selectel_legacy:
class: octodns_selectel.SelectelProviderLegacy
token: env/SELECTEL_TOKEN
selectel:
class: octodns_selectel.SelectelProvider
token: env/KEYSTONE_PROJECT_TOKEN
zones:
# Using '*' to sync all zones available on account.
"*":
sources:
- selectel_legacy
processors:
- no-root-ns
targets:
- selectel
```
## Development
See the [/script/](/script/) directory for some tools to help with the development process. They generally follow the [Script to rule them all](https://github.com/github/scripts-to-rule-them-all) pattern. Most useful is `./script/bootstrap` which will create a venv and install both the runtime and development related requirements. It will also hook up a pre-commit hook that covers most of what's run by CI.
Raw data
{
"_id": null,
"home_page": "https://github.com/octodns/octodns-selectel",
"name": "octodns-selectel",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Ross McFarland",
"author_email": "rwmcfa1@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/cb/f3/ccf5c3ce4ae89b834e583023e24230face9e8135d295f7f4be7b1439ac82/octodns_selectel-0.99.3.tar.gz",
"platform": null,
"description": "# Selectel DNS provider for octoDNS\n\nAn [octoDNS](https://github.com/octodns/octodns/) provider that targets [Selectel DNS](https://docs.selectel.com/cloud-services/dns-hosting/dns_hosting/).\n\n## Contents\n\n* [Installation](#installation)\n* [Capabilities](#capabilities)\n* [Configuration](#configuration)\n* [Quickstart](#quickstart)\n* [Current provider vs. Legacy provider](#current-provider-vs-legacy-provider)\n* [Migration from legacy DNS API](#migration-from-legacy-dns-api)\n* [Development](#development)\n\n## Installation\nInstall Selectel plugin in your environment and [octodns](https://github.com/octodns/octodns) itself if it is not present.\n\n```bash\npip install octodns octodns-selectel\n```\n\n## Capabilities\n\n| What | Value |\n|-------------------|---------------------------------------------------|\n| Supported records | A, AAAA, ALIAS, CAA, CNAME, DNAME, MX, NS, SRV, SSHFP, TXT |\n| Dynamic records | \u274c |\n\n## Configuration\nAdd selectel provider to `config.yaml`.\n```yaml\nproviders:\n selectel:\n class: octodns_selectel.SelectelProvider\n token: env/KEYSTONE_PROJECT_TOKEN\n```\nSet **KEYSTONE_PROJECT_TOKEN** environmental variable or write value directly in config without `env/` prefix. \nHow to obtain required token you can read [here](https://developers.selectel.com/docs/control-panel/authorization/#project-token)\n## Quickstart\nTo get more details on configuration and capabilities check [octodns repository](https://github.com/octodns/octodns)\n#### 1. Organize your configs.\n```bash\nProject\n\u2514\u2500\u2500 .octodns\n \u251c\u2500\u2500 config.yaml\n \u2514\u2500\u2500 zones\n \u251c\u2500\u2500 octodns-test-alias.com.yaml\n \u2514\u2500\u2500 octodns-test.com.yaml\n\n```\n#### 2. Fill octodns configuration file\n```yaml\n# .octodns/config.yaml\nproviders:\n config:\n class: octodns.provider.yaml.YamlProvider\n directory: ./octodns/zones\n default_ttl: 3600\n enforce_order: True\n selectel:\n class: octodns_selectel.SelectelProvider\n token: env/KEYSTONE_PROJECT_TOKEN\n\nzones:\n octodns-test.com.:\n sources:\n - config\n targets:\n - selectel\n octodns-test-alias.com.:\n sources:\n - config\n targets:\n - selectel\n```\n#### 3. Prepare config for each of your zones\n```yaml\n# .octodns/zones/octodns-test.com.yaml\n'':\n - ttl: 3600\n type: A\n values:\n - 1.2.3.4\n - 1.2.3.5\n - ttl: 3600\n type: AAAA\n values: \n - 6dc1:b9af:74ca:84e9:6c7c:5c0f:c292:9188\n - 5051:e345:9038:052c:00db:eb98:d871:8ae6\n - ttl: 3600\n type: MX\n value:\n exchange: mail1.octodns-test.com.\n preference: 10\n - ttl: 3600\n type: TXT\n values: \n - \"bar\"\n - \"foo\"\n\n_sip._tcp:\n - ttl: 3600\n type: SRV\n values:\n - port: 5060\n priority: 10\n target: phone1.example.com.\n weight: 60\n - port: 5030\n priority: 20\n target: phone2.example.com.\n weight: 0 \n\ncaa:\n - ttl: 3600\n type: CAA\n values:\n - flags: 0\n tag: issue\n value: octodns-test.com.\n\ndname:\n - ttl: 3600\n type: DNAME\n value: octodns-test.com.\n\nfoo:\n - ttl: 3600\n type: CNAME\n value: bar.octodns-test.com.\n\nsshfp:\n - ttl: 3600\n type: SSHFP\n values:\n - algorithm: 1\n fingerprint: \"4158f281921260b0205508121c6f5cee879e15f22bdbc319ef2ae9fd308db3be\"\n fingerprint_type: 2\n - algorithm: 4\n fingerprint: \"123456789abcdef67890123456789abcdef67890123456789abcdef123456789\"\n fingerprint_type: 2\n\ntxt:\n - ttl: 3600\n type: TXT\n values: \n - \"bar_txt\"\n - \"foo_txt\"\n```\n```yaml\n# .octodns/zones/octodns-test-alias.com.yaml\n'':\n - ttl: 3600\n type: ALIAS\n value: octodns-test.com.\n```\n#### 4. Check and apply!\n```bash\n# Run config and check suggested changes\noctodns-sync --config-file=.octodns/config.yaml\n# Apply changes if everything is ok by adding\noctodns-sync --config-file=.octodns/config.yaml --doit\n```\n\n### Current provider vs. Legacy provider\nCurrent provider is `octodns_selectel.SelectelProvider` \nLegacy provider is `octodns_selectel.SelectelProviderLegacy` \n\nThey are not compatible. They utilize different API and created zones live on different authoritative servers.\nZone created in v2 API with current provider is entirely new zone, and not available via v1 api and vice versa. \n\nIf you are going to create new zone, we strongly recommend to use `SelectelProvider`. \nIf you have zones in v1, you still can manage them with `SelectelLegacyProvider`.\n\nIf you updated plugin from unstable (0.x.x) version you should rename provider class in octodns config from `SelectelProvider` to `SelectelLegacyProvider` \nto work with legacy api.\n\n### Migration from legacy DNS API\nIf v1 API is still available for you and your zones are hosted there, then you probably would like to move your zones to v2. Legacy API will be eventually shutdown. \nWith octodns you can sync ALL your v1 zone with v2 by using both providers as in example below. \n\u2757\ufe0fIMPORTANT\u2757\ufe0f \n`SELECTEL_TOKEN` and `KEYSTONE_PROJECT_TOKEN` are **different** tokens! \nAbove we mentioned how to get keystone token, how to obtain selectel token read [here](https://developers.selectel.com/docs/control-panel/authorization/#selectel-token-api-key)\n```yaml\nprocessors:\n # Selectel doesn't allow manage Root NS records\n # for skipping root ns use IgnoreRootNsFilter class\n no-root-ns:\n class: octodns.processor.filter.IgnoreRootNsFilter\n\nproviders:\n selectel_legacy:\n class: octodns_selectel.SelectelProviderLegacy\n token: env/SELECTEL_TOKEN\n selectel:\n class: octodns_selectel.SelectelProvider\n token: env/KEYSTONE_PROJECT_TOKEN\n\nzones:\n # Using '*' to sync all zones available on account.\n \"*\":\n sources:\n - selectel_legacy\n processors:\n - no-root-ns\n targets:\n - selectel\n```\n\n## Development\nSee the [/script/](/script/) directory for some tools to help with the development process. They generally follow the [Script to rule them all](https://github.com/github/scripts-to-rule-them-all) pattern. Most useful is `./script/bootstrap` which will create a venv and install both the runtime and development related requirements. It will also hook up a pre-commit hook that covers most of what's run by CI.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Selectel DNS provider for octoDNS",
"version": "0.99.3",
"project_urls": {
"Homepage": "https://github.com/octodns/octodns-selectel"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b29e37b0ed76e0881e6849d6759d83b75384e04df145039af2f7583b04b8f9ee",
"md5": "2ecc3a44bd270ea9fcbb88f1bec6e0d5",
"sha256": "b94678c138567d33740514ecc7340f60f86348d4c2dae08d8298ec41ea964a92"
},
"downloads": -1,
"filename": "octodns_selectel-0.99.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2ecc3a44bd270ea9fcbb88f1bec6e0d5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 13455,
"upload_time": "2024-05-06T14:35:44",
"upload_time_iso_8601": "2024-05-06T14:35:44.279208Z",
"url": "https://files.pythonhosted.org/packages/b2/9e/37b0ed76e0881e6849d6759d83b75384e04df145039af2f7583b04b8f9ee/octodns_selectel-0.99.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cbf3ccf5c3ce4ae89b834e583023e24230face9e8135d295f7f4be7b1439ac82",
"md5": "a99f5ca4d41a783952beec0a14849715",
"sha256": "f6cadff205b18a6e27c493de94a6229af8ff5b9920f9198dc27e2fecfc6d82d9"
},
"downloads": -1,
"filename": "octodns_selectel-0.99.3.tar.gz",
"has_sig": false,
"md5_digest": "a99f5ca4d41a783952beec0a14849715",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 14085,
"upload_time": "2024-05-06T14:35:46",
"upload_time_iso_8601": "2024-05-06T14:35:46.074599Z",
"url": "https://files.pythonhosted.org/packages/cb/f3/ccf5c3ce4ae89b834e583023e24230face9e8135d295f7f4be7b1439ac82/octodns_selectel-0.99.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-06 14:35:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "octodns",
"github_project": "octodns-selectel",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "PyYAML",
"specs": [
[
"==",
"6.0.1"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2024.2.2"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.3.2"
]
]
},
{
"name": "dnspython",
"specs": [
[
"==",
"2.6.1"
]
]
},
{
"name": "fqdn",
"specs": [
[
"==",
"1.5.1"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.7"
]
]
},
{
"name": "natsort",
"specs": [
[
"==",
"8.4.0"
]
]
},
{
"name": "octodns",
"specs": [
[
"==",
"1.6.1"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.9.0.post0"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.31.0"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.16.0"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.2.1"
]
]
}
],
"lcname": "octodns-selectel"
}