- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitignore | ||
| declarative-ddns | ||
| LICENSE | ||
| README.md | ||
declarative-ddns
Warning
This was made with 2 promtps to Claude Sonnet 5.5 Medium.
It's made for personal use only, so don't expect any kind of support.
Declarative DNS records for Spaceship.com, with dynamic public-IP support.
Define your records once in a TOML file, grouped by domain.
Any record set to address = "auto" follows your current public IP.
Single file, Python 3.11+, no dependencies.
Installation
- Clone
sh -c 'git clone https://github.com/nnra6864/declarative-ddns "${XDG_DATA_HOME:-$HOME/.local/share}/declarative-ddns" && cd "${XDG_DATA_HOME:-$HOME/.local/share}/declarative-ddns"'
- Link
sh -c 'ln -s "${XDG_DATA_HOME:-$HOME/.local/share}/declarative-ddns/declarative-ddns" "${XDG_HOME:-$HOME/.local}/bin/declarative-ddns"'
The first run creates everything it needs and tells you what to do next:
| What | Where |
|---|---|
| Your records | ~/.config/declarative-ddns/config.toml |
| API key + secret | ~/.config/declarative-ddns/secrets.env (chmod 600, git-ignored) |
| systemd units | ~/.config/systemd/user/declarative-ddns.{service,timer} |
| Command | ~/.local/bin/declarative-ddns (symlink to the clone) |
The clone can live anywhere.
If you move it, run it once from the new location and the units and symlink are repaired automatically.
Usage
- Dry run - show what would change
declarative-ddns
- Apply - the first success enables the background timer
declarative-ddns sync --apply
- Print live records as config.toml
declarative-ddns export DOMAIN
- Raw JSON of live records
declarative-ddns list DOMAIN
- Background timer on
declarative-ddns enable
- Background timer off
declarative-ddns disable
- Logs
journalctl --user -u declarative-ddns
How records are managed
For every (type, name) pair in your config, the config is the source of truth, other records with the same type and name are removed.
Pairs you never mention, and Spaceship's own non-custom records, are never touched.
☦
Ὤ
Ὁ Ν
Ι̅Ϲ̅ │ Χ̅Ϲ̅
───┼───
ΝΙ │ ΚΑ
☦
Εἰς δόξαν τοῦ Θεοῦ
To the glory of God
Τῇ Ὑπεραγίᾳ Θεοτόκῳ δόξα
Glory to the Most Holy Theotokos
Δόξα τῷ Θεῷ πάντων ἕνεκεν
Glory to God for all things
ΑΜΗΝ
☦