Skip to content

Commit bf383f0

Browse files
committed
feat(dyndns): add modern Hetzner DNS API v1 implementation
- Rewrite for current Hetzner DNS API (https://api.hetzner.cloud/v1/) - Support for zone name and zone ID with automatic lookup - IPv4 (A) and IPv6 (AAAA) record types - Intelligent updates: only modify records when IP address changes - Automatic public IP detection with multiple fallback methods - Full backward compatibility with legacy environment variables - Comprehensive logging with optional color output - Support for all legacy configuration methods Features: - Verbose debug mode (-v flag) - Force colors mode (-C flag) - Intelligent color detection (terminal only) - NO_COLOR standard compliance - Complete documentation and examples - Automated test suite Files: - dyndns.sh: Main script with full functionality - config-examples.sh: 10 practical configuration examples - test.sh: Automated test suite - README.md: Complete documentation - LICENSE: GPL-3.0
0 parents  commit bf383f0

File tree

6 files changed

+2468
-0
lines changed

6 files changed

+2468
-0
lines changed

.github/workflows/release.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Create ZIP file
20+
run: |
21+
VERSION=${GITHUB_REF#refs/tags/}
22+
mkdir -p hetzner-dyndns-${VERSION}
23+
cp dyndns.sh hetzner-dyndns-${VERSION}/
24+
cp config-examples.sh hetzner-dyndns-${VERSION}/
25+
cp README.md hetzner-dyndns-${VERSION}/
26+
cp LICENSE hetzner-dyndns-${VERSION}/
27+
zip -r hetzner-dyndns-${VERSION}.zip hetzner-dyndns-${VERSION}
28+
echo "ZIP_FILE=hetzner-dyndns-${VERSION}.zip" >> $GITHUB_ENV
29+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
30+
31+
- name: Get changelog entry
32+
id: changelog
33+
run: |
34+
# Extract changelog section for this version from README
35+
VERSION=${GITHUB_REF#refs/tags/}
36+
# Try to extract changelog, fallback to generic message
37+
CHANGELOG=$(grep -A 10 "### Version.*${VERSION##v}" README.md || echo "Release ${VERSION}")
38+
echo "BODY<<EOF" >> $GITHUB_OUTPUT
39+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
40+
echo "EOF" >> $GITHUB_OUTPUT
41+
42+
- name: Create Release
43+
uses: softprops/action-gh-release@v1
44+
with:
45+
files: ${{ env.ZIP_FILE }}
46+
body: |
47+
## Hetzner DNS DynDNS Update Script - ${{ env.VERSION }}
48+
49+
${{ steps.changelog.outputs.BODY }}
50+
51+
### Contents
52+
- `dyndns.sh` - Main DynDNS update script
53+
- `config-examples.sh` - Configuration examples and helpers
54+
- `test.sh` - Test suite
55+
- `README.md` - Complete documentation
56+
- `LICENSE` - GPL-3.0 license
57+
58+
### Quick Start
59+
```bash
60+
unzip hetzner-dyndns-${{ env.VERSION }}.zip
61+
cd hetzner-dyndns-${{ env.VERSION }}
62+
chmod +x dyndns.sh
63+
HETZNER_AUTH_API_TOKEN='your-token' ./dyndns.sh -Z example.com -n dyn
64+
```
65+
66+
For full documentation, see [README.md](https://github.com/${{ github.repository }}/blob/${{ env.VERSION }}/README.md)
67+
draft: false
68+
prerelease: false
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# License: GPL-3.0
2+
#
3+
# Hetzner DNS DynDNS Update Script
4+
# A Bash script for automatic DNS record updates using the current Hetzner DNS API
5+
#
6+
# Copyright (c) 2026 - Contributors
7+
#
8+
# This program is free software: you can redistribute it and/or modify
9+
# it under the terms of the GNU General Public License as published by
10+
# the Free Software Foundation, either version 3 of the License, or
11+
# (at your option) any later version.
12+
#
13+
# This program is distributed in the hope that it will be useful,
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
# GNU General Public License for more details.
17+
#
18+
# You should have received a copy of the GNU General Public License
19+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
#
21+
# ADDITIONAL TERMS:
22+
#
23+
# This project is maintained unofficially and is not directly supported
24+
# by Hetzner Cloud. Use at your own risk.
25+
#
26+
# For official documentation and support see:
27+
# https://docs.hetzner.cloud/
28+
# https://docs.hetzner.com/

0 commit comments

Comments
 (0)