feat!: complete refactoring of server (#1)
* make a python server * improve authentication by token/hash * better logging * add helper tool for new hosts Reviewed-on: #1 Co-authored-by: Max Mehl <mail@mehl.mx>
This commit was merged in pull request #1.
This commit is contained in:
1 parent
a1c55f4574
commit
0cd8438ab3
15 files changed
+1485
-327
No files matched your search
@@ -0,0 +1,30 @@
|
||||
# Copy to ~/etc/snap-dyndns/config.toml (outside the web root) and chmod 600.
|
||||
|
||||
# Where the last known IPs are cached (default shown)
|
||||
state_file = "~/etc/snap-dyndns/state.json"
|
||||
|
||||
# Header in which the reverse proxy puts the address of the device. The last entry is used.
|
||||
# X-Forwarded-For is what Uberspace's proxy sets. Without this line the TCP peer's address is used,
|
||||
# which is the proxy behind a web backend.
|
||||
# Addresses that are not global (e.g. the proxy's) are rejected unless the device sends myip.
|
||||
client_ip_header = "X-Forwarded-For"
|
||||
|
||||
[inwx]
|
||||
user = "api-user"
|
||||
pass = "api-password"
|
||||
# Only needed if the INWX account has 2FA enabled (base32 secret of the authenticator)
|
||||
# totp_secret = "JBSWY3DPEHPK3PXP"
|
||||
# Default is the live API. Use the OT&E test system for experiments:
|
||||
# api = "https://api.ote.domrobot.com/jsonrpc/"
|
||||
|
||||
# One section per hostname. The hostname is the Basic Auth user, the token the password.
|
||||
# The record (A and/or AAAA) must already exist at INWX.
|
||||
# Generate a token and its hash with:
|
||||
# python3 -c 'import secrets,hashlib;t=secrets.token_urlsafe(32);print(t, hashlib.sha256(t.encode()).hexdigest())'
|
||||
[hosts."user1.example.com"]
|
||||
token_sha256 = "replace-with-sha256-hex-of-the-token"
|
||||
# INWX zone, defaults to the last two labels of the hostname
|
||||
# zone = "example.co.uk"
|
||||
|
||||
[hosts."user2.example.com"]
|
||||
token_sha256 = "replace-with-another-hash"
|
||||
Reference in new issue
Block a user