Skip to content

Commit 10b3f97

Browse files
authored
Merge pull request #10 from worryboy/feature/containerize-schlundtech
changes
2 parents 6df3943 + 61cf8fa commit 10b3f97

11 files changed

Lines changed: 34 additions & 3 deletions

.env.dns.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ ENABLE_IPV4=true
1717
ENABLE_IPV6=false
1818

1919
# Run once with DRY_RUN=true before switching to continuous live updates.
20+
# Use docker compose run --rm internetx-dyndns for RUN_ONCE=true validation.
21+
# Use RUN_ONCE=false with docker compose up -d for continuous mode.
2022
DRY_RUN=true
2123
FORCE_UPDATE_ON_NO_CHANGE=false
2224
RUN_ONCE=true

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ DRY_RUN=true
5656
# even in that no-change case.
5757
# FORCE_UPDATE_ON_NO_CHANGE=false
5858
# RUN_ONCE=true: execute a single check cycle and exit instead of looping.
59+
# Use docker compose run --rm internetx-dyndns for one-shot validation.
60+
# Use RUN_ONCE=false with docker compose up -d for continuous mode.
5961
RUN_ONCE=true
6062
# DEBUG=true: print detailed diagnostic logging without exposing secrets,
6163
# including sanitized XML request/response payloads. Passwords and session

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
- Added `.env.dns.example` and wired the example compose file to `.env.dns` to keep DNS settings separate from the Traefik/CrowdSec stack `.env`.
1212
- Documented how the example extends, but does not replace, the goNeuland Traefik/CrowdSec guide and migration note.
1313
- Updated example documentation for outbound-only DynDNS operation, Compose startup ordering, DNS propagation limits, and `PUSHOVER_LOCATION_PREFIX=Berlin`.
14+
- Clarified `RUN_ONCE=true` usage with Docker Compose and added a startup warning for restart-policy loops.
15+
- Improved Dockerfile package/install hygiene and kept the expensive PHP extension build layer cacheable.
1416
- Updated release references to `0.4.0`.
1517

1618
## 0.3.0 - Multi-Target And Notifications

README.Docker.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@ docker run --rm \
187187
worryboy/internetx-dyndns:0.4.0
188188
```
189189

190+
For Compose validation with `RUN_ONCE=true`, use:
191+
192+
```bash
193+
docker compose run --rm internetx-dyndns
194+
```
195+
196+
Do not use `docker compose up -d` for `RUN_ONCE=true` validation with the default restart policy. The worker exits cleanly after one cycle, then Docker starts it again because `restart: unless-stopped` is intended for continuous mode.
197+
190198
Run continuously:
191199

192200
```bash
@@ -205,6 +213,7 @@ docker run -d \
205213
Start with the Docker-Hub-oriented Compose file:
206214

207215
```bash
216+
# set RUN_ONCE=false in .env first
208217
docker compose -f docker-compose.hub.yml up -d
209218
```
210219

@@ -230,6 +239,7 @@ In dry-run mode, the worker may:
230239
- log what would happen
231240

232241
It never sends a live DNS mutation while `DRY_RUN=true`.
242+
With `RUN_ONCE=true`, prefer `docker compose run --rm internetx-dyndns`.
233243

234244
For normal long-running updates, switch to:
235245

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ docker compose build
209209
docker compose run --rm internetx-dyndns
210210
```
211211

212+
Use `docker compose run --rm internetx-dyndns` when `RUN_ONCE=true`. Do not use `docker compose up -d` for one-shot validation with the default restart policy, because Docker will restart the cleanly exited container and it can look like a failure loop.
213+
212214
The recommended validation flags are:
213215

214216
```env
@@ -219,7 +221,7 @@ DEBUG=true
219221

