Seji64/SniDust

Error on startup: nginx: [emerg] invalid parameter "null" in /etc/nginx/allowedClients.conf:3

Closed this issue · 1 comments

Hi,

I updated today to the latest version of snidust and now get the following error on startup:

nginx: [emerg] invalid parameter "null" in /etc/nginx/allowedClients.conf:3

After analyzing the ACL creation file in my understandig the error seems to be in the jq command. When you type in the following you get 'null'

/usr/bin/dog --json heise.de  | jq '.responses[].answers[1].address
null

But when you change it to answers[], then the IP address is showing the correct value:

/usr/bin/dog --json heise.de  | jq '.responses[].answers[].address
193.99.144.80

So in generateACL.sh the correct command should be:

RESOLVE_RESULT=$(/usr/bin/dog --json "${i}" | jq -r '.responses[].answers[].address')

Kind regards.

i think this bug is occuring cause of pull request #64. however - you are right. if the queried host only return one A record you will get this error. but your suggested bugfix will also not work if you query an record with a CNAME (ex blog.dnsimple.com)