| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo/workflows | ||
| .gitignore | ||
| creds.json.example | ||
| dnsconfig.js.example | ||
| LICENSE | ||
| README.md | ||
DNSControl Template (deSEC + Forgejo Actions)
This repository can be published as a reusable template for DNS-as-code using DNSControl.
What is included
dnsconfig.js.example: starter DNS config with dummy values.creds.json.example: credentials file using environment variable injection..forgejo/workflows/push.yml: CI workflow for validation/preview and manual apply.
Quick start
- Copy and customize the DNS config:
cp dnsconfig.js.example dnsconfig.js - Copy credentials template:
cp creds.json.example creds.json - Export your API token locally:
export DESEC_API_TOKEN="your-token" - Validate and preview:
dnscontrol check dnscontrol preview - Apply changes when ready:
dnscontrol push
Forgejo workflow
The workflow in .forgejo/workflows/push.yml is split into two safe stages:
-
validate-and-preview:- Runs on
pull_requestandpushtomain - Executes
dnscontrol check - Executes
dnscontrol previewonly ifDESEC_API_TOKENis available
- Runs on
-
push-dns:- Runs only on manual trigger (
workflow_dispatch) - Executes
dnscontrol push - Fails if
DESEC_API_TOKENis missing
- Runs only on manual trigger (
Codeberg Actions setup
If you host this repository on Codeberg, make sure Actions are enabled in Settings -> Units for the repository.
For CI jobs, it is recommended to use your own Forgejo Actions Runner.
Reference: https://docs.codeberg.org/ci/actions/
Secrets setup
Set this repository secret in GitHub or Forgejo:
DESEC_API_TOKEN: required API token for your deSEC account
creds.json and dnsconfig.js are ignored via .gitignore, so real credentials and production records stay local.
Suggested publishing flow
- Keep your personal production records in private branches or private repos.
- Keep public template content generic (
example.com, test IP ranges). - Open PRs for DNS changes and review
dnscontrol previewoutput. - Trigger manual workflow dispatch only when changes are approved.
Provider support
DNSControl supports many more DNS providers than deSEC. It is also possible to manage and push changes to multiple providers in parallel from one config. See the official provider list: https://docs.dnscontrol.org/provider/index
AI Assistance Notice
Parts of this project were created or refined with AI assistance. All generated changes should be reviewed and tested by a human maintainer before release.
License
This repository uses the MIT License (see LICENSE).