dschanoeh / hover-ddns

A Dynamic DNS client for Hover using their unofficial API
Apache License 2.0
39 stars 6 forks source link

cmd hangs, no output. #6

Closed burabure closed 2 years ago

burabure commented 2 years ago

just installed the arm7 deb on my raspberry 4 and I cannot get it to update the ip.

pi@raspberrypi:~ $ hover-ddns -version
hover-ddns version 0.5.2, commit 5b0b25746bc6e878c30fda0776718eaa894d13de, built at 2021-11-22T09:54:29Z by goreleaser

pi@raspberrypi:~ $ hover-ddns -debug -verbose -dry-run -config /etc/hover-ddns.yaml
INFO[0000] Getting public IPv4...
INFO[0000] Received public IP xxxxxx
INFO[0000] Getting public IPv6...
WARN[0000] Failed to get public ip: dial udp [xxxxxxx::35]:53: connect: network is unreachable
INFO[0000] Received public IP <nil>
INFO[0000] --- Processing host xxxxxxxxxxxx ---
INFO[0000] Resolving current IPv4...
INFO[0000] Received current IPv4 xxxxx
INFO[0000] v4 IPs differ - update required...

pi@raspberrypi:~ $ hover-ddns -debug -verbose -config /etc/hover-ddns.yaml
# it  hangs forever ...
pi@raspberrypi:~ $ lscpu
Architecture:        armv7l
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           1
Vendor ID:           ARM
Model:               3
Model name:          Cortex-A72
Stepping:            r0p3
CPU max MHz:         1500.0000
CPU min MHz:         600.0000
BogoMIPS:            108.00
Flags:               half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
burabure commented 2 years ago

both -validate-config and -manual-ipv4 also hang with no output even though -verbose -debug are set

dschanoeh commented 2 years ago

Hi, the program's default mode is to run continuosly and checks periodically if updating needs to take place. So for normal operation at least, the "hanging" is expected. It will wait until the next trigger of the cron expression and only then you will come alive and you'll see some output. I'm guessing you maybe didn't wait long enough for your cron expression to trigger? If you set it to cron_expression: "* * * * *" for test purposes, this'll at most take a minute. Can you please run that again and give it a bit to see what it does?

Config validation is supposed to be run like this: hover-ddns --validate-config config.yaml and not combined with other parameters. Can you please confirm if this returns any output and if it returns immediately (it should)?

burabure commented 2 years ago
pi@raspberrypi:~ $ hover-ddns -debug -verbose -config /etc/hover-ddns.yaml
INFO[0015] Getting public IPv4...
INFO[0015] Received public IP 190.22.2.176
INFO[0015] --- Processing host nc.burabure.com ---
INFO[0015] Resolving current IPv4...
INFO[0015] Received current IPv4 190.22.12.75
INFO[0015] v4 IPs differ - update required...
INFO[0015] Getting Hover auth cookie...
ERRO[0018] Could not log in: Received status code 401

After this I checked my login and remembered that I had 2FA on 🤦 so I after turning that off it worked lol. Thanks for the help!

PS: validate config returns immediately with no output, if this is the intended result it's a bit confusing

pi@raspberrypi:~ $ hover-ddns -validate-config /etc/hover-ddns.yaml
pi@raspberrypi:~ $
burabure commented 2 years ago

BTW, since if we have the 2FA secret we could generate the token for login. Would it be possible to login with 2FA automatically? I guess they don't have a way via the API, but maybe we could just login via web?

dschanoeh commented 2 years ago

Unfortunately, I haven't seen any info on if/how 2FA is supported on the API. Also, I don't know if this tool would be any good at that point. The idea is to have it run unattended and perform the updates automatically when necessary. If suddenly you are in the loop to provide your second factor, you might as well just do the update yourself...