Skip to content

Commit 31cb36f

Browse files
authored
Merge pull request #25 from onetimesecret/feature/dns-commands
Add rots dns command for multi-provider DNS record management
2 parents c5fc071 + 298c43d commit 31cb36f

File tree

14 files changed

+1625
-7
lines changed

14 files changed

+1625
-7
lines changed

.pre-commit-config.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ repos:
9090
files: ^src/
9191
additional_dependencies:
9292
- cyclopts>=3.9
93+
- dns-lexicon>=3.17
94+
- ots-shared>=0.1.0
9395
- pytest>=8.0
9496

9597
# Ruff - fast linting and formatting
@@ -100,14 +102,20 @@ repos:
100102
args: [--fix]
101103
- id: ruff-format
102104

103-
# pytest - run before push with coverage and last-failed optimization
104-
# Skipped on commit for speed; full suite gates push instead
105+
# pytest - fast smoke test on commit, full suite on push (coverage in CI)
105106
- repo: local
106107
hooks:
107-
- id: pytest-cov
108-
name: pytest-cov
109-
entry: .venv/bin/pytest tests/ -x -q --ff --cov=rots --cov-report=term-missing --cov-fail-under=70
108+
- id: pytest-quick
109+
name: pytest-quick
110+
entry: .venv/bin/pytest tests/ -x -q --ff --no-cov
110111
language: system
111-
pass_filenames: true
112+
pass_filenames: false
113+
files: ^(src/|tests/).*\.py$
114+
stages: [pre-commit]
115+
- id: pytest-push
116+
name: pytest-push
117+
entry: .venv/bin/pytest tests/ -x -q --ff --no-cov
118+
language: system
119+
pass_filenames: false
112120
files: ^(src/|tests/).*\.py$
113121
stages: [pre-push]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Added
2+
~~~~~
3+
4+
- Add ``rots dns`` command group for multi-provider DNS record management
5+
via dns-lexicon. Commands: ``add``, ``show``, ``update``, ``remove``,
6+
``list``. Supports Cloudflare, Route53, DigitalOcean, Gandi, GoDaddy,
7+
Hetzner, Linode, Namecheap, Porkbun, Vultr, and DNSimple.
8+
- Auto-detect public IP and DNS provider from native env vars
9+
(e.g. ``CLOUDFLARE_API_TOKEN``, ``AWS_ACCESS_KEY_ID``)
10+
- Track DNS mutations in SQLite audit trail (``dns_records`` and
11+
``dns_current`` tables)
12+
13+
Changed
14+
~~~~~~~
15+
16+
- Align pyright pre-commit hook with project dependencies by adding
17+
``dns-lexicon`` and ``ots-shared`` to ``additional_dependencies``

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Repository = "https://github.com/onetimesecret/rots"
5252
rots = "rots.cli:main"
5353

5454
[project.optional-dependencies]
55+
dns = ["dns-lexicon>=3.17"]
5556
dev = ["pre-commit>=3.0", "pyright>=1.1.390", "ruff>=0.9"]
5657
test = ["pytest>=8.0", "pytest-mock>=3.14", "pytest-cov>=6.0", "coverage>=7.10"]
5758

src/rots/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
from . import __version__
2727
from .commands import assets as assets_cmd
28-
from .commands import cloudinit, env, host, image, init, instance, proxy, service
28+
from .commands import cloudinit, dns, env, host, image, init, instance, proxy, service
2929
from .commands import db as db_cmd
3030

3131
logger = logging.getLogger(__name__)
@@ -44,6 +44,7 @@
4444
app.command(proxy.app)
4545
app.command(host.app)
4646
app.command(service.app)
47+
app.command(dns.app)
4748
app.command(cloudinit.app)
4849
app.command(env.app)
4950
app.command(db_cmd.app)

src/rots/commands/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from . import assets as assets
55
from . import cloudinit as cloudinit
66
from . import db as db
7+
from . import dns as dns
78
from . import env as env
89
from . import host as host
910
from . import image as image

src/rots/commands/dns/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# src/rots/commands/dns/__init__.py
2+
"""DNS management commands."""
3+
4+
from .app import app
5+
6+
__all__ = ["app"]

0 commit comments

Comments
 (0)