zerotier / zeronsd

A DNS server for ZeroTier users
https://zerotier.com
BSD 3-Clause "New" or "Revised" License
510 stars 57 forks source link

Slightly nicer error messages re: zerotier-one #105

Closed laduke closed 3 years ago

laduke commented 3 years ago

Hiya, I'm just hacking and looking at the book and letting my editor guess some stuff for me. Curious about your opinions code-wise and error-message-wise. No rush or anything.

image


User needs to have a running instance of zerotier-one and and it needs to be joined to the network they want to server dns on.

closes issue #104

some example output

travis@tl-zt zeronsd %  sudo  ./target/debug/zeronsd start $NETWORK
INFO - Welcome to ZeroNS!
ERROR - Can't connect to zerotier-one at http://localhost:9993. Is it installed and running?

travis@tl-zt zeronsd % zt-load
travis@tl-zt zeronsd %  sudo  ./target/debug/zeronsd start $UNJOINED_NETWORK
INFO - Welcome to ZeroNS!
ERROR - Are you joined to a84ac5c10a744c9d?

travis@tl-zt zeronsd %  sudo   ./target/debug/zeronsd start -t /tmp/bad-token $JOINED_NETWORK
INFO - Welcome to ZeroNS!
ERROR - error in response: status code 403 Forbidden

travis@tl-zt zeronsd %  sudo ./target/debug/zeronsd start -t /tmp/good-token $JOINED_NETWORK
INFO - Welcome to ZeroNS!
(it works normally)
erikh commented 3 years ago

I didn't merge this yesterday. Gonna merge now, feel free to patch it again! :D