kbabioch / php-ddns

PHP script for running your own DynDNS service.
GNU General Public License v3.0
8 stars 7 forks source link

line 26 of update.php invalid #1

Open m-hume opened 2 years ago

m-hume commented 2 years ago

line 26 is not valid php $key = 'hmac-sha256:name KEY')

could we get a description on what this is supposed to be? cheers

bigon commented 1 year ago

key is supposed to be

$key = 'hmac-sha256:name KEY'; (there is a typo at the end) where name is the name of the key defined in bind configuration and KEY the key itself

kbabioch commented 1 year ago

Yes, there is indeed a typo (missing semi-colon). Thank you for noticing.

This is basically a variable that contains the secret that is used to have a secure communication between this script and the nameserver.

In reality it will look something like this:

$key = 'hmac-sha256:ddns-update XXXXXXXXXX';

You can generate such a key using the tsig-keygen command:

[root@ns1 ~]# tsig-keygen -a hmac-sha256 example.com
key "example.com" {
        algorithm hmac-sha256;
        secret "RozyZlWfIa3arEJDG5mhINyW1mPyCR59ydvAZbye3O4=";
};

I guess this needs better / further documentation. Will update it eventually, leaving this issue open in the mean time.