220222
- `DRY_RUN=true` validates config, detects the public IP, creates and closes an InterNetX AuthSession, may run read-only InterNetX zone validation, compares state, and logs what would happen without sending a live DNS update.
221223
- `FORCE_UPDATE_ON_NO_CHANGE=false` is the default and avoids unnecessary live update requests when the detected public IP is unchanged and every target already matches that IP.
222-
- `RUN_ONCE=true` executes a single check cycle and exits instead of looping continuously.
224+
- `RUN_ONCE=true` executes a single check cycle and exits instead of looping continuously. It is meant for `docker compose run --rm internetx-dyndns`.
223225
- `DEBUG=true` prints detailed diagnostic logging without exposing passwords, session hashes, or sensitive credentials. Provider request/response payloads are sanitized and labeled as `auth_session_create`, `read_only_preflight`, `live_mutation`, or `session_cleanup`.
224226
- With `DEBUG=true`, the worker logs each runtime stage as it moves through config validation, public IP detection, authentication/session preflight, target validation, update decision, live mutation, and session cleanup.
225227
- If `PUSHOVER_APP_KEY`, `PUSHOVER_USER_KEY`, and `PUSHOVER_LOCATION_PREFIX` are all configured, the worker can send a Pushover notification when a real public IP change is detected.
@@ -341,12 +343,14 @@ Build and run continuously:
341343

342344
```bash
343345
cp .env.example .env
344-
# edit .env
346+
# edit .env and set RUN_ONCE=false
345347
docker compose build
346348
docker compose up -d
347349
docker compose logs -f
348350
```
349351

352+
Use `docker compose up -d` for continuous mode with `RUN_ONCE=false`. The compose file has `restart: unless-stopped`, so `RUN_ONCE=true` will exit successfully and then be started again by Docker.
353+
350354
Run one safe validation cycle:
351355

352356
```bash

README.traefik-crowdsec-example.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,12 @@ Validate the DNS worker first:
9393
docker compose -f docker-compose.traefik-crowdsec-example.yml run --rm internetx-dyndns
9494
```
9595

96+
This is the preferred command while `RUN_ONCE=true`. Do not use `up -d` for one-shot validation, because the example compose file uses `restart: unless-stopped` for the later continuous mode.
97+
9698
Start the stack:
9799

98100
```bash
101+
# set RUN_ONCE=false in .env.dns first
99102
docker compose -f docker-compose.traefik-crowdsec-example.yml up -d
100103
```
101104

docker-compose.hub.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ services:
22
internetx-dyndns:
33
image: worryboy/internetx-dyndns:latest
44
container_name: internetx-dyndns
5+
# For RUN_ONCE=true, use: docker compose run --rm internetx-dyndns.
6+
# This restart policy is intended for continuous RUN_ONCE=false operation.
57
restart: unless-stopped
68
read_only: true
79
cap_drop:

docker-compose.traefik-crowdsec-example.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ services:
22
internetx-dyndns:
33
image: worryboy/internetx-dyndns:0.4.0
44
container_name: internetx-dyndns
5+
# For RUN_ONCE=true, validate with:
6+
# docker compose -f docker-compose.traefik-crowdsec-example.yml run --rm internetx-dyndns
7+
# This restart policy is intended for continuous RUN_ONCE=false operation.
58
restart: unless-stopped
69
read_only: true
710
cap_drop:

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ services:
44
context: .
55
container_name: internetx-dyndns
66
image: internetx-dyndns:local
7+
# For RUN_ONCE=true, use: docker compose run --rm internetx-dyndns.
8+
# This restart policy is intended for continuous RUN_ONCE=false operation.
79
restart: unless-stopped
810
read_only: true
911
cap_drop:

docker/start.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ set -eu
44
mkdir -p "${STATE_DIR:-/app/state}"
55

66
if [ "${RUN_ONCE:-false}" = "true" ] || [ "${RUN_ONCE:-false}" = "1" ]; then
7+
echo "RUN_ONCE=true: executing one cycle and exiting. With Docker Compose, prefer 'docker compose run --rm internetx-dyndns'; 'docker compose up -d' with a restart policy will start it again." >&2
78
exec php /app/bin/dyndns.php
89
fi
910

0 commit comments

Comments
 (0)