fix: make helper script ask for confirmation on overwrite

This commit is contained in:
mxmehl committed 2026-10-22 14:09:28 +02:00
1 parent 186fe7f9ee
commit 8bc1cfaf27
3 files changed
+84 -13

No files matched your search

+1 -1
View File
@@ -80,7 +80,7 @@ The helper creates a random token, stores only its SHA-256 in the config and pri
python3 ~/snap-dyndns-server/snap_dyndns_host.py user1.example.com
```
Give the printed token to the device, for the [client](https://src.mehl.mx/mxmehl/snap-dyndns-client) it is the `hostname:token` entry shown in the output. The same command for an existing host replaces its token, and the old one stops working immediately. Use `-c` for a config in another location and `-z example.co.uk` for a new host whose INWX zone is not the last two labels of its name. Comments and the rest of the config stay untouched. The config is read on every request, so no restart is needed.
Give the printed token to the device, for the [client](https://src.mehl.mx/mxmehl/snap-dyndns-client) it is the `hostname:token` entry shown in the output. For an existing host it asks before replacing the token (`-y` skips the question), and the old token stops working immediately. Use `-c` for a config in another location and `-z example.co.uk` for a new host whose INWX zone is not the last two labels of its name. Comments and the rest of the config stay untouched. The config is read on every request, so no restart is needed.
The hostname is the Basic Auth user name, the token the password. Without the helper, generate a token and hash yourself with `python3 -c 'import secrets,hashlib;t=secrets.token_urlsafe(32);print(t, hashlib.sha256(t.encode()).hexdigest())'` and add a section `[hosts."user1.example.com"]` with `token_sha256 = "<hash>"`